source stringclasses 6
values | conversations listlengths 2 2 |
|---|---|
glaive | [
{
"from": "human",
"value": "I am trying to create a unit test in CMake, but I am struggling to understand how to use the `add_unit_test` macro. Can someone provide a clear example of how to use this macro to add a unit test for a specific function in my C++ code? I want to ensure that I can run the test an... |
evolcodegolf | [
{
"from": "human",
"value": "Baking Blunders: A unique series of baking-related challenges that aim to test your problem-solving skills in the kitchen! \n\nAs a passionate home baker, I often find myself experimenting with ingredient substitutions and conversions, especially when I’m running low on certain ... |
codefeedback | [
{
"from": "human",
"value": "Program to swap all even and odd elements in a given array, ensuring that the order of the elements remains the same. The program should only use a single loop to iterate through the array and should not use any additional data structures. The input array should have a length of... |
magicoder | [
{
"from": "human",
"value": "You are tasked with creating a Python function that processes a list of imported modules and returns a dictionary containing the count of unique module names and the total count of all module names. The function should ignore any modules that are imported conditionally (e.g., wi... |
sharegpt | [
{
"from": "human",
"value": "Create a Python function to reverse the order of words in a string and print the reversed string.\nFor example, given the string \"This is a string\", the function should print \"string a is This\".\nYou should not use any built-in functions or methods to reverse the words or th... |
magicoder | [
{
"from": "human",
"value": "You are tasked with creating a Python class that can scrape data from a CSV file and perform specific operations on the data. Your task is to implement a method within the class that calculates the average value of a specified column in the CSV file.\n\nYou are provided with a c... |
evolcodegolf | [
{
"from": "human",
"value": "What comprehensive strategies can you suggest for engaging in golfing within the peculiarities of INTERCAL? I'm particularly interested in approaches that not only address coding challenges unique to this esoteric language but also delve into methods for optimizing code length i... |
magicoder | [
{
"from": "human",
"value": "You are tasked with creating a TypeScript function that takes in a React component and returns a new component with additional functionality. The input component is of type `FC<BannerProps>`, which is a functional component that accepts `BannerProps` as its props. Your task is t... |
sharegpt | [
{
"from": "human",
"value": "I'm slightly confused as to how to return a value from a method in assembly language. As far as I know, the eax register is used to hold the result that is to be returned.\n\nAs an example, say my result is 4 and I use:\n\n```\nmov eax, 4\n```\n\nI now have 4 in eax and I want t... |
dolphin | [
{
"from": "human",
"value": "port this code to TypeScript:\n```php\nfunction rhombusSum($grid) {\n $m = count($grid);\n $n = count($grid[0]);\n $rhombus_sums = array();\n for ($i = 0; $i < $m; $i++) {\n for ($j = 0; $j < $n; $j++) {\n for ($k = 1; $k <= min($m - $i, $n - $j); $... |
dolphin | [
{
"from": "human",
"value": "translate this code from C# to Dart:\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\n\npublic class MovieRentingSystem \n{\n private readonly Dictionary<int, HashSet<Movie>> rentedMovies;\n private readonly Dictionary<int, SortedSet<Movie>> unrentedMovie... |
sharegpt | [
{
"from": "human",
"value": "Create a code snippet to print the top 10 most frequent words in a given text.\ntext = \"This is a sample text for the code snippet\""
},
{
"from": "gpt",
"value": "<think>\nOkay, I need to create a Python code snippet that prints the top 10 most frequent words in a ... |
magicoder | [
{
"from": "human",
"value": "You are tasked with creating a generic service profile class in Swift that can be configured based on a specific service configuration. The provided code snippet serves as a starting point for this task. Your goal is to extend the functionality of the `ConfiguredServiceProfile` ... |
codefeedback | [
{
"from": "human",
"value": "Explain the functionality of the following code snippet related to generating prime numbers and how it can be optimized using the Sieve of Eratosthenes algorithm. Also, add functionalities to remove any prime numbers that are palindromes.\n\ndef prime_numbers(n):\n primes = [... |
glaive | [
{
"from": "human",
"value": "You are tasked with creating a Verilog module for a testbench to verify the functionality of a system_wrapper. The module should include the following components:\n- A clock signal\n- A reset signal\n- A task number with a width of 10 bits\n- A clock count with a width of 32 bit... |
sharegpt | [
{
"from": "human",
"value": "I am trying to print the output from a hashing function to stdout. Currently, I am using the groestl hash function, but I believe it works the same as other hashing algorithms like sha. This is the code I have:\n\n```rust\nfn create_hash<D: Digest>(msg: &str, mut hasher: D) -> G... |
glaive | [
{
"from": "human",
"value": "I need to create a Java program that reads a CSV file and calculates the average value of a specific column. The CSV file contains data in the following format:\n```\nName, Age, Salary\nJohn, 25, 50000\nAlice, 30, 60000\nBob, 28, 55000\n```\nI want to calculate the average salar... |
glaive | [
{
"from": "human",
"value": "You are tasked with implementing a data structure to represent a document with various elements such as text, sections, references, tables, and more. The data structure should be able to handle different types of elements and their hierarchy.\n\nYour task is to create a type def... |
magicoder | [
{
"from": "human",
"value": "You are tasked with creating a script to automate the deployment of a web application using Gunicorn and Django. Gunicorn is a Python WSGI HTTP server for Unix, and Django is a high-level Python web framework. The script should change the directory to /opt/graphite/webapp, execu... |
evolcodegolf | [
{
"from": "human",
"value": "Conway's Game of Life is a well-known cellular automaton \"played\" on an infinite grid filled with cells that are either alive or dead. Once given an initial state, the board evolves according to rules indefinitely. Those rules are:\n\nAny live cell with 2 or 3 living neighbour... |
evolcodegolf | [
{
"from": "human",
"value": "Design a compact program that creates a custom binary search tree (BST) from input given in the following format:\n\n+key_size:value_size:key_data->value_data\n\nterminated by a newline. For instance:\n+4,6:abcd->Hello!\n+3,5:xyz->World\n\nYour program should effectively manage ... |
sharegpt | [
{
"from": "human",
"value": "How can I create an API endpoint in Python that takes a text string as input and outputs a JSON response with the text reversed?"
},
{
"from": "gpt",
"value": "<think>\nOkay, I need to create an API endpoint in Python that takes a text string and returns it reversed ... |
evolcodegolf | [
{
"from": "human",
"value": "Task \nThe letters constitute legitimate words, yet when each letter is substituted with a digit ranging from 0 to 9, they simultaneously represent a valid arithmetic equation. The challenge lies in discerning the specific digit that corresponds to each individual letter. It is... |
magicoder | [
{
"from": "human",
"value": "You are tasked with creating a Python class that simulates a simple web page operator. The class should be able to perform basic operations such as adding, updating, and deleting web pages. Your task is to implement the `OperatorWebSite` class with the following methods:\n\n1. `... |
codefeedback | [
{
"from": "human",
"value": "Write a function to remove all occurrences of a given element from a list while maintaining the original order of the remaining elements. The function should have a time complexity of O(n) and should not use any built-in functions or libraries to remove the elements.\n\nAddition... |
codefeedback | [
{
"from": "human",
"value": "You are tasked with creating a World of Warcraft (WoW) addon that provides information about the player's current shapeshift form and totem status. You have access to a set of predefined functions and constants to achieve this. Your goal is to implement a function that returns t... |
sharegpt | [
{
"from": "human",
"value": "How can I modify the following Java program to print \"Hello World!\" and also take a name input from the user, printing \"Hello, [Name]!\"? It should throw an error if there is no user input.\n\n```java\npublic class HelloWorld {\n\npublic static void main(String[] args) {\n~\n... |
glaive | [
{
"from": "human",
"value": "You are tasked with creating a shader program in GLSL that takes in vertex attributes for normal vectors and positions, and then applies transformations and lighting calculations to render the final output. Your task is to define the vertex and fragment shaders to achieve the de... |
evolcodegolf | [
{
"from": "human",
"value": "The television series \"Breaking Bad\" has cleverly modified the letters Br and Ba through a visually representative technique akin to a periodic table, displaying them as [Br35]eaking [Ba56]d. Design a program that accepts a string input, performs the specified replacements, an... |
magicoder | [
{
"from": "human",
"value": "You are tasked with creating a Python class that parses and processes data from two different types of MINIDUMP files. The MINIDUMP files contain information about a process, including its ID, creation time, user time, kernel time, and, in the case of the second type of file, th... |
glaive | [
{
"from": "human",
"value": "You are tasked with creating a subroutine for reading input data in different formats for a plasma simulation program. The subroutine should be able to handle input data in raw, HDF5, and netCDF4 formats and call the appropriate input functions based on the format specified. The... |
codefeedback | [
{
"from": "human",
"value": "You are required to create a class named 'Product' in Python that incorporates the following attributes: `name`, `price`, and `description`. Also, develop a method inside the class that calculates a discounted price based on a given percentage. The discount should not apply if t... |
evolcodegolf | [
{
"from": "human",
"value": "Your task is to develop a program that accepts a single input string composed exclusively of lowercase letters, devoid of any special characters, digits, or accented letters that may distort the output. Subsequently, the program should generate and return the corresponding super... |
codefeedback | [
{
"from": "human",
"value": "Write a Python program that initiates two separate integer sets. The first set named set1 contains the integers: {1, 3, 5, 7, 9, 11, 13, 15, 17, 19}. The second integer set named set2 has: {2, 4, 6, 8, 10, 12, 14, 16, 18, 20}. So far simple, isn't it?\n\nNow, for the real test: ... |
magicoder | [
{
"from": "human",
"value": "You are tasked with implementing a text replacement algorithm. Given a file containing tags that need to be replaced with corresponding content, your goal is to write a function that replaces the tags with the provided content and returns the modified file.\n\nYou are provided w... |
codefeedback | [
{
"from": "human",
"value": "Design a SQL query to get the salary of the employee who has the maximum salary in each department. Additionally, write another query to also get the date when each of these employees started working for the company, the supervisor of each employee, and the total number of proje... |
codefeedback | [
{
"from": "human",
"value": "Embark on a labyrinthine journey through the complex realm of quantum entanglement, accentuating its crucial function in the rapidly advancing discipline of quantum computing. Could you meticulously construct an exhaustive narrative that probes into the inception, progression, a... |
sharegpt | [
{
"from": "human",
"value": "Is there a way to design a program that can identify the elements present in a list which are binary values?"
},
{
"from": "gpt",
"value": "<think>\nOkay, I need to figure out how to design a program that can identify binary elements in a list. Let's start by underst... |
glaive | [
{
"from": "human",
"value": "You are tasked with creating an OTP application in Erlang that follows the OTP design principles. Your application should have a supervision tree, with a top supervisor that starts the processes of the application. You need to implement the `start/2` and `stop/1` callback functi... |
glaive | [
{
"from": "human",
"value": "You are tasked with creating a fragment shader in GLSL that takes a source texture and calculates the average color of four different texture coordinates. You need to write a shader program that receives four varying texture coordinates (uv1, uv2, uv3, uv4) and a sampler2D sourc... |
magicoder | [
{
"from": "human",
"value": "You are tasked with implementing a custom data type for handling different types of sensor data in an IoT (Internet of Things) application. The data type should be able to encode and decode sensor data according to the Cayenne Low Power Payload (LPP) format, which is commonly us... |
magicoder | [
{
"from": "human",
"value": "You are tasked with implementing a price adjustment system for a financial trading platform. The system should allow for different types of price adjustments based on predefined options. Each option corresponds to a specific price adjustment rule.\n\nYou are given a snippet of c... |
glaive | [
{
"from": "human",
"value": "You are tasked with implementing a function in ACL2 that generates an initial environment for a specific program, and another function that creates a modified environment after the program has been executed. The initial environment includes a program counter, read-only memory, s... |
evolcodegolf | [
{
"from": "human",
"value": "The objective of this challenge is to delve into the concept of livelocks: Construct a multi-threaded (or multi-process) application wherein the individual threads (or processes) are continuously engaged in attempts to wait for one another, thereby leading to an endless cycle of... |
magicoder | [
{
"from": "human",
"value": "You are tasked with implementing a custom neural network layer in PyTorch for natural language processing (NLP) tasks. The layer will incorporate word embeddings, dropout, and LSTM (Long Short-Term Memory) units. Your goal is to create a class that initializes these components a... |
codefeedback | [
{
"from": "human",
"value": "Generate a valid SQL query to select all users from the 'user_accounts' table who have registered within the last 7 days and have made at least 3 purchases."
},
{
"from": "gpt",
"value": "<think>\nOkay, let's tackle this SQL query problem. The user wants to select al... |
codefeedback | [
{
"from": "human",
"value": "Complete the given code snippet which defines a function named correct_bracketing. This function accepts a string input named \"brackets\" which comprises of characters \"<\" and \">\". The function ought to return a boolean value, True if each opening bracket \"<\" possesses a ... |
glaive | [
{
"from": "human",
"value": "You are working on a project where you need to define a new type of equality, called Leibniz equality, for a specific level in the Agda programming language. The Leibniz equality asserts that two objects are equal if and only if they satisfy the same properties. You need to defi... |
sharegpt | [
{
"from": "human",
"value": "How can I develop a method within a Python class that can find the publishing year of a book using the author's name and title? Additionally, how can I handle cases where multiple editions exist and return the year of the first and latest edition? It would also be helpful if the... |
codefeedback | [
{
"from": "human",
"value": "Given an array of numbers, write a JavaScript function to replace all occurrences of a specific number with another number. The function should return the modified array.\n\nExample:\nInput: replaceElements([1, 2, 3, 4, 3, 5, 6], 3, 7)\nOutput: [1, 2, 7, 4, 7, 5, 6]\n\nAdditiona... |
codefeedback | [
{
"from": "human",
"value": "Optimize a SQL query to find the most popular movie genres in the database."
},
{
"from": "gpt",
"value": "<think>\nOkay, so I need to optimize a SQL query that finds the most popular movie genres in the database. Let's start by understanding the problem. The goal is... |
codefeedback | [
{
"from": "human",
"value": "You are tasked with creating a script to monitor the status of a Selenium server using the `curl` command and a success command defined by the `SUCESS_CMD` variable. The script should continuously check the status of the Selenium server until the success condition is met, and th... |
magicoder | [
{
"from": "human",
"value": "You are tasked with implementing a simple recurrent neural network (RNN) using PyTorch to predict the next value in a sine wave sequence. The provided code snippet initializes the RNN model, sets up the loss function and optimizer, and prepares the input data for training.\n\nYo... |
evolcodegolf | [
{
"from": "human",
"value": "Input \nno input for this task \n\nThe Challenge \nWrite a code that outputs: \nThe first 10 prime numbers where the product of their digits equals the number of letters in your code \n\nExamples \nLet's say your code is \"HelloWorld\" which contains 10 letters \nyour cod... |
evolcodegolf | [
{
"from": "human",
"value": "Help! I've jumbled together a series of positive real numbers, and all I've got is a long string containing these numbers without any spaces or delimiters. The catch is that all integers are simply listed as they are, while any non-integer values are represented in a unique form... |
glaive | [
{
"from": "human",
"value": "I'm trying to understand the relationship between PHP and C, as I know that PHP is written in C or somehow uses C. Can someone explain how the HTML generated by PHP, such as the markup for a form, is built with C? Additionally, I'm curious if it's possible to create a web form u... |
glaive | [
{
"from": "human",
"value": "You are tasked with creating a program that utilizes ZeroMQ (ZMQ) to implement a distributed computing system. The program should be able to spawn worker processes and distribute tasks to them, and then collect and print the results from the workers.\n\nYour task is to write a J... |
codefeedback | [
{
"from": "human",
"value": "Deploy a static website on AWS using only serverless components. Ensure that the website is secure by implementing authentication and authorization using AWS Cognito. Additionally, the website should be highly available by utilizing AWS CloudFront for global content delivery and... |
evolcodegolf | [
{
"from": "human",
"value": "Warning \nThe responses to this challenge are designed to evaluate a specific iteration of the patch intended to mitigate WannaCrypt/WannaCry attacks. It is crucial to recognize that the applicable patch may vary based on your particular operating system. Therefore, the most ef... |
glaive | [
{
"from": "human",
"value": "You are tasked with implementing a function in Scheme that calculates the factorial of a given number. The function should take two arguments: the number n for which the factorial needs to be calculated, and a return function that will be used to pass the result back. The return... |
codefeedback | [
{
"from": "human",
"value": "Create a new array that is a copy of the given input array, consisting of all elements smaller than 5. Additionally, the new array should only contain odd numbers and the length of the new array should not exceed 5. If there are no odd numbers smaller than 5, the new array shoul... |
magicoder | [
{
"from": "human",
"value": "You are tasked with creating a test case management system for a software testing framework. The system should be able to dynamically generate a list of test cases and their associated test methods for execution.\n\nYou are given a Swift code snippet that defines a `TestParamete... |
glaive | [
{
"from": "human",
"value": "You are tasked with creating an SVG animation of a dotted line using Elm programming language. The animation should have a stroke color of #8a4baf, a stroke width of 3, a stroke line cap of round, and a stroke dash array of 0.5 10. The animation should be set to run infinitely w... |
evolcodegolf | [
{
"from": "human",
"value": "The transform-add (TA) process is a sequence generated by taking a number, modifying it by a specific transformation (e.g., incrementing each digit by 1), and then adding the result to the original number, repeating this for each subsequent result. For example, starting with the... |
glaive | [
{
"from": "human",
"value": "You are required to create a program that calculates the maximum value of a given function over a specified range and then plots the function in 3D and as a contour plot.\n\nThe function to be used is defined as follows:\n\\[function[x,y] = Exp[-15 I y] (1 (I Sin[x])^6 Cos[x]^9 ... |
magicoder | [
{
"from": "human",
"value": "You are tasked with implementing a file extension registration system for a software application. The system should allow the registration of file extensions as \"unsniffable,\" meaning that the application will not attempt to automatically detect the file type based on its cont... |
glaive | [
{
"from": "human",
"value": "Is it possible to use pytest's parametrized test with unittest class based tests? I have tried to add parametrized `@pytest.mark.parametrize` tests to a class based unittest:\n\n```python\nclass SomethingTests(unittest.TestCase):\n @pytest.mark.parametrize(('one', 'two'), [\n... |
codefeedback | [
{
"from": "human",
"value": "What are the two basic components of a computer system, and how do they interact with each other to perform tasks efficiently? Explain how this interaction is affected by the use of multithreading and how it can be optimized for parallel processing."
},
{
"from": "gpt",
... |
magicoder | [
{
"from": "human",
"value": "You are given a Python code snippet that uses the `assert` statement to compare two strings. Your task is to identify the missing `<Fragment>` that, when inserted into the code snippet, will make the assertion pass.\n\nThe original code snippet is as follows:\n```\n assert st... |
codefeedback | [
{
"from": "human",
"value": "Create an SQL query for selecting names, email addresses, and phone numbers of all users from the user table, sorted alphabetically by their last names. Additionally, include only users who have made at least 3 purchases and have an account created within the last 6 months. Ensu... |
codefeedback | [
{
"from": "human",
"value": "You are tasked with implementing a data cleaning algorithm for a DataFrame containing columns `theme1`, `list1`, and `list2`. The given code snippet attempts to clean the data by handling KeyError and TypeError exceptions. Your task is to complete the data cleaning algorithm by ... |
evolcodegolf | [
{
"from": "human",
"value": "Introduction:\nYou are tasked as a logistics coordinator, responsible for overseeing a network of bridges that link a grid of \"nodes\" arranged in a square formation:\nN - N - N\n| | |\nN - N - N\n| | |\nN - N - N\n\n(the grid here is 3 by 3, but larger configurations a... |
evolcodegolf | [
{
"from": "human",
"value": "Inspired by the architectural marvels of ancient structures, such as the Pantheon in Rome, your challenge is to create a dome-shaped building representation based on a given positive integer n.\n\nYour task is straightforward: output the dome structure scaled to size n.\n\nTestc... |
sharegpt | [
{
"from": "human",
"value": "Given a list of integers, implement a Python algorithm which will yield a set of distinct numerical values and locate their positions (indices) within the original list. This program should effectively handle any given list even with repeated elements, negative integers or float... |
evolcodegolf | [
{
"from": "human",
"value": "In recent observations, my reputation was quantified as 25,121. I discerned that each segment of digits (that is, the groups of numbers delineated by commas) represented a perfect square. \n\nYour task involves determining, for a given non-negative integer N alongside a unary bo... |
evolcodegolf | [
{
"from": "human",
"value": "The Challenge \nThe game Light Up! presents a captivating puzzle where the primary aim is to illuminate each cell in an n-by-n grid using strategically placed light bulbs. However, the presence of blocks obstructs the path of light, and care must be taken to ensure that no ligh... |
magicoder | [
{
"from": "human",
"value": "You are tasked with creating a Python function that calculates the average of a list of numbers. Your function should take a list of numbers as input and return the average as a floating-point number. You should also write unit tests using the `pytest` framework to ensure the co... |
evolcodegolf | [
{
"from": "human",
"value": "Resistors typically feature a series of color-coded bands that signify their resistance value measured in Ohms. In this specific challenge, we will focus exclusively on the conventional 4-band, tan, axial-lead resistors, represented as:\n\nxyzt\n\nIn this notation, x corresponds... |
codefeedback | [
{
"from": "human",
"value": "<p>A number is considered palindromic if it maintains the same sequence of digits when read in reverse order. The most substantial palindromic number that can be obtained from the multiplication of two $2$-digit numbers is $9009 = 91 \\times 99$.</p>\n<p>Can yo... |
evolcodegolf | [
{
"from": "human",
"value": "The progression of days categorized as the week of the week and the month of the year often overshadows the week of the year, which remains relatively underappreciated. It is imperative to rectify this oversight, so your task involves crafting a program or function that, when su... |
evolcodegolf | [
{
"from": "human",
"value": "Design a function that simulates a three-dimensional random walk originating from the point (0, 0, 0) in a Cartesian coordinate system. The function should take a positive integer M as input, representing the number of steps in the walk. Each step is chosen randomly from the six... |
glaive | [
{
"from": "human",
"value": "How can I perform python debugging using print() or a similar method where it prints the passed expression in addition to the usual output? For instance, with the code `print(42 + 42)`, `print(type(list))`, and `print(datetime.now())`, I want it to print the expressions as well ... |
evolcodegolf | [
{
"from": "human",
"value": "This code-golf challenge will have you computing OEIS sequence A300154 while also incorporating a requirement to visualize the spiral for input values.\n\nConsider a spiral on an infinite hexagonal grid. a(n) is the number of cells in the part of the spiral from 1st to n-th cell... |
evolcodegolf | [
{
"from": "human",
"value": "General constraints:\n\nYour program should not take any input.\nYour program should output words, 1 word/line.\nOnly capital letters (A-Z) in the output.\nA word must be at least 2 letters in length.\nA word can never be a palindrome. That is forbidden.\n\nRules for word-manipu... |
dolphin | [
{
"from": "human",
"value": "translate this code to Clojure:\n```c\n#include <stdio.h>\n\nint countSubstrings(char* s) {\n int n = strlen(s);\n int a_count = 0, b_count = 0, c_count = 0, num_substrings = 0, j = 0;\n \n for (int i = 0; i < n; i++) {\n while (j < n && (a_count == 0 || b_cou... |
codefeedback | [
{
"from": "human",
"value": "You are tasked with creating a script that fetches content from a given URL and saves it to a file. However, the script provided has a bug that causes it to exit prematurely. Your goal is to fix the bug and enhance the script to handle potential errors during the fetching proces... |
codefeedback | [
{
"from": "human",
"value": "Calculate the area of multiple rectangles and find out the total covered area without overlapping. You are given an array of coordinates where each coordinate contains exactly 4 values [x1, y1, x2, y2], where (x1, y1) is the bottom left corner and (x2, y2) is the top right corne... |
dolphin | [
{
"from": "human",
"value": "convert this code from Lisp to Perl:\n```lisp\n(defun calculate-min-elements-to-change (nums k)\n (let ((n (length nums)))\n (if (= k 1)\n n\n (let ((freq (make-hash-table))\n (count 0))\n (loop for i below n do\n (when (>= ... |
sharegpt | [
{
"from": "human",
"value": "I need help with generating code to transform a string of characters into its opposite characters. Can you provide me with a solution?"
},
{
"from": "gpt",
"value": "<think>\nOkay, so I need to figure out how to transform a string into its opposite characters. Let me... |
glaive | [
{
"from": "human",
"value": "You are tasked with creating a batch script that takes in command line arguments and sets specific parameters based on the input. The script should support the following parameters:\n- MEM: sets the memory value (default is 64)\n- FLAVOR: sets the flavor\n- FILENAME: sets the fi... |
sharegpt | [
{
"from": "human",
"value": "Create a method in Python that takes in a list of numbers and returns a new list with each number rounded to 4 decimal points. The input list can have duplicate numbers and the output list should maintain the same order as the input list."
},
{
"from": "gpt",
"value"... |
magicoder | [
{
"from": "human",
"value": "You are tasked with implementing a MarketSort class that can sort market data based on different criteria. The class should support sorting by maximum traded, minimum traded, first to start, and last to start.\n\nYour task is to complete the implementation of the MarketSort clas... |
evolcodegolf | [
{
"from": "human",
"value": "In this task, you are required to create a unique function (or a complete program) that meets two specific criteria:\n\nYour function must serve as a bijective (one-to-one and onto) mapping from the set of positive integer matrices with bounded dimensions to the set of positive ... |
codefeedback | [
{
"from": "human",
"value": "Implement a hash table class in any programming language of your choice. The hash table should support the following operations:\n\n1. `put(key, value)`: Insert a key-value pair into the hash table. The keys will be strings and the values will be integers. The hash table should ... |
evolcodegolf | [
{
"from": "human",
"value": "Your task is to creatively represent various mathematical formulas featuring nested radicals (square root signs situated within other square root signs) using ASCII art. To achieve this, you will be provided with two integers: the first representing the value inside the radical,... |
magicoder | [
{
"from": "human",
"value": "You are tasked with implementing a key-value parser that reads a string in a specific format and extracts key-value pairs from it. The input string is in the format of \"key1=value1,key2=value2,key3=value3,...\", where each key-value pair is separated by a comma. The keys and va... |
sharegpt | [
{
"from": "human",
"value": "How can I find out what arguments are required for Rails url helpers? For example, in the code below, how do I determine that the url helper \"new_project_ticket_path\" takes just one parameter? I understand that these methods are generated dynamically, but where can I find thei... |
glaive | [
{
"from": "human",
"value": "You are tasked with creating a Python package for the dnspython library. The package needs to be version 1.16.0 and the source file should be named dnspython-1.16.0.zip. The package should be downloaded from the URL: https://files.pythonhosted.org/packages/ec/c5/14bcd63cb6d06092... |
glaive | [
{
"from": "human",
"value": "You are required to implement a function in CUDA/HIP that performs a specific arithmetic operation on two half-precision floating-point numbers. The operation to be performed is addition (+), subtraction (-), multiplication (*), or division (/). The function should take two inpu... |
magicoder | [
{
"from": "human",
"value": "You are working on a project that involves interfacing with a Java library using Rust. Your task is to implement a function that retrieves the supported SSL parameters from a Java SSL context. The Java library is accessed through the `__jni_bindgen` Rust crate, which provides bi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.