Back to Learning

Coding

814 prompts available

Add Indicator Inputs to EA

You are given the task of integrating additional indicator inputs into an existing Expert Advisor (EA) for trading. Your goal is to add support for loading indicator inputs dynamically when a particular indicator is selected within the EA's input parameters, without altering the existing code logic or functionality of the EA. Specifically, when a user selects an indicator option from the EA's input interface, your solution should ensure the corresponding indicator inputs are loaded and utilized seamlessly, preserving all current behaviors and logic intact. # Steps 1. Analyze the current input structure of the EA to identify how indicator selections are handled. 2. Design an approach to append or load indicator-specific input parameters conditionally based on the user's selection. 3. Ensure that this addition does not modify any existing code or alter the internal logic of the EA. 4. Implement the input loading such that the EA continues to function as before, but with added flexibility to include indicator inputs dynamically. 5. Validate the solution to confirm no changes in EA behavior except the added indicator input functionality. # Output Format Provide detailed instructions or code snippets demonstrating how to add these indicator inputs dynamically without changing existing code and logic. If necessary, use placeholders [IndicatorInput] and [OriginalEAcode] to represent existing parts. Include explanations for each step to clarify how the preservation of existing functionality is ensured. # Notes - Do not suggest rewriting or refactoring the entire EA. - Focus solely on input handling additions. - Assume the user has basic knowledge of the EA environment and how indicators integrate within it.

Add New Dashboard Pages

You are tasked with adding new pages to an existing dashboard website according to specified requirements and design guidelines. Your goal is to ensure that these new pages: - Maintain consistency with the existing layout, style, and functionality of the dashboard. - Are fully integrated, meaning they are properly linked within the navigation structure and easily accessible. - Function smoothly without errors or performance issues, matching or exceeding the quality of existing pages. - Leverage Kendo UI Components comprehensively and effectively, utilizing their features to enhance the user experience. When implementing, carefully review the current dashboard’s design and structure to ensure seamless integration. Test all added functionality thoroughly and verify links and navigation paths. Aim for high-quality, professional results that demonstrate mastery of Kendo UI and front-end best practices so that the project stands out in the bootcamp competition. # Steps 1. Analyze the given requirements and design guidelines for the new pages. 2. Review the existing dashboard's layout, style, component usage, and navigation. 3. Plan the page structure and map out how new pages fit into the overall dashboard. 4. Develop new pages using Kendo UI Components fully and appropriately. 5. Integrate pages into the dashboard's navigation and routing system. 6. Conduct thorough testing to ensure functional parity and smooth operation compared to existing pages. 7. Review for consistency in design and user experience. 8. Optimize as needed to ensure performance and usability. # Output Format Provide a detailed summary report of your implementation including: - Description of each new page added. - How Kendo UI Components were utilized on each page. - Explanation of how navigation and linking was handled. - Description of testing performed and results. - Any recommendations or considerations for further improvements. Additionally, provide code snippets or references illustrating key parts of your implementation, using markdown formatting for clarity. # Notes - Prioritize clean, maintainable code aligned with best practices. - Make sure the user experience remains intuitive and cohesive across pages. - Emphasize comprehensive utilization of Kendo UI to showcase your expertise. - Remember the goal is to create a competitive project for the bootcamp.

Add JavaDoc Comments

You are tasked with adding detailed, Java-style comments above each method in a given code file, using the exact comment style and formatting conventions demonstrated by TraceAnalyticsPolicyInspector, TraceAnalyticsPolicyQualifier, and TraceMetricPolicyInspector. - Each method comment must clearly describe the method's purpose, input parameters, return values, side effects, and any significant implementation details. - Use HTML-style tags like <p> within JavaDoc comments to structure the descriptions, exactly as seen in the reference comments. - Carefully study the tone, wording, and formatting from the references to ensure consistency across all comments. - Insert the comments immediately above each method without modifying any code or method signatures. # Steps 1. Review sample comments from TraceAnalyticsPolicyInspector, TraceAnalyticsPolicyQualifier, and TraceMetricPolicyInspector to capture style and structure. 2. For each method (including the start method): - Determine its functionality, inputs, outputs, and side effects. - Write a concise JavaDoc comment block using <p> tags and the observed formatting conventions. - Prepend the comment above the method definition, preserving existing indentation and code formatting. 3. If the method’s role is ambiguous, cautiously infer or add a TODO notation within the comment. # Output Format Return the entire original file content with the newly added, fully formatted JavaDoc comments above every method. Keep the original code formatting intact except for inserting these comments. # Notes - Do not change any code logic or method signatures. - Follow the reference styles precisely, including JavaDoc delimiters, @param/@return tags if used, and any HTML tags. - Include comments for the 'start' method following the same pattern.

Add New Project Button & Popup

You are tasked with enhancing a single-file inline HTML, CSS, and JavaScript web application without altering any existing layout, responsiveness, or animations. Instructions: 1. Add a button with an icon at the top-right corner of the screen, positioned next to the language dropdown and the dark/light theme switcher. This button must be visible only when the user is viewing a newly created project. 2. Upon clicking this button, open a card-style popup/modal identical in style to the existing card UI. This includes matching layout, colors, animations, fonts, gradients, padding, and responsiveness. The popup should not cause any visual or behavioral deviation from the established design. 3. The popup must contain: - A title: "New Project" - A text input field with a label above it labeled "Project Name" and placeholder text "Project Name" - A button labeled "Create a Project" 4. All text strings inside the popup (title, label, placeholder, and button text) must integrate with the existing multilingual support system—the language switcher already implemented in the app. The popup text must update dynamically whenever the user changes the language. 5. In the "Your Projects" section: - Display a grid containing project cards representing actual project data sourced from static data or a JavaScript array. - Each project card must display the real project name and be clickable. - Clicking a project card should open the corresponding project just like selecting it from the burger menu. Additional Constraints: - All code must remain within the single existing HTML file—no external or separated CSS or JS files. - Preserve the current theme, color palette, grid layout, and transition effects exactly. - Do not break or modify any existing functionalities, layouts, or animations. # Output Format Provide the complete single HTML file content integrating these enhancements. Ensure that all new elements are seamlessly integrated with existing logic, styling, and multilingual mechanisms. The file must be fully operational with the new functionality included and visually indistinguishable from the original except for the added features exactly as described. # Notes - Reference existing classes, styles, and multilingual functions in the app for consistency and dynamic text updates. - The new project popup modal must animate and style identically to existing card components. - Ensure the button’s visibility toggles correctly based on whether a user is inside a newly created project view. - Use existing event handlers or add new ones without conflicting with current behavior. Your goal is to implement this enhancement flawlessly, maintaining the integrity and UX of the original app.

Add Jest Coverage Tests

You are provided with a screenshot that highlights certain lines of code in red & yellow within the 'SearchContentComponent' component's 'imageSearchFlow' test suite (describe block). Your task is to analyze the highlighted code and write additional Jest test cases inside the existing 'describe('imageSearchFlow', () => { ... })' block to ensure that these highlighted sections are fully covered by tests. When writing these test cases, consider the following: - Carefully interpret the behavior of the highlighted code. - Write clear, focused test cases that specifically target and verify the missing coverage. - Include necessary setup, simulate actions, and add assertions to fully exercise the logic. - Follow Jest best practices for naming and structuring test cases. - Reuse existing mocks if available in the test file. - Add only the minimal required test cases to cover the highlighted code, avoiding redundancy. # Steps 1. Inspect the screenshot and identify the highlighted yellow code inside the 'imageSearchFlow' describe block. 2. Analyze the logic and determine what inputs or conditions trigger the highlighted code paths. 3. Devise test cases that execute those conditions. 4. Implement the test cases as 'it' blocks within the existing 'describe('imageSearchFlow', () => { ... })' block. 5. Include clear assertions that verify expected behaviors and side effects. # Output Format Provide the full Jest test case code snippets with proper indentation and formatting, representing only the new test cases to be added inside the existing 'describe' block. Do not include the entire file or other unrelated tests. # Notes - Maintain consistency with the existing test file style (e.g., use of async/await if applicable). - Ensure the test cases can run independently and are self-contained. - Use descriptive test case names reflecting the behavior being tested.

Add News Filter MQL4

Explain in detail how to add and configure a news filter in the MQL4 trading platform. Include the necessary steps to implement the news filter to prevent trading during high-impact news events, covering how to retrieve news data, interpret it within the MQL4 environment, and integrate it into an Expert Advisor or indicator to pause trading accordingly. Provide guidance on available data sources or APIs, example code snippets illustrating the implementation, and any common pitfalls to avoid when applying a news filter in MQL4.

Add Jest Tests for onFocus

Write Jest unit test cases for the `onFocus` function in the `search-content` component. You already have a `spec.ts` file with the test structure set up. Review the component code to understand the behavior of the `onFocus` function, and then add appropriate test cases. Ensure that your new tests verify all relevant functionality and side effects of the `onFocus` method. Importantly, do this in a way that does not break or affect the existing test cases in the `spec.ts` file. # Steps 1. Review the `search-content` component code to understand the logic inside the `onFocus` function. 2. Open the existing `spec.ts` test file and identify where new test cases for `onFocus` should be added. 3. Write clear, concise Jest unit tests that cover different input scenarios for `onFocus`. 4. Run the full test suite to confirm that all tests, including existing ones, pass successfully. 5. If any tests fail, adjust accordingly to maintain full test coverage without breaking existing tests. # Output Format - Provide the Jest test code snippets that you added to the `spec.ts` file. - Include brief comments explaining each test case. - Confirm that existing tests remain intact and unaffected. # Notes - Do not modify or remove existing test cases unless fixing conflicts caused by new tests. - Make sure mock dependencies, if any, are properly handled. - Focus only on the `onFocus` function. # Examples ```typescript it('should set focus state to true when onFocus is triggered', () => { // Arrange const component = new SearchContentComponent(); // Act component.onFocus(); // Assert expect(component.isFocused).toBe(true); }); ``` This example assumes that `onFocus` sets an `isFocused` property to true. Ensure your tests are aligned with the actual implementation of `onFocus`.

Add NPC Taxi Jobs

You are tasked with enhancing a taxi service system in a game by adding an NPC (Non-Player Character) option alongside player-driven taxi requests. The NPC option should integrate seamlessly into the existing NUI (Native User Interface) used for taxi requests. Specifically, the system should: - Include an option within the current taxi request interface for NPC jobs, featuring the same accept or decline design as for player requests. - Generate NPC jobs with random NPC names and characters. - When a player requests a taxi pickup, the system must capture the player's current coordinates and send these coordinates as a waypoint to the driver. - Upon accepting the request, the driver receives the waypoint to the player's location. - Once the driver reaches the player's location, the system should then send the driver a new waypoint corresponding to the destination the player has selected (e.g., their house or any specified location). Ensure the NPC jobs follow the same user experience flow as player taxi requests but feature randomized names and details. # Steps 1. Integrate an 'NPC Jobs' option into the existing taxi request NUI, enforcing the same accept/decline interface. 2. Implement functionality to generate NPC requests with random NPC names and characters spontaneously. 3. Capture and transmit the player's current coordinates as the first waypoint when a taxi is requested. 4. Once the driver accepts the request, send the captured player location as the driver's initial waypoint. 5. Upon arrival at the player location, update the driver's waypoint to the player’s desired destination. 6. Ensure smooth transition and consistent feedback to the driver throughout the process. # Output Format Provide a detailed design and implementation outline or code snippet demonstrating how to: - Add the NPC job option in the NUI interface. - Generate random NPC requests. - Capture and send player coordinates as waypoints. - Update the driver’s waypoints on acceptance and upon arrival. Use clear explanations and examples where applicable. # Notes - Prioritize maintaining the existing user interface and experience for taxi requests. - Random NPC names and characters should appear realistic and varied. - The waypoint system must update dynamically based on driver actions. - Ensure synchronization between the player’s position and driver’s navigation. - Consider edge cases where the player changes destination or cancels the request. Respond comprehensively, reasoning through each step clearly before providing conclusions or example implementations.

Add Kilo 141 Profile

Add a weapon profile for the Kilo 141 in Call of Duty Black Ops 6 to the existing Logitech G502 Lua script. Use the weapon values provided in the supplied photo to optimize this new profile. Additionally, enhance and optimize the target tracking capabilities for each weapon profile within the script, ensuring smooth and accurate tracking tailored to the unique handling characteristics of each weapon. # Steps 1. Review the existing Lua script for the Logitech G502 mouse that contains weapon profiles. 2. Extract weapon parameters from the provided photo for the Kilo 141 (e.g., recoil values, sensitivity adjustments, fire rate). 3. Create a new weapon profile within the script incorporating these parameters. 4. Analyze current target tracking code for all existing weapon profiles. 5. Implement improvements to enhance the precision and responsiveness of target tracking for each profile, considering weapon-specific characteristics. 6. Ensure smooth transitions and proper switching between profiles. 7. Test the script logic and behavior for consistency and effectiveness. # Output Format Return the complete updated Lua script text, including the newly added Kilo 141 weapon profile and optimized target tracking functionality for all profiles. Ensure the script is properly formatted and commented where appropriate for clarity.

Add Numbers Function

Write a function named `add_numbers` that takes two parameters, `num1` and `num2`, and returns their sum. Ensure that the function handles only numeric inputs and raises an appropriate exception if non-numeric values are provided. Additionally, provide a brief example of how to use the function.

Add Listener Menu and SSL Proxy

You are an expert coder and UI/UX designer, known for perfection and bug-free implementations. Your task is to update the menubar by adding a "Listener" option under the "Settings" menubar item, similar to the existing "Certificate Settings". The Listener should open a popup similar to the existing SettingsModal but with two tabs: "SSL Proxify" and "Proxy & Port". Details for each tab: 1. Proxy & Port Tab: - Contains a single number-input field styled according to the existing theme.ts. - This field is for specifying the proxy port number. 2. SSL Proxify Tab: - Layout is a split screen with two boxes side-by-side: "Include" and "Exclude". - Each box has a title at the top ("Include" on the left, "Exclude" on the right). - Each box contains a table where each row has two columns: * A checkbox (nameless) on the left. * A "Location" column on the right showing host:port. - Below each table, provide "Add" and "Remove" buttons to manage entries. The Add Popup for SSL Proxify entries must contain: - A "Host" input that supports regex and wildcard characters (e.g., '*') to match all hosts. - A "Port" input which also supports wildcards. Backend Implementation Requirements: - The SSL Proxify logic means hosts listed under "Include" are the only ones proxied; hosts not included should be passed through without SSL proxying. - The Proxy & Port change should be persisted in the backend with a method to update the listening port. Rules to Follow: - Follow all given rules meticulously. - Provide full code for all modified files without comments. - Prior to coding, ask for any necessary components, import code, or interface details required to fully understand the existing structure. - Your code must be flawless, bug-free, and polished. # Steps 1. Request any missing component or interface code relevant to the SettingsModal and menubar if needed. 2. Implement adding "Listener" to the Settings menubar. 3. Create the Listener popup with two tabs: SSL Proxify and Proxy & Port. 4. Implement the Proxy & Port tab with a themed number input for port. 5. Implement the SSL Proxify tab as a split-screen layout with Include and Exclude boxes. 6. Each box should have a checkbox and Location columns in a table alongside Add and Remove buttons. 7. Create Add Popup dialogs supporting regex and wildcard inputs for Host and Port. 8. Integrate backend support to save/update SSL Proxy include/exclude rules and the proxy port. # Output Format Provide full updated source code files that have been modified or created during this task, strictly without any inline comments. If you require additional code or interface definitions to proceed, ask clearly before starting the implementation.

Add Load Config Button

Add a button labeled "Cargar Configuración" to the /cf menu in the given Lua script. Details: - You will receive a Lua script that defines the /cf menu. - Your task is to modify this script by adding a button inside the /cf menu interface. - The button should be clearly labeled "Cargar Configuración". - When clicked, the button should trigger a function or an event that loads the configuration. Steps: 1. Identify where the /cf menu is defined in the Lua script. 2. Insert a new UI element representing the button within the menu. 3. Implement or connect the button to a function that loads the configuration. 4. Ensure the button is properly displayed and responds to user interaction. Output Format: Provide the full modified Lua script with the new button and its associated functionality added to the /cf menu. Note: - If you need to stub or placeholder the loading function, make it clear with comments. - Keep the rest of the script unchanged unless necessary for adding the button. - Include comments inside the Lua code to explain the changes you've made.

Page 32 of 68

    Coding Prompts - Learning AI Prompts | Elevato