Back to Learning

Coding

814 prompts available

Add PS5 Rhythm Shooting

You are provided with a C-like game scripting code that defines button mappings and a shooting action with adjustable timing. Your task is to add a rhythm-based shooting tempo script that ensures AI-consistent timing for shooting actions on a PS5 controller. Requirements: - Create a new combo/script that performs automatic shooting at a steady rhythm, i.e., shooting repeatedly with consistent intervals. - The shooting button for this new rhythmic shooting combo should be mapped to PS5_L1. - Integrate this new combo/script alongside the existing `AutoGreen` shooting combo without disrupting existing functionality. - Provide variables or mechanisms to control the tempo (interval between shots) to ensure consistent timing, making it suitable for AI consistency. - Maintain the style and conventions used in the initial script, including wait times and button press/release handling. Steps: 1. Define the new shooting button as `define RHYTHM_SHOOTER = PS5_L1;`. 2. Create a new combo, e.g., `combo RhythmShooter`, that fires the shoot button repeatedly with consistent intervals (for rhythm), using waits to create the tempo. 3. Add code to the `main` function to trigger the `RhythmShooter` combo when the RHYTHM_SHOOTER button is pressed. 4. Ensure the new combo stops or is interruptible as appropriate. 5. Optionally include a variable to adjust the tempo interval. Output Format: Provide the complete updated script code, including all new defines, variables, main logic, and combos, formatted exactly as code, ready to copy and use directly in the game scripting environment. Do not add explanations or commentary outside of the code. Preserve existing code structure and comments where appropriate.

A/B Test Code Review

Review and analyze the provided development guidelines for building client-side A/B tests using JavaScript, CSS, and HTML. Based on these guidelines, compose a comprehensive set of instructions for a Claude 3.5 Sonnet AI expert to effectively review code for such A/B tests. The instructions should focus on ensuring adherence to best practices and guidelines. # Goals - Thoroughly understand the development guidelines. - Ensure the A/B test code is implemented correctly and efficiently. - Identify any deviations from the guidelines and suggest corrections. # Steps 1. **Analyze Guidelines**: Carefully read through all provided development guidelines with a focus on specific instructions related to JavaScript, CSS, and HTML. 2. **Set Up Environment**: Prepare an environment conducive to running and testing client-side code if needed. 3. **Code Review**: - **Structure**: Ensure the HTML/CSS/JavaScript structure aligns with best practice standards. - **Functionality**: Check that the JavaScript implements the required functionality effectively. - **Styling**: Verify that the CSS is correctly applied and follows styling guidelines. - **Compatibility**: Test across different browsers if specified. 4. **Documentation**: Ensure proper documentation is available for understanding, deploying, and maintaining the tests. 5. **Feedback Report**: Compile a report on findings, including both adherence to guidelines and areas for improvement. # Output Format - Provide a clear step-by-step analysis. - List any issues found and suggestions for improvements in a concise manner. - Ensure feedback is actionable and easy to understand. # Examples - When reviewing the HTML structure, check for semantic use of tags, and ensure all elements have appropriate accessibility features. - For JavaScript, make sure the code is modular and follows asynchronous best practices where applicable. # Notes - Pay extra attention to the A/B test objective should ensure test variants are correctly tracked. - Check for any HTML5/CSS3 features used for compatibility with targeted browsers.

AB Testing Module Creation

Create a Python module for A/B testing with the following requirements: The module must support versioning of prompts and allow managing multiple prompt versions simultaneously. It should log which prompt version was used to generate a smart subject and have functionality to adjust the prompt version for different client segments via a database configuration table. The A/B test should facilitate comparisons between different versions of smart subjects, such as smart subject v1 versus smart subject v2. Additionally, the module needs to allow switching between different testing percentages, such as moving from a default 50/50 split to an 80/20 split. Ensure that the implementation utilizes DynamoDB for data storage but also includes the necessary steps for exporting the DynamoDB table to Redshift for further analysis. Key Features to Implement: - **Prompt Versioning:** Structure to manage multiple versions of prompts. - **Version Logging:** Capture which prompt version was utilized in generating each smart subject. - **Client-Specific Configuration:** Ability to change prompt versions for specific client groups based on a configuration stored in a database. - **Flexible A/B Testing:** Allow for comparisons of different smart subject versions. - **Custom Test Percentages:** Functionality to easily adjust the distribution ratios for testing (e.g., 80/20). - **DynamoDB to Redshift Export:** Outline the method for exporting data from a DynamoDB table over to Redshift. Output Format: Provide the implementation code for the module, including class definitions, methods with docstrings, and example usage. Ensure comments explain the logic clearly where necessary.

Add Random Shortcut Features

Update or add features to the previously created script to include shortcut functionalities for inserting random strings and random numbers in the "from email", subject, and body sections of the email. Clearly explain how users should utilize these new shortcut features within the script. Guidelines: - Modify the existing script to support placeholders or shortcut tokens that, when used, are replaced with random strings or random numbers. - Ensure these shortcuts can be used seamlessly in the "from email", subject, and body of the email. - Provide detailed instructions or examples demonstrating how to apply these shortcuts in practice. - Encourage the explanation to include the format or syntax for invoking random strings and numbers, any limitations, and configuration options if applicable. # Steps 1. Identify areas in the script handling the "from email", subject, and body where shortcut features can be integrated. 2. Define shortcut tokens or placeholders for random strings and random numbers. 3. Implement logic to detect and replace these shortcuts with appropriate random data. 4. Test the script to ensure the shortcuts function correctly in all relevant email fields. 5. Write user-friendly documentation or comments explaining usage. # Output Format Provide updated script code with the new features integrated, followed by a usage guide section explaining how to use the random string and number shortcuts within the script. # Examples If the script accepts placeholders like {{rand_str}} or {{rand_num}}, demonstrate how inserting "{{rand_str}}" in the subject results in a random string in the final email subject. # Notes Ensure the random strings and numbers generated are of a reasonable length and format appropriate for email fields. Clarify if customization of length or format is supported.

ABAP AI SDK LLM Prompt

Provide detailed methods and code examples for using the ABAP AI SDK to send a prompt to a Large Language Model (LLM). Include explanations of the necessary classes, functions, or interfaces involved in the process. Illustrate how to construct the prompt, send it to the LLM via the SDK, and handle the response effectively within an ABAP environment. # Steps 1. Explain the setup required for the ABAP AI SDK concerning LLM integration. 2. Demonstrate how to create and prepare a prompt in ABAP. 3. Show the method or function call to send the prompt to the LLM using the SDK. 4. Provide an example of handling and processing the response returned by the LLM. 5. Include any necessary error handling or best practices. # Output Format Return a detailed explanation along with example ABAP code snippets demonstrating each step clearly.

Add Rare Item Chat Message

You are tasked with modifying a game feature involving crates and chat messages. Specifically, whenever a player obtains the rarest item from a crate, there should be a message that pops up in the chat indicating that the player received this rare item. Additionally, adjust the in-game crate display by making the text appearing above the crate larger, removing any gray background from this text area, and repositioning the text slightly lower to improve visibility. # Steps 1. Detect when a player obtains the rarest crate item. 2. Trigger a chat message announcing the player's achievement. 3. Increase the font size of the text displayed above the crate. 4. Remove the gray background behind this text. 5. Adjust the vertical positioning of the text, moving it slightly downward. # Output Format Provide clear, concise code snippets or instructions detailing how to implement these changes, including any relevant game logic or UI adjustments.

ABAP Class Generator

Generate a complete ABAP class based on the provided XMI file content. You will be given the contents of an XMI file describing a class structure, including its attributes, methods, and other relevant details. Your task is to translate this structure into a fully functional ABAP class source code. The generated ABAP class should include: - The class header with the CLASS declaration, including public or private sections as appropriate. - Attributes, constants, and types defined as per the XMI file. - Method declarations with proper signatures in the class definition. - Method implementations following the declarations, including the IMPLEMENTATION section of the class. - Proper indentation and ABAP syntax conventions. # Steps 1. Parse the XMI file content to identify the class name, attributes, constants, types, and methods. 2. Generate the class definition section including all sections (PUBLIC, PROTECTED, PRIVATE) as required. 3. For each method, provide the method signature in the class and the method implementation in the implementation section. 4. Include necessary statements like "CLASS ... DEFINITION.", "CLASS ... IMPLEMENTATION.", and "ENDCLASS.". 5. Ensure that all code compiles according to ABAP syntax standards. # Output Format Return the full ABAP class code as a single code block, maintaining proper formatting and indentation. # Notes - If the XMI file contains any unknown or unsupported elements, make reasonable assumptions or note them in comments. - Ensure that the class structure correctly reflects the visibility and type constraints as specified in the XMI. - The output should be ready for direct use in an SAP environment. # Response Format Provide the complete ABAP class code only, within a single code block tagged as `abap`. Do not include any additional explanations or commentary.

Add Registration Feature

Improve a web page by adding a 'Register Here' button and creating a corresponding registration page. Details: - Add a clearly visible 'Register Here' button on the existing web page for new users who want to register as members. - Create a registration page that includes fields for the following user information: - User Name - Phone Number - Email - Password - Confirm Password - Address Requirements: - Ensure the registration page collects all the above fields in a user-friendly manner. - Implement basic validation such as matching password and confirm password fields. - The 'Register Here' button on the main page should link to the registration page. # Steps 1. Modify the existing web page to add a 'Register Here' button prominently. 2. Design the registration page HTML form with all required fields. 3. Include front-end validation for required fields and password confirmation. 4. Connect the button on the main page to navigate to the registration page. # Output Format Provide: - HTML code snippet adding the 'Register Here' button with linking. - Full HTML code for the registration page including the form and validation. # Notes - Assume CSS styling can be basic but clear. - Do not implement back-end logic; focus on front-end form and navigation. - Use standard HTML5 form input types where applicable.

Add Renewal Button

You have an Angular component named `BddCoverageComponent` that currently displays a list of quotes or records. Each record displays two buttons: 'edit' and 'delete'. Your task is to enhance this component by adding a new button labeled 'renewal' for each quote. When the 'renewal' button is clicked, it should open the `BddFormDialogComponent`, which is a dialog form component. This dialog will allow users to create a new quote with a different effective date. To accomplish this, follow these steps: 1. Modify the `BddCoverageComponent` template to include a third button labeled 'renewal' alongside the existing 'edit' and 'delete' buttons for each quote. 2. Implement a click event handler on the 'renewal' button within `BddCoverageComponent`. 3. In the event handler, programmatically open the `BddFormDialogComponent` as a dialog. This will require injecting Angular Material's `MatDialog` service (or equivalent) into the component. 4. Pass necessary data to the `BddFormDialogComponent` to distinguish that this is a renewal action, potentially pre-filling fields or adjusting the form logic as needed. 5. Ensure the `BddFormDialogComponent` allows creating a new quote with a different effective date, separate from editing existing quotes. 6. Handle dialog close events to refresh the quotes list in `BddCoverageComponent` if a new quote was created. # Output Format Provide the updated Angular TypeScript code snippets for the following: - The changes in the `BddCoverageComponent` template to add the 'renewal' button. - The updated `BddCoverageComponent` TypeScript code showing the injection of the dialog service and the handler logic for opening the renewal dialog. - Any relevant example usages or configuration needed to use `BddFormDialogComponent` as a dialog. Include comments in the code that clarify each major step or function for clarity and maintainability.

ABAP Class Method Generator

Generate the method declaration and implementation code for an ABAP class based on the provided portion of an XMI file. Use the XMI input to identify the class name, method names, parameters, return types, and visibility (public, protected, private). Include necessary ABAP syntax for both the class definition (method declarations) and the class implementation (method bodies with stubs or basic logic if sufficient info is present). # Steps 1. Parse the provided XMI snippet to extract class and method details. 2. For each method, determine its signature: name, parameters (names and types), return type, and visibility. 3. Generate the ABAP class definition segment with method declarations in the appropriate visibility section. 4. Generate the ABAP class implementation segment with method headers and placeholder implementations. 5. Ensure ABAP syntax correctness and consistent formatting. # Output Format Provide the output as a combined ABAP code block containing: - The class definition part with method declarations. - The implementation part with method stubs. Use triple backticks with "abap" language hint for formatting. # Notes - If some information is missing from the XMI snippet, make reasonable assumptions documented as comments. - Focus on correctness of ABAP syntax and clear, easy-to-read code layout. # Examples For input with class named ZCL_FOO and method GET_BAR with importing parameter ID of type STRING and returning a structure, generate corresponding ABAP class methods. --- If given XMI snippet [XMI content], output: ```abap CLASS zcl_foo DEFINITION. PUBLIC SECTION. METHODS get_bar IMPORTING id TYPE string RETURNING VALUE(result) TYPE some_structure. ENDCLASS. CLASS zcl_foo IMPLEMENTATION. METHOD get_bar. " TODO: Implement method logic ENDMETHOD. ENDCLASS. ``` Respond only with the generated ABAP code block according to these instructions.

ABAP Code Refactor

Refactor the provided ABAP code to improve its efficiency and readability. When refactoring: - Analyze the existing code for redundant operations and optimize them. - Improve variable naming for clarity. - Simplify logic structures where possible. - Ensure that the refactored code maintains the original functionality exactly. - Add comments if necessary to clarify complex sections. # Steps 1. Carefully review the provided ABAP code. 2. Identify inefficiencies such as unnecessary loops, redundant assignments, or suboptimal queries. 3. Rename variables with ambiguous names to more descriptive ones. 4. Simplify conditions and control flow constructs for better readability. 5. Document changes made to complex logic for maintainability. # Output Format Provide the full refactored ABAP code as plain text, preserving the original functionality, followed by a brief explanation (3-5 sentences) summarizing the main improvements to efficiency and readability. # Notes - Do not remove any features or alter the expected output of the code. - Avoid adding external dependencies or complex frameworks. - Focus on clean, maintainable code idioms in ABAP.

Add Save-Load Button Lua

You are given a Lua script and need to modify it by adding a button that allows users to save the configuration and automatically load it upon starting or reloading the script. Please perform the following steps: 1. Analyze the given Lua script to understand how the configuration is handled. 2. Add a user interface button that enables saving the current configuration. 3. Implement functionality to save the configuration persistently (e.g., to a file or appropriate storage). 4. Implement functionality to automatically load the saved configuration when the script starts or reloads. 5. Ensure that the save and load processes handle errors gracefully. 6. Maintain clear and concise code with comments explaining the new parts. # Output Format Provide the full modified Lua script code with the new button and the save/load configuration functionality integrated. # Notes - Assume any required libraries can be used if necessary. - Use placeholder functions or pseudocode if the environment for saving/loading is not specified, but ensure implementation is clear. - Include comments describing each major change or addition.

Page 35 of 68

    Coding Prompts - Learning AI Prompts | Elevato