source
stringclasses
6 values
conversations
listlengths
2
2
codefeedback
[ { "from": "human", "value": "Write a SQL query to get the top 10 scores for a given game, excluding any duplicate scores. Additionally, only include scores that are greater than 1000 and were achieved within the last 7 days. The query should return the players' names, scores, and the date the scores were ac...
glaive
[ { "from": "human", "value": "You are tasked with creating a program that defines a structure called SortedStruct. This structure should contain a member variable, aMap, which is a map of strings to doubles. Your program should also include a function that takes an unsorted map as input and returns a SortedS...
evolcodegolf
[ { "from": "human", "value": "## Lexical Mirrors, 197 bytes\n\nLexical mirrors are pairs of words that maintain distinct meanings but are formed by reversing each other's letters. Unlike semordnilaps, which can be phonetic synonyms, lexical mirrors must not share a similar pronunciation. For example:\n\nGod ...
magicoder
[ { "from": "human", "value": "You are tasked with writing a script to automate the configuration of Hadoop and HBase on a cluster. The given code snippet is a part of the script and demonstrates the manipulation of configuration files using shell commands.\n\nYour task is to write a shell script that perform...
codefeedback
[ { "from": "human", "value": "Generate a random permutation of a matrix of integers with no duplicate numbers. The matrix must also include reflections and rotations. [[[1,2,3],[4,5,6],[7,8,9]]]" }, { "from": "gpt", "value": "<think>\nOkay, so I need to generate a random permutation of a matrix o...
evolcodegolf
[ { "from": "human", "value": "In the engaging game Keep Talking and Nobody Explodes, participants are tasked with the critical challenge of defusing bombs by leveraging information provided by their \"experts\" (individuals equipped with a manual). Each bomb comprises multiple modules, one of which involves ...
magicoder
[ { "from": "human", "value": "You are tasked with implementing a dynamic array data structure in C#. A dynamic array is a resizable array that allows for efficient insertion and deletion of elements at the end of the array. Your task is to implement the `DynamicArray` class with the following specifications:...
glaive
[ { "from": "human", "value": "You are tasked with creating an XSLT transformation to process XML data for displaying machine information. The XML data includes elements such as Name, Comment, major and minor attributes, and various FlagsList elements. Your task is to create an XSLT template that will extract...
glaive
[ { "from": "human", "value": "I need to create an F# implementation of an HttpContent to push a JsonValue directly to the output stream. The content type should be set to \"application/json\" and the implementation should include serialization of the JsonValue to the output stream using StreamWriter and Json...
codefeedback
[ { "from": "human", "value": "Write a Python function that reverses a string in place, without using any built-in string reversal methods or functions. The code should only use a single loop and should not create any new variables or data structures. The function should also handle special characters, whites...
evolcodegolf
[ { "from": "human", "value": "I once encountered this (mini) game where you had 4 or more vertical pipes that were interconnected by a series of horizontal pipes, and your task was to drop a ball or water into one of the vertical pipes. There are 2 variations I know of:\n\n1. Get the object into a bucket or ...
glaive
[ { "from": "human", "value": "Can someone help me write a function that converts an array of strings into an array of objects?" }, { "from": "gpt", "value": "<think>\nOkay, the user wants to convert an array of strings into an array of objects. Let me think about how to approach this.\n\nFirst, I...
magicoder
[ { "from": "human", "value": "You are tasked with implementing a user management system in PHP. Your goal is to create a class that handles user operations such as checking if a user exists and saving user records to a database. You are provided with a partial code snippet for a PHP class that needs to be co...
magicoder
[ { "from": "human", "value": "You are tasked with implementing a function that processes audio tracks in a music player application. The function should determine whether a given track is an audio track or not based on its track number. If the track is not an audio track, the function should return `FALSE` a...
glaive
[ { "from": "human", "value": "You are tasked with implementing a CUDA kernel function that performs a specific operation on an array. The array is of size N = 4, and the kernel function must be designed to be launched with 1 block of 4 threads each.\n\nThe operation to be performed is as follows:\n- If the t...
magicoder
[ { "from": "human", "value": "You are tasked with implementing a file management system for a data backup application. The system should keep track of the names of the saved checkpoints and manage the maximum number of checkpoints to be retained.\n\nYou are given a Python class `CheckpointManager` with the f...
sharegpt
[ { "from": "human", "value": "Is there a way to implement the sine function (sin(x)) in assembly code using Taylor Expansion on x86 Linux?" }, { "from": "gpt", "value": "<think>\nOkay, so I need to figure out how to implement the sine function using Taylor Expansion in assembly code on x86 Linux....
dolphin
[ { "from": "human", "value": "port this code from Haskell to Kotlin:\n```haskell\ndata TreeNode = TreeNode {\n val :: Int,\n left :: Maybe TreeNode,\n right :: Maybe TreeNode\n}\n\nbtree_game_winning_move :: Maybe TreeNode -> Int -> Int -> Bool\nbtree_game_winning_move root n x =\n let\n ...
magicoder
[ { "from": "human", "value": "You are tasked with creating a Python class that simulates a live dashboard for monitoring Slurm job statuses. Slurm is an open-source workload manager designed for Linux clusters. The class should utilize the Rich library for creating a visually appealing and dynamic dashboard....
magicoder
[ { "from": "human", "value": "You are tasked with implementing a service in an Angular application that manages a list of workers. The `Workers` service is responsible for providing functionality to add, remove, and retrieve workers. The service should be designed to be a singleton, meaning there should only...
codefeedback
[ { "from": "human", "value": "Write a function to determine if two strings are anagrams of each other. The function should have a time complexity of O(n), where n is the length of the strings. The function should also use constant space, meaning it should not use additional data structures besides a few vari...
glaive
[ { "from": "human", "value": "Can you provide a Python program that calculates the sum of the squares of all numbers between 1 and 10?" }, { "from": "gpt", "value": "<think>\nOkay, I need to write a Python program that calculates the sum of the squares of all numbers between 1 and 10. Let's think...
evolcodegolf
[ { "from": "human", "value": "You find yourself exploring a labyrinthine maze composed of hexagonal tiles. Each tile allows you to move in one of six directions: North, Northeast, Southeast, South, Southwest, or Northwest. As you traverse the maze, you must choose your path at each junction, forming a sequen...
magicoder
[ { "from": "human", "value": "You are tasked with creating a Python function that checks whether a given string contains a valid JSON object. A valid JSON object should adhere to the following rules:\n- It should be enclosed within curly braces `{}`.\n- It should consist of key-value pairs separated by comma...
glaive
[ { "from": "human", "value": "I am trying to create a custom Gradle task in my project that uses the Spoon library to transform Java source files as part of the build process. However, I am facing some issues with incremental builds and the handling of input changes. I want the task to only process changed o...
codefeedback
[ { "from": "human", "value": "How can I efficiently count the number of .csv.gz files in a specific folder and calculate the total number of rows across all these files? It would be great if you could provide me with a code snippet to achieve this. I also want to ensure that the approach is optimized for lar...
evolcodegolf
[ { "from": "human", "value": "In light of the absence of a previously established definition, I have undertaken the task of formulating one: A tralindrome is defined as a string that can be partitioned into three equal-length segments X, Y, and Z, where:\n\n- Every character from the original string must be ...
sharegpt
[ { "from": "human", "value": "Develop a Vue.js mixin that can dynamically update \"currentPage\" data according to the \"page\" query parameter of the active URL. Alongside this, handle potential edge cases such as: \n\n1) If no 'page' query parameter is specified in the URL, set the 'currentPage' to 1.\n2) ...
sharegpt
[ { "from": "human", "value": "I have two variables, A and B, both in String format. A is set to \"14/01/2007\" and B is set to \"22:10:39\". I am trying to insert the date and time into a database using the following SQL statement:\n\n```\nSQL = \"insert into MyTbl(Tdate,Ttime) value ('\" + Convert.ToDateTim...
codefeedback
[ { "from": "human", "value": "Below is an erroneous Neural Network code snippet that uses the famous MNIST dataset. This code doesn't function as expected. Your task is two-fold:\n\n- Find and fix the problems in the code.\n- Use the digits dataset from scikit-learn datasets module instead of the MNIST datas...
codefeedback
[ { "from": "human", "value": "Construct a neural network to identify a given input as either a cat or a dog." }, { "from": "gpt", "value": "<think>\nOkay, so I need to construct a neural network that can tell if an input is a cat or a dog. Hmm, where do I start? Well, first, I remember that image...
glaive
[ { "from": "human", "value": "You are tasked with creating a web form for changing a user's password in a Java web application using Struts and JSP. The form should include fields for the user's current password, new password, and confirmation of the new password. Additionally, the form should display error ...
codefeedback
[ { "from": "human", "value": "You are tasked with creating a program that analyzes a given software license disclaimer to extract and count the occurrences of unique words. The disclaimer is a multi-line string containing various legal terms and disclaimers. Your program should ignore any special characters,...
codefeedback
[ { "from": "human", "value": "I'm learning C, can you translate this code?\ndef prime_geomean(lst):\n # Flattening nested lists with recursion\n def flatten(lst):\n for i in lst:\n if isinstance(i, list):\n yield from flatten(i)\n else:\n yield...
codefeedback
[ { "from": "human", "value": "Please fix the following broken HTML code and return the fixed code as a string. Additionally, validate the fixed HTML code to ensure that it meets all the necessary standards and requirements for a valid HTML document." }, { "from": "gpt", "value": "<think>\nOkay, l...
codefeedback
[ { "from": "human", "value": "Create a PHP function that sorts the elements of an array in ascending order using the bubble sort algorithm. Additionally, handle the case where the array may contain duplicate elements, ensuring that they are properly sorted. However, you are not allowed to use any built-in so...
magicoder
[ { "from": "human", "value": "You are working on a natural language processing (NLP) project and need to implement a custom residual recurrent neural network (RNN) encoder in PyTorch. The encoder will be a subclass of the `RNNEncoder` class and will have additional functionality to handle residual connection...
glaive
[ { "from": "human", "value": "You are tasked with implementing a keypad control system for controlling windows and emergency functions in a vehicle. The system is based on an ATmega2560 microcontroller and utilizes a 4x4 keypad for input. The system also interfaces with an LCD display, LEDs, and a PWM signal...
dolphin
[ { "from": "human", "value": "translate this code to Julia:\n```haskell\nimport qualified Data.Map.Strict as Map\n\nminimumNumberOfSubsequences :: [Int] -> Int -> Int\nminimumNumberOfSubsequences nums k =\n let freqs = foldl (\\m num -> case Map.lookup (num - k) m of\n Just c...
sharegpt
[ { "from": "human", "value": "As a newbie to Rails, I'm wondering how I can comment out a single line and also a block of lines in *.html.erb files. Can someone guide me on this?" }, { "from": "gpt", "value": "<think>\nOkay, so I'm just starting out with Rails and I need to figure out how to comm...
glaive
[ { "from": "human", "value": "You are tasked with creating a program that involves manipulating different types of data structures in Stan programming language. Your task is to write a program that declares various data structures such as vectors, row_vectors, and matrices, and then perform operations on the...
codefeedback
[ { "from": "human", "value": "Craft a Python routine capable of extracting data from Google Cloud Spanner, applying a range of complex data manipulation and preprocessing procedures using the Dask library, and thereafter feeding the refined data into a machine learning model specifically designed for classif...
codefeedback
[ { "from": "human", "value": "Can you explain the function and significance of a Structured Query Language (SQL) when utilized in managing relational database management systems?" }, { "from": "gpt", "value": "<think>\nOkay, so I need to explain the function and significance of SQL in managing re...
magicoder
[ { "from": "human", "value": "You are tasked with implementing a parser for a simple programming language. The language has four types of tokens: \"daddress\", \"dcommand\", \"doaddress\", and \"dosymbol\". The parser should take a list of tokens as input and return a parsed representation of the input.\n\nY...
glaive
[ { "from": "human", "value": "You are tasked with creating a plugin engine in C# that can load and initialize plugins from DLL files. The plugin engine should be able to iterate through the DLLs, load the assemblies, and create instances of classes that implement a specific interface. Additionally, the engin...
magicoder
[ { "from": "human", "value": "You are given a PHP array `$base` that contains a mapping of hexadecimal keys to corresponding values. The values are strings representing different words. Your task is to write a function that takes a hexadecimal key as input and returns the corresponding word from the array. I...
magicoder
[ { "from": "human", "value": "You are tasked with creating a middleware for an application verification process. The middleware is responsible for validating the app key and secret hash before allowing access to the application. The code snippet provided is a part of the unit test for this middleware. The te...
glaive
[ { "from": "human", "value": "You are tasked with creating a Dockerfile to install Node.js and Yarn on an Alpine Linux 3.16 image for an ARM v7 architecture variant. The Dockerfile should also include a test script to ensure that the Node.js and Yarn installations are functioning as expected. Additionally, t...
glaive
[ { "from": "human", "value": "You are tasked with creating a program that manages the assignment of a transition in a workflow. The program should be able to validate the existence of the specified workflow, retrieve the workflow and transition names, list the roles assigned to a transition, list the roles t...
codefeedback
[ { "from": "human", "value": "Create an Android application for calculating monthly loan payments.\nThe application should be able to calculate the monthly payments for different loan types (e.g. car, house, etc.) with varying interest rates and loan durations.\nThe user should be able to input the loan amou...
evolcodegolf
[ { "from": "human", "value": "In this challenge, your task is to input a rectangle ASCII pattern (You may assume only printable characters need to be handled, and you may assume a trailing newline or not), C4_4 symmetrify, while ensuring that each character in the output maintains its original spacing relati...
evolcodegolf
[ { "from": "human", "value": "Question \nDevise a program that takes a single string input from the console and outputs its constituent characters sorted in ascending alphabetical order based on the specified character set. The string must exclusively comprise the following characters: \n\n0123456789abcdef...
glaive
[ { "from": "human", "value": "You are tasked with creating a program to calculate the probability amplitudes and plot the probability distribution of a quantum system. The system is defined by the number of qubits (nqubits), the state name (name), and the number of states (nstates).\n\nThe program must inclu...
codefeedback
[ { "from": "human", "value": "Write a C++ program that adds two given numbers using bitwise operators only and stores the result in a variable named \"sum\". The program should also display the sum in both decimal and binary formats.\n\nAdditional requirements:\n1. The program should not use any arithmetic o...
glaive
[ { "from": "human", "value": "You are tasked with implementing a tagged union in a programming language that supports unions and enums. The union should have a meaningful tag and void fields. You need to ensure that the tag accurately represents the type of the union and that the void fields are appropriatel...
magicoder
[ { "from": "human", "value": "You are working on a game development project and need to implement a system for repairing items using specific ingredients. The code snippet provided is a method from a class that represents an item in the game. The method `getRepairIngredient` is supposed to return the ingredi...
evolcodegolf
[ { "from": "human", "value": "Task \nYou will be presented with a positive integer and you are required to construct a \"self-complementary graph\" that has the same number of nodes as the given integer. In case you are unfamiliar with the concept of a self-complementary graph, here are two succinct explana...
evolcodegolf
[ { "from": "human", "value": "\"Hey Bob, I need a new acronym. Something better than 'Automated Support System'. I need you to fabricate me an acronym that also conveys a sense of innovation and efficiency!\"\n\"Sure thing Joe! I'd love to fabricate an elaborate way to renovate, and not replicate something t...
evolcodegolf
[ { "from": "human", "value": "In tabletop role-playing games, the mechanics of chance are intricately woven into gameplay through the utilization of polyhedral dice. The conventional notation for describing a roll follows the format \\$n\\textbf{d}k\\$ where \\$n\\$ signifies the quantity of dice rolled, and...
sharegpt
[ { "from": "human", "value": "Enhance a function such that it calculates the highest cumulative sum of specifically k non-consecutive cells within a square matrix of NxN dimensions, where each cell consists of a distinct value from 1 to N*N. Instead of only advancing to neighboring cells, the function can no...
magicoder
[ { "from": "human", "value": "You are given two lists, X and Y, both containing integers. Your task is to write a function that calculates the dot product of these two lists. The dot product of two lists is obtained by multiplying each pair of corresponding elements and then summing up these products. For ex...
magicoder
[ { "from": "human", "value": "You are given a list of integers `nums` containing n distinct numbers in the range [0, n]. However, one number is missing from the list. You need to write a function to find and return the missing number.\n\nWrite a function `find_missing_number(nums: List[int]) -> int` to solve...
glaive
[ { "from": "human", "value": "You are tasked with creating a command file for Sphinx documentation. The file should include the ability to build various types of documentation, such as HTML, PDF, EPUB, and more, based on user input. The user should be able to specify the type of documentation they want to cr...
glaive
[ { "from": "human", "value": "I need to create a program that can backup all the computers in a network to a specific location. How can I achieve this using programming?" }, { "from": "gpt", "value": "<think>\nOkay, I need to create a program that can back up all the computers in a network to a s...
codefeedback
[ { "from": "human", "value": "Write a SQL query to find the release dates, language, and genres of all films produced by Quentin Tarantino. Furthermore, for each of these films, include in your results the name of the main actor and the total box office earnings worldwide. Also, make sure to present your fin...
evolcodegolf
[ { "from": "human", "value": "In the engaging and strategically challenging game of 2048, players interact with a grid by maneuvering its elements in four possible directions. Each element moves in its designated direction until it can go no further, thereby creating a dynamic gameplay experience. For this i...
sharegpt
[ { "from": "human", "value": "I am trying to use logging statements within test functions using pytest to examine some state variables. However, I am finding that only the logging messages from the '__name__ == __main__' block are getting transmitted to the console. My code is as follows:\n\n```python\nimpor...
evolcodegolf
[ { "from": "human", "value": "This particular challenge is derived from and incorporates test cases sourced from a programming course that I attended at Aalto University, utilized here with explicit permission granted by the institution. Two and a half years prior, a challenge centered on spoonerisms in Engl...
dolphin
[ { "from": "human", "value": "port this code to Visual Basic .NET:\n```mojo\nclass TreeNode {\n has $.val;\n has TreeNode $.left is rw;\n has TreeNode $.right is rw;\n}\n\nsub lowestCommonAncestor(TreeNode $root, @nodes) {\n return $root if !$root || $root ~~ @nodes;\n my $left = lowestCommonA...
sharegpt
[ { "from": "human", "value": "Develop a Python script that reads an input text string from a file, encrypts it with an RSA key, then translates the encrypted message into its corresponding base64 encoding. The script should also be capable of doing the reverse: decrypt the base64 encoded string using the RSA...
glaive
[ { "from": "human", "value": "You are tasked with implementing a function that takes a 64-bit unsigned integer as input and returns a 32-bit signed integer. The function should handle different scenarios based on the input value. If the input is 1, the function should call another function, getErrInt, and re...
dolphin
[ { "from": "human", "value": "convert this code from Swift to Fortran:\n```Swift\nclass TreeNode {\n var val: Int\n var left: TreeNode?\n var right: TreeNode?\n init(_ val: Int) {\n self.val = val\n self.left = nil\n self.right = nil\n }\n}\n\nclass Solution {\n func st...
evolcodegolf
[ { "from": "human", "value": "Formulate a program or function that, for a given integer n greater than 77, identifies a unique collection of distinct positive integers such that both the aggregate of these integers is precisely equal to n, and the cumulative sum of their reciprocals amounts to exactly 1. \n\...
glaive
[ { "from": "human", "value": "What are some recommended game engines that are easy to learn and free for C++, Java, or Python?\n\nAdditional Information:\nI am a beginner in game development and would like to explore different game engines to get started. I'm open to any type of game engine and want to under...
magicoder
[ { "from": "human", "value": "You are given a Python code snippet that reads data from a file and processes it to extract specific information. Your task is to complete the code by implementing a function that filters and organizes the extracted data based on certain conditions.\n\nYour task is to implement ...
sharegpt
[ { "from": "human", "value": "Can you provide a Python program that can validate if a given username meets certain criteria? The criteria include having at least 8 characters, starting with a letter, and allowing digits and underscores in the username." }, { "from": "gpt", "value": "<think>\nOkay...
magicoder
[ { "from": "human", "value": "You are tasked with implementing a server-side processing mechanism for a DataTable in a web application. The DataTable is initialized with the following configuration:\n\n```javascript\nvar table = $('#datatable').DataTable({\n processing: true,\n serverSide: true,\n /...
sharegpt
[ { "from": "human", "value": "I'm working on a JavaScript project and I need to determine if an object has a specific property or not. Additionally, I need to count the occurrences of that property in an array of objects and return the array of objects that have the specific property. Can someone help me wit...
magicoder
[ { "from": "human", "value": "You are tasked with implementing a Java annotation processor to generate a unique identifier for classes annotated with a custom annotation. The annotation processor should generate a unique identifier for each annotated class and append it to the class name.\n\nYou are provided...
dolphin
[ { "from": "human", "value": "Please explain the following problem in detail and provide code in Swift:\nYou are given an `n x n` `grid` where you have placed some `1 x 1 x 1` cubes. Each value `v = grid[i][j]` represents a tower of `v` cubes placed on top of cell `(i, j)`.\n\nAfter placing these cubes, you ...
evolcodegolf
[ { "from": "human", "value": "Your program is tasked with processing a string composed exclusively of lowercase alphabetical characters received through STDIN (or an equivalent input method). Subsequently, the program must output a boolean value indicating the validity of the input as proper romaji. \n\nGuid...
evolcodegolf
[ { "from": "human", "value": "A Quat is a combination of a quine and the popular esolang cat program. Your objective is to implement a standard cat program that echoes user input directly to stdout. Nevertheless, if the length of the input exceeds zero and is a multiple of four, the program must display its ...
codefeedback
[ { "from": "human", "value": "Enhance the given programming test question by making it slightly more challenging:\n\nRefactor and complete the code below, with an added challenge of providing a piece of erroneous code as a reference to increase misdirection:\n\ndef is_multiply_prime(a):\n \"\"\"Modify the...
dolphin
[ { "from": "human", "value": "translate this code to Elixir:\n```typescript\nfunction woodCutting(m: number, n: number, prices: number[][]): number {\n prices.sort((a, b) => b[2] - a[2]);\n const f: number[][][] = new Array(prices.length + 1).fill(0).map(() => new Array(m + 1).fill(0).map(() => new Arr...
glaive
[ { "from": "human", "value": "You are tasked with implementing a method to write a record to a broker using aMaHashIndexRecord data. The method should take the aMaHashIndexRecord as input and write it to the broker using the byteArray and recordNumber properties of the aMaHashIndexRecord." }, { "from...
sharegpt
[ { "from": "human", "value": "Could you complete the Python function that is to be written below? It requires you to count the occurrences of consonants, merely the non-vowel alphabets, in a transmitted string. You may follow the example usage given for guidance:\n\ndef consonant_count(s: str) -> int:\n \...
glaive
[ { "from": "human", "value": "I am trying to find the Xi libraries in my project, specifically the Xi include directory and the Xi library. I want to use the X11/extensions/XInput2.h file and the Xi library in my code. Can someone provide a solution on how to find and include the Xi libraries in my project u...
glaive
[ { "from": "human", "value": "You are tasked with creating a Rust program that will generate a key, encrypt and decrypt a message, and generate a template and attribute for a git repository.\n\nYour program should include the following functionalities:\n1. Generate a key of a specified length.\n2. Encrypt a ...
codefeedback
[ { "from": "human", "value": "Write a piece of code to merge two arrays into one, ensuring that the resulting array is sorted in ascending order and does not contain any duplicate elements.\n\narray1 = [ 1, 2, 4, 6, 8]\narray2 = [ 3, 4, 7, 9, 10]\n\nAdditional Reasoning Steps:\n1. Merge the two arrays into a...
dolphin
[ { "from": "human", "value": "port this code to R:\n```rust\nfn dfs(matrix: &Vec<Vec<i32>>, memo: &mut Vec<Vec<i32>>, i: usize, j: usize) -> i32 {\n if memo[i][j] != 0 {\n return memo[i][j];\n }\n\n let mut max_len = 0;\n let dx = [0, 0, 1, -1];\n let dy = [1, -1, 0, 0];\n for k in 0...
codefeedback
[ { "from": "human", "value": "Write a function that generates a random password of length n, where n is an input parameter. The password should meet the following requirements:\n- It should contain at least one lowercase letter, one uppercase letter, one number, and one special character.\n- The lowercase le...
glaive
[ { "from": "human", "value": "You are working on a project that requires you to check for certain type sizes and structs in a C/C++ program. You need to write functions to search for libraries and check for the existence of specific functions in those libraries. Additionally, you need to test for the presenc...
sharegpt
[ { "from": "human", "value": "I noticed that when using gcc 5.3, both functions in the code example below generate a call to `memmove`. I'm wondering if it would be more appropriate to generate a call to `memcpy` instead?\n\n```cpp\n#include <vector>\n\nint blackhole(const std::vector<int>&);\n\nint copy_vec...
magicoder
[ { "from": "human", "value": "You are tasked with implementing a simple activity tracking system for a fitness application. The system should allow users to start and stop tracking their activities, and it should display the current status of the activity tracking.\n\nYou are provided with a Swift code snipp...
glaive
[ { "from": "human", "value": "You are tasked with implementing a wavelet tree test using the nvbio library. The goal is to build a wavelet tree from a given input text, extract the text from the wavelet tree, and perform ranking tests against known results.\n\nThe test involves the following steps:\n1. Gener...
codefeedback
[ { "from": "human", "value": "Create a class in Python which models a bank account using the concept of class and object. The bank account should include the following functionalities:\n\n1. Ability to deposit and withdraw funds.\n2. Ability to check the current balance.\n3. Ability to calculate and apply in...
dolphin
[ { "from": "human", "value": "translate this code from ANSI C to Lisp:\n```c\n#include <stdio.h>\n#include <limits.h>\n\n#define INF INT_MAX\n\nint MINIMUM_DIFFICULTY_JOB_SCHEDULE(int* jobDifficulty, int n, int d) {\n if (n < d) return -1;\n\n int dp[d+1][n+1];\n for (int i = 0; i <= d; i++) {\n ...
glaive
[ { "from": "human", "value": "You are tasked with creating an Emacs Lisp function that sets up the necessary configurations for a smooth Emacs initialization. This function should include setting the root user-emacs-directory to the one containing the init.el file, adjusting visuals to avoid momentary displa...
codefeedback
[ { "from": "human", "value": "Write a Python code snippet that combines the elements of two lists into a single list. The resulting list should only include elements that start with a capital letter and are shorter than 5 characters in length. The elements should be sorted in descending order based on their ...
glaive
[ { "from": "human", "value": "You are tasked with creating a module in Elm called \"Hierarchy\" with the functions list, view, and setShapeKind. The list function takes in a function to select a body, a maybe selected body, and an array of bodies, and returns an element. The view function takes in a message,...