source
stringclasses
6 values
conversations
listlengths
2
2
sharegpt
[ { "from": "human", "value": "I am currently developing an operating system for learning purposes and I encountered an issue when trying to call an assembler function from C code. I have a small example in pure assembler that reproduces the problem. Here are the two files:\n\ntest.asm:\n\n```asm\n[bits 32]\n...
codefeedback
[ { "from": "human", "value": "Write a function in Java to split a string into an array of substrings. The function should ignore any whitespace characters and only consider alphanumeric characters as valid substrings. The function should also remove any leading or trailing non-alphanumeric characters from th...
evolcodegolf
[ { "from": "human", "value": "Objective \nI possess a visually captivating picture that I aspire to display prominently on my wall. To achieve an awe-inspiring presentation, I have decided to secure it using n nails, where n represents any positive integer. However, my indecisiveness poses a challenge; shou...
dolphin
[ { "from": "human", "value": "convert this code to Ruby:\n```vb.net\nModule Module1\n Const MOD As Integer = 1000000007\n\n Function GoodStringCount(ByVal n As Integer, ByVal s1 As String, ByVal s2 As String, ByVal evil As String) As Integer\n Dim count As Long = 0\n For i As Integer = 0 ...
codefeedback
[ { "from": "human", "value": "Write a CSS selector to select an element with the id \"example\" that is nested within another element with a class of \"outer-container\". Additionally, explain how the CSS specificity calculation would work for this selector." }, { "from": "gpt", "value": "<think>...
dolphin
[ { "from": "human", "value": "translate this code to Scala:\n```pascal\nfunction minimumSwapsToBalance(s: string): integer;\nvar\n left, right, swaps: integer;\nbegin\n left := 0;\n right := Length(s)-1;\n swaps := 0;\n while left < right do\n begin\n if s[left] = '[' then\n begin\n while s[...
dolphin
[ { "from": "human", "value": "translate this code from c++ to Scheme:\n```cpp\n#include <vector>\n#include <string>\n\nstd::vector<std::string> buildArray(std::vector<int>& target, int n) {\n std::vector<std::string> result;\n int current = 1;\n for (int num : target) {\n while (current < num...
magicoder
[ { "from": "human", "value": "You are tasked with creating a Python function that processes a given directory and returns a list of files that have been modified within a specified time range. You should use the `os.path` and `time` modules to achieve this.\n\nWrite a function called `get_modified_files` tha...
glaive
[ { "from": "human", "value": "I need to create a Python script that can connect to a Kubernetes cluster and perform operations using the Kubernetes API. The script should be able to authenticate with the cluster using a kubeconfig file and then execute commands to interact with the cluster. The script needs ...
sharegpt
[ { "from": "human", "value": "I'm trying to implement Insertion Sort in Java. Can someone provide me with a code example?" }, { "from": "gpt", "value": "<think>\nOkay, so the user wants to implement Insertion Sort in Java. Let me recall how Insertion Sort works. From what I remember, it's a sorti...
sharegpt
[ { "from": "human", "value": "What is a suitable predictive model to identify fraudulent bank transactions?" }, { "from": "gpt", "value": "<think>\nOkay, so I need to figure out a suitable predictive model for identifying fraudulent bank transactions. Let me start by recalling what I know about f...
sharegpt
[ { "from": "human", "value": "I am trying to run a `shuffle` function in Python which should shuffle a list `x` in place. The function uses an optional argument `random` which is a 0-argument function returning a random float in [0.0, 1.0). If this argument is not provided, it uses the standard `random.rando...
glaive
[ { "from": "human", "value": "You are tasked with creating a program that provides authorization for accessing blob and queue data in Azure using Azure AD and OAuth. Your program should include the following built-in RBAC functions:\n- Storage Blob Data Owner: Define and manage POSIX access control for Azure...
sharegpt
[ { "from": "human", "value": "I am currently working on a mapping application and I am trying to cluster points on a map using latitude and longitude coordinates. The aim is to cluster points that are close together to reduce clutter on the map viewport. I already have a solution in place, but I am wondering...
evolcodegolf
[ { "from": "human", "value": "In this task, you are required to develop an algorithm that models a group of individuals navigating a 3D space. The input consists of a series of coordinates representing each individual's position in a 3D grid and their intended movement direction (or remaining stationary). Th...
evolcodegolf
[ { "from": "human", "value": "Your task is to sort an array containing the strings \"quarter\", \"dime\", \"nickel\", and \"penny\" any number of times in no specific order and sort them so that they are in this order: quarter dime nickel penny (in other words, greatest to least monetary value), while also e...
dolphin
[ { "from": "human", "value": "Please write the following solution using c++:\nFruits are available at some positions on an infinite x-axis. You are given a 2D integer array `fruits` where `fruits[i] = [positioni, amounti]` depicts `amounti` fruits at the position `positioni`. `fruits` is already **sorted** b...
evolcodegolf
[ { "from": "human", "value": "Your task is to generate a self-complementary graph corresponding to a provided positive integer, which specifies the number of nodes in the graph. If you are unfamiliar with the concept of a self-complementary graph, you may find the explanations below useful, as typical refere...
magicoder
[ { "from": "human", "value": "You are tasked with implementing a simplified version of a JSON serializer in Python. Your goal is to create a function `dump_json` that takes an object `o` and an optional integer `indent` and returns a JSON string representing the object.\n\nThe function signature is as follow...
sharegpt
[ { "from": "human", "value": "How can I write a Python program that extracts the first name and last name from a given full name?" }, { "from": "gpt", "value": "<think>\nOkay, I need to write a Python program that takes a full name and extracts the first and last names. Let me think about how to ...
codefeedback
[ { "from": "human", "value": "Outline three uncommon methods for improving biometric authentication security, and for each, provide a corresponding example of hardware or software configurations that illustrate the mentioned security improvement." }, { "from": "gpt", "value": "<think>\nOkay, I ne...
glaive
[ { "from": "human", "value": "You are tasked with creating a query to find mapping documents by distribution ID using SPARQL. The query should retrieve mapping documents that are associated with a specific distribution ID or CKAN resource ID. The query should include the mapping document's identifier, hash, ...
glaive
[ { "from": "human", "value": "You are tasked with implementing a C++ program that calculates the sum of the power of a set of input numbers. The program should take in a list of numbers and calculate the sum of their powers, where the power is a predefined constant. The program should be able to handle input...
sharegpt
[ { "from": "human", "value": "Design and implement a backtracking algorithm.\n\nA backtracking algorithm is a trial-and-error-based problem-solving technique where, if a solution to a subproblem does not lead to the desired outcome, the algorithm backtracks and tries alternative solutions. The algorithm sear...
evolcodegolf
[ { "from": "human", "value": "A cosmic calamity has unfolded: a rift in spacetime has unleashed a swarm of enigmatic entities known as the Synths, whose sole purpose is to harvest the energy of dying stars for their own survival. They are rapidly converting distant galaxies into black holes, leaving our Milk...
sharegpt
[ { "from": "human", "value": "How can I generate a simple Node.js web server that responds with a static web page?" }, { "from": "gpt", "value": "<think>\nOkay, I need to figure out how to create a simple Node.js web server that serves a static web page. Let me start by recalling what I know abou...
magicoder
[ { "from": "human", "value": "You are tasked with implementing a Python class that manages add-on entitlements for a product. The class should allow for the association of price IDs with the product and provide methods to add, remove, and retrieve entitlements.\n\nYou are given a code snippet as a starting p...
codefeedback
[ { "from": "human", "value": "Write a function that takes in a positive integer and determines if it is a prime number. A prime number is defined as a number greater than 1 that has no positive divisors other than 1 and itself.\n\nTo solve this problem, the function can follow these steps:\n1. Check if the i...
codefeedback
[ { "from": "human", "value": "Given a string, print all its permutations.\n\nExample:\nInput: \"british\"\nOutput: \n\"british\"\n\"britsih\"\n\"britihs\"\n\"british\"\n\"britsiih\"\n...\n\n(Note: The output list will contain all possible permutations of the input string)\n\nNow, additionally, you need to en...
sharegpt
[ { "from": "human", "value": "Use a deep learning model to predict the house prices in the provided dataset.\nDataset of house prices with 10 features" }, { "from": "gpt", "value": "<think>\nOkay, so I need to use a deep learning model to predict house prices based on a dataset with 10 features. ...
magicoder
[ { "from": "human", "value": "You are tasked with creating a configuration file parser for a zombie apocalypse survival game. The configuration file, named `.zombiesconfig`, contains key-value pairs that define various game settings. Each key-value pair is separated by an equal sign, and each setting is on a...
sharegpt
[ { "from": "human", "value": "I have a Rails 4 app with no custom Javascript. Whenever I navigate through the app, I keep getting the error \"jquery-ujs has already been loaded!\" in the JS console. This error occurs consistently when I hit the \"back\" button and sometimes when I click on a normal link. I h...
glaive
[ { "from": "human", "value": "How can I parse a DateTime string in the format \"HH:MM:SS dd/mm/yyyy\" using Python?" }, { "from": "gpt", "value": "<think>\nOkay, so I need to parse a DateTime string in the format \"HH:MM:SS dd/mm/yyyy\" using Python. Hmm, let me think about how to approach this.\...
magicoder
[ { "from": "human", "value": "You are tasked with implementing a Python decorator that memoizes the result of a method call. Memoization is a technique used to speed up the execution of functions by caching the results of expensive function calls and returning the cached result when the same inputs occur aga...
codefeedback
[ { "from": "human", "value": "Create a Java web application that displays a welcome message and allows users to input their name. The application should validate the input and display a personalized welcome message with the user's name. Additionally, the application should have a feature where users can sele...
codefeedback
[ { "from": "human", "value": "Design, implement, and optimize a scalable, fault-tolerant backend microservice utilizing a Kubernetes orchestration tool while dealing with connection throttling, rate limiting, and maintaining high availability. \n\nYou're expected to handle different API Versions and support ...
evolcodegolf
[ { "from": "human", "value": "A digit word is defined as a word that, through the potential removal of certain letters, can be transformed into one of the single digits: ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, or NINE (note that ZERO is excluded). For instance, the words BOUNCE and ANNOUNCE qualify a...
codefeedback
[ { "from": "human", "value": "Develop a code segment to traverse a collection of distinct integer values but in a 2D matrix. The program should not only display the index of the initial instance where a specified target is encountered, but also the total number of steps taken to reach the target, considering...
sharegpt
[ { "from": "human", "value": "I need help constructing a JavaScript code snippet using Vue.js and axios. I want to determine all the buttons with the class \"button-element\" and fetch data from an API endpoint. I want to dynamically bind the returned data to each button's data attribute. Can someone help me...
glaive
[ { "from": "human", "value": "You are tasked with implementing a Node.js class called \"Box\" that sets up AirSqueeze for a given device. The class should have a constructor that takes in the device's information, including the player ID, flags, and squeeze. It should also set up an AirPlay server using the ...
codefeedback
[ { "from": "human", "value": "Generate a program to get the min and max values from a list in one line, while ensuring a time complexity of O(n log n) and a space complexity of O(1)." }, { "from": "gpt", "value": "<think>\nOkay, I need to generate a Python program that finds the minimum and maxim...
glaive
[ { "from": "human", "value": "You are tasked with implementing a program to connect to an HAProxy instance and issue commands to retrieve statistics. You should be able to connect to HAProxy using either a Unix socket or a TCP socket. The connection should be established using a `ConnectionBuilder`, which ca...
codefeedback
[ { "from": "human", "value": "Construct a JavaScript object that dynamically creates multiple methods and executes a specific operation based on a provided conditional circumstance. This object should provide methods to add new conditional circumstances and their corresponding operations dynamically at runti...
evolcodegolf
[ { "from": "human", "value": "Introduction \nFormulate a compact solver for the Hitori puzzles while adhering to minimal byte usage. \n\nChallenge \nYour task is to develop an efficient solver for the Hitori (ひとり, which translates to \"alone\" in Japanese) logical puzzles. The rules are as follows: \n\nY...
glaive
[ { "from": "human", "value": "I want to create a program that can remove all files and directories within a specific directory in my CMake project. I need a solution that can be implemented using CMake. Can someone provide a complete example of how to achieve this using CMake commands and functions?" }, ...
magicoder
[ { "from": "human", "value": "You are tasked with creating a Python function that processes template files in a given directory. The function should identify all the template files within the directory and its subdirectories, and then return a list of these template file names.\n\nYou are provided with a cod...
glaive
[ { "from": "human", "value": "How can I write a function that checks whether a given number is a power of two?" }, { "from": "gpt", "value": "<think>\nOkay, so I need to write a function that checks if a given number is a power of two. Hmm, let's think. Powers of two are numbers like 2^0=1, 2^1=2...
sharegpt
[ { "from": "human", "value": "I need to write a shell script that can determine if a given number is prime or not. Can you provide me with a code example to achieve this?" }, { "from": "gpt", "value": "<think>\nOkay, I need to write a shell script to check if a given number is prime. Hmm, where d...
codefeedback
[ { "from": "human", "value": "Select the overlapping elements between two lists. The lists can contain duplicates. However, one of the lists may contain nested lists as well. \nlist1 = [1, 2, 3, [4, 5, [6, 7]], 5, 6]\nlist2 = [3, [4, 5, [6, 7]], 5, 6, 7, 8]\n\nNote: You need to consider the nested lists as w...
dolphin
[ { "from": "human", "value": "translate this code from javascript to Ruby:\n```javascript\nfunction isPrime(n) {\n if (n <= 1) return false;\n for (let i = 2; i * i <= n; i++) {\n if (n % i === 0) return false;\n }\n return true;\n}\n\nfunction isPalindrome(n) {\n const str = n.toString...
dolphin
[ { "from": "human", "value": "translate this code to Perl:\n```php\nfunction isWhiteSquare($coordinates) {\n $charToNum = array(\n 'a' => 1,\n 'b' => 2,\n 'c' => 3,\n 'd' => 4,\n 'e' => 5,\n 'f' => 6,\n 'g' => 7,\n 'h' => 8\n );\n \n $num = ...
codefeedback
[ { "from": "human", "value": "Implement an exception handling mechanism to display appropriate reminders based on each month of the year. Incorporate a leap year verification system, and differentiate February's reminders based on it. Validate the current_month is a legitimate month." }, { "from": "g...
evolcodegolf
[ { "from": "human", "value": "Challenge \nYou have been tasked with manipulating a sequence consisting solely of numerical digits from 0 to 9. Your objective is to permute this sequence such that each position contains a distinct digit compared to its original placement prior to the permutation. \nFor illu...
magicoder
[ { "from": "human", "value": "You are tasked with creating a Bash script that utilizes command-line arguments to execute a specified command and measure its execution time. Your script should handle missing required arguments and provide a helpful error message in such cases.\n\nWrite a Bash script named `ti...
glaive
[ { "from": "human", "value": "I am working on a project that involves managing files in a directory, and I need to write a function that will remove all files and subdirectories within a specified directory. I want the function to be platform-independent and capable of removing directories with non-empty sub...
glaive
[ { "from": "human", "value": "You are tasked with creating a shader for a 3D surface using the EasyRoads3D framework. The shader should have a main color property and use the Lambert lighting model. Additionally, it should have a main texture and an alpha channel. Write a shader program that meets these requ...
dolphin
[ { "from": "human", "value": "translate this code to Lua:\n```go\nconst MOD = 1000000007\n\nfunc countGoodStrings(s1 string, s2 string, evil string) int {\n n := len(s1)\n m := len(evil)\n dp := make([][]int, n+1)\n for i := range dp {\n dp[i] = make([]int, m)\n }\n\n // Preprocess t...
sharegpt
[ { "from": "human", "value": "Given the following erroneous Python code as a reference, you are to determine not only the geospatial coordinates, specifically the longitudinal and latitudinal measurements, corresponding to the given physical address but also explain why the initial code fails and how it can ...
evolcodegolf
[ { "from": "human", "value": "You should develop a function that accepts a string input representing a two-dimensional array of characters where every lowercase letter corresponds to one uppercase letter within the grid. Each lowercase letter possesses a unique perception range defined by its position in the...
magicoder
[ { "from": "human", "value": "You are tasked with creating a Python function that processes a job description extracted from a website using XPath and regular expressions. The function should take the extracted description as input and perform a series of text processing operations to clean and format the de...
dolphin
[ { "from": "human", "value": "translate this code to F#:\n```pascal\nfunction matrixScore(grid: array of array of Integer): Integer;\nvar\n m, n, i, j, count, result: Integer;\nbegin\n m := Length(grid);\n n := Length(grid[0]);\n for i := 0 to m-1 do\n begin\n if grid[i][0] = 0 then\n begin\n ...
sharegpt
[ { "from": "human", "value": "Develop a function to determine whether or not a matrix is a reflection of itself, i.e. all elements that are symmetrical along the diagonal are equal.\nmatrix = \n[\n [1, 4, 7],\n [2, 5, 8],\n [3, 6, 9]\n]" }, { "from": "gpt", "value": "<think>\nOkay, I need to d...
glaive
[ { "from": "human", "value": "You have been tasked with creating a PowerShell function that adds a ProjectPath to the PSProfile to find Git project folders under during PSProfile refresh. The function should be able to add the specified folder to $PSProfile.ProjectPaths, refresh the PSProfile after updating ...
codefeedback
[ { "from": "human", "value": "Given a linked list, reverse the nodes of a linked list in groups of k nodes and return its modified list. Each group of k nodes must be reversed together. The overall time complexity should be O(n) and the space complexity should be O(1).\n\nAdditionally, the solution should us...
magicoder
[ { "from": "human", "value": "You are tasked with creating a Python function that extracts and returns the strings contained within the `__all__` attribute of an object. The `__all__` attribute is a common convention in Python modules to specify which symbols to export when using the `from module import *` s...
glaive
[ { "from": "human", "value": "I am trying to implement a function in OCaml that takes in a type and a size, and returns a list of values of that type with the given size. However, I am encountering some issues with the existing implementation and need help troubleshooting.\n\nCan someone provide a solution f...
glaive
[ { "from": "human", "value": "I am working with a GMSprite in a game development project and I need to create a new sprite frame with composite images and layers. The new sprite frame should have a specific width, height, and position, and should also include images and layers with certain properties. Can so...
magicoder
[ { "from": "human", "value": "You are given the following C++ code snippet for reversing a linked list within a specified range:\n\n```cpp\nvoid reverseLinkedListInRange(ListNode* head, int left, int right) {\n if (left == right) {\n return;\n }\n\n ListNode* dummy = new ListNode(0);\n dum...
codefeedback
[ { "from": "human", "value": "You are tasked with creating a Python class to simulate a simple dice game. The class should include methods for rolling the dice, calculating the total score, and checking for specific combinations.\n\nCreate a class `DiceGame` with the following specifications:\n- The class sh...
dolphin
[ { "from": "human", "value": "Please write the following solution using Elixir:\nGiven a positive integer `num`, split it into two non-negative integers `num1` and `num2` such that:\n\n* The concatenation of `num1` and `num2` is a permutation of `num`.\n * In other words, the sum of the number of occu...
dolphin
[ { "from": "human", "value": "convert this code to PHP:\n```erlang\n-module(max_building).\n-export([max_building/2]).\n\nmax_building(N, Restrictions) ->\n Restrictions1 = Restrictions ++ [[1, 0], [N, N - 1]],\n Restrictions2 = lists:sort(Restrictions1),\n\n ForwardPass = fun([], Acc) -> lists:reve...
sharegpt
[ { "from": "human", "value": "I need to construct a function that adds two given binary strings and returns the result. Can someone help me with the code?" }, { "from": "gpt", "value": "<think>\nOkay, let's see. I need to write a function that adds two binary strings and returns the result as a b...
glaive
[ { "from": "human", "value": "I am trying to insert data into a RDF graph using SPARQL, but I am having trouble with defining a new instance of a Person with a specific UUID. Can someone provide an example of how to achieve this using PREFIX and INSERT DATA in SPARQL?" }, { "from": "gpt", "value"...
evolcodegolf
[ { "from": "human", "value": "The objective is to enumerate all unique sequences that can be formed by summing distinct positive integers that equal a specified target integer k. Each sequence must include integers from 1 up to k without any repetition. For example, with an input of k = 5, the valid combinat...
dolphin
[ { "from": "human", "value": "Please write the following solution using Fortran:\nYou are given a string `s` consisting only of characters `'a'` and `'b'`​​​​.\n\nYou can delete any number of characters in `s` to make `s` **balanced**. `s` is **balanced** if there is no pair of indices `(i,j)` such that `i <...
codefeedback
[ { "from": "human", "value": "Please replace the placeholder in the given HTML document with the corresponding table, where the table data is fetched from an external API.\n\n<html>\n <body>\n <!-- replace placeholder with table -->\n </body>\n</html>\n\nFetch the data from the API endpoint: `https://ex...
sharegpt
[ { "from": "human", "value": "I have the following pseudocode representation and I need to transform it into an equivalent JavaScript code implementation. The code should take two input variables, Variable_A and Variable_B, and output the larger value between them. Can someone please provide the JavaScript c...
magicoder
[ { "from": "human", "value": "You are tasked with implementing a class that manages a collection of users. The class, `UserManager`, should provide methods to add, delete, and retrieve users. The `Usuario` class represents a user and has a `name` and `id` attribute. Your task is to complete the implementatio...
evolcodegolf
[ { "from": "human", "value": "Greeklish, a portmanteau of the words Greek and English, represents a unique method of transcribing modern Greek using solely ASCII characters. This informal transcription was predominantly utilized in earlier applications and online forums that lacked Unicode support, rendering...
sharegpt
[ { "from": "human", "value": "How can I create a login form component using React?" }, { "from": "gpt", "value": "<think>\nOkay, I need to create a login form component using React. Let's see, where do I start? Well, first, I remember that React uses functional components with hooks now, so I sho...
codefeedback
[ { "from": "human", "value": "Manipulate a given piece of code which currently removes the spaces from a given string with erroneous implementations. Identify and correct the mistakes and write the final, functional program. Also consider situations where the string may have spaces in-between words and optim...
magicoder
[ { "from": "human", "value": "You are tasked with creating a program that simulates a simple game of dice. The game involves rolling a standard six-sided die and keeping track of the cumulative sum of the rolls. The game continues until the cumulative sum exceeds a certain threshold. Your task is to implemen...
sharegpt
[ { "from": "human", "value": "Generate the initial ten integers from the Fibonacci sequence, where every subsequent number emerges as the summation of two preceding ones." }, { "from": "gpt", "value": "<think>\nOkay, so I need to generate the first ten integers from the Fibonacci sequence. Let me...
glaive
[ { "from": "human", "value": "I am trying to implement an AddressCache for a client SDK that supports cross-region address routing based on availability and preference list. The AddressCache should also handle refreshing the location based on a specified time interval and handle multiple write locations. I n...
codefeedback
[ { "from": "human", "value": "Generate a Pandas dataframe encapsulating specified data about a select group of students, including individual details such as their respective names, ages, and academic grade levels. The students under consideration are John, who is 18 years old and in grade 12; Jane, 17 years...
sharegpt
[ { "from": "human", "value": "Is there a way to create a basic SQLite database that can store information about user profiles, including their names, ages, and email addresses?" }, { "from": "gpt", "value": "<think>\nOkay, the user wants to create a basic SQLite database to store user profiles wi...
codefeedback
[ { "from": "human", "value": "You are given a matrix represented by a 2D list of integers. Your task is to write a function that modifies the matrix in place, setting the entire row and column to 0 if any element in that row or column is 0.\n\nYou need to implement the following function:\n\n```python\ndef s...
magicoder
[ { "from": "human", "value": "You are tasked with creating a Python function that processes a graph and generates a scatter plot of the positions of its nodes. The graph is represented as a list of tuples, where each tuple contains the x and y coordinates of a node. The function should take this graph as inp...
codefeedback
[ { "from": "human", "value": "Go through the \"Bike Sharing Dataset\" at http://capitalbikeshare.com/system-data. Devise a way to visualize the usage over time but now, also categorize and visualize the usage data according to user type and weather conditions." }, { "from": "gpt", "value": "<thin...
glaive
[ { "from": "human", "value": "I need to create a C++ program that implements the functionality of generating symmetric points given a step size and a limit. The program should generate an array of symmetric points based on the given step size and limit. The program should be able to handle both single and do...
dolphin
[ { "from": "human", "value": "Please write the following solution using F#:\nYou are given two binary trees `root1` and `root2`.\n\nImagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are not. You need to merge the two trees into a new binary ...
glaive
[ { "from": "human", "value": "You are tasked with creating a module in Verilog that counts the number of set bits in a 4-bit input. The module should take a 4-bit input and produce a 3-bit output representing the count of set bits. A set bit is a binary digit that is set to 1. Your task is to implement the l...
magicoder
[ { "from": "human", "value": "You are tasked with creating a test case for a user model in a Python Django application. The test case should verify the successful addition of a user to the database.\n\nWrite a test case `test_create_user_success` within the `TestUserModel` class that checks if a user can be ...
magicoder
[ { "from": "human", "value": "You are tasked with implementing a program to process and analyze customer data from a telecommunications company. The program should read input data containing customer information and their corresponding internet usage, and then calculate the total internet usage for each cust...
sharegpt
[ { "from": "human", "value": "I am trying to handle multiple domains with Golang. For example, if the browser sends a request for http://sampledomain.me, I want to handle it with a specific Golang program. However, I also want to have multiple programs on one server and assign each program to handle a specif...
glaive
[ { "from": "human", "value": "You are tasked with implementing a parser for a subset of the C programming language using the given code snippet as a reference. The parser needs to be able to recognize and analyze various C language constructs such as expressions, declarations, statements, and function defini...
codefeedback
[ { "from": "human", "value": "You are presented with a sequence of characters composed of various symbols. Develop a program that is capable of meticulously extracting and omitting these interspersed symbols in order to yield a coherently readable text string.\n\"This , is an example string %\"" }, { ...
magicoder
[ { "from": "human", "value": "You are tasked with creating a Python function that generates a unique revision ID for a database record. The revision ID should be a combination of the create date and a unique key. The create date should be in the format \"YYYY-MM-DD\" and the unique key should be a randomly g...
codefeedback
[ { "from": "human", "value": "You are tasked with creating a program that generates a random string of consonants and spaces. The program should take the width of the terminal window into account and ensure that the generated string fits within the available space. If the terminal width is not available, the...
sharegpt
[ { "from": "human", "value": "Implement a custom LinkedHashSet class in Java. Your custom class should support 5 operations:\n\n1. init() - initializes the LinkedHashSet with distinct elements. For this question, use the elements 11, 13, 17, 19.\n2. insert(x) - inserts an element to the LinkedHashSet. If the...