source stringclasses 6
values | conversations listlengths 2 2 |
|---|---|
codefeedback | [
{
"from": "human",
"value": "Write an SQL query to select all rows from the table \"customers\" that have the same age and email domain as the given customer. Calculate and display their average account balance. Exclude the given customer from the results.\ncustomer = (\"John Smith\", 32, \"johnsmith@exampl... |
evolcodegolf | [
{
"from": "human",
"value": "**Introduction** \nIn a whimsical realm of enchanted forests and mystical creatures, a mystical scribe faces a perplexing conundrum: the ancient scrolls detailing the lineage of magical artifacts have been lost in a chaotic storm. \nThe scribe wishes to unravel how many distin... |
evolcodegolf | [
{
"from": "human",
"value": "# Greek Alphabet Challenge, N bytes\n\nFairly obviously, you have to print the Greek alphabet. However, to add an additional layer of complexity, I thought I'd introduce a twist: when your program is executed with any argument, it should output the Greek alphabet in lowercase, a... |
glaive | [
{
"from": "human",
"value": "I need to create a new Azure container instance with the following specifications:\n- Resource group: rg-responsible-ai\n- Name: loan-decision\n- Image: The image will be pulled from the specified Azure Container Registry (ACR) server and the image name will be provided as envir... |
dolphin | [
{
"from": "human",
"value": "port this code to Object Pascal:\n```scheme\n(define (max-length-between-equal-characters s)\n (define max-length -1)\n (define char-index-map (make-hash))\n (define (update-max-length char index)\n (set! max-length (max max-length (- index (hash-ref char-index-map char) 1... |
sharegpt | [
{
"from": "human",
"value": "Is it necessary to convert input data to lowercase for (pre) training a BERT uncased model using HuggingFace? What would be the impact of lowercasing the text?"
},
{
"from": "gpt",
"value": "<think>\nOkay, so the user is asking whether they need to convert their inpu... |
evolcodegolf | [
{
"from": "human",
"value": "Task\nYou are required to develop an application that accurately determines the specific language in which a given text passage is composed.\nGuidelines\nThe text passage will be provided to your application either through standard input (STDIN) or as function parameters. \nThe ... |
dolphin | [
{
"from": "human",
"value": "translate this code to Dart:\n```fortran\nfunction isRectangleCover(rectangles) result(res)\n logical :: res\n real :: area, lx, ly, rx, ry\n integer :: i, j, n, m\n integer, dimension(:,:), intent(in) :: rectangles\n integer, dimension(:,:), allocatable :: points... |
codefeedback | [
{
"from": "human",
"value": "Consider the erroneous Python code provided:\n\n```python\ndef isMinHeap(arr, i, n):\n if i &amp;amp;amp;amp;amp;gt; (n - 2) / 2:\n return True\n if arr[i] &amp;amp;amp;amp;amp;lt;= arr[2 * i + 1] and arr[i] &amp;amp;amp;amp;amp;lt;= arr[2 * i + 2] and i... |
evolcodegolf | [
{
"from": "human",
"value": "Consider these 15 ASCII playing card patterns (ace through Joker, including the back side), where X serves as a placeholder representing the respective suit symbol: (the visual representation improves with reduced line spacing) \n------------- ------------- ------------- ... |
glaive | [
{
"from": "human",
"value": "You are tasked with creating a Go program that will execute Ansible operations asynchronously. The program should be able to handle the execution of Ansible operations on a given node and deployment. The program should also handle monitoring and retrying operations if necessary.... |
magicoder | [
{
"from": "human",
"value": "You are tasked with implementing a function to process an image represented as a 2D array of integers. The function should perform a specific operation on the image data based on certain conditions. \n\nYou are given a code snippet that checks if the variable `mImage` is not NUL... |
codefeedback | [
{
"from": "human",
"value": "While trying to run \"import torchvision\", the following error displayed-\n\nImportError: /home/jupyterlab/conda/envs/python/lib/python3.7/site-packages/torchvision/_C.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _ZN6caffe26detail36_typeMetaDataInstance_preallocated_7E\n\... |
codefeedback | [
{
"from": "human",
"value": "Embark on a comprehensive journey into the complex realm of quantum entanglement, emphasizing its pivotal role in the rapidly advancing field of quantum cryptography. Could you meticulously construct a discourse that delves into the origin, development, and practical application... |
magicoder | [
{
"from": "human",
"value": "You are tasked with creating a custom configuration service for a web application. The application uses the ASP.NET Core framework, and you need to implement a custom configuration provider to load configuration data from a specific source. Your task is to create a custom config... |
evolcodegolf | [
{
"from": "human",
"value": "Years ago, I encountered the \"Best of Ruby Quiz\" book authored by James Edward Gray II, which is now also accessible online. Within this compilation, the second problem (originally problem 14 on his RubyQuiz website) features a golfed solution that he claims is under 300 bytes... |
codefeedback | [
{
"from": "human",
"value": "Write a Python program to print out the Fibonacci sequence up to 20 numbers"
},
{
"from": "gpt",
"value": "<think>\nOkay, so I need to write a Python program that prints the Fibonacci sequence up to 20 numbers. Hmm, let's start by recalling what the Fibonacci sequenc... |
codefeedback | [
{
"from": "human",
"value": "Implement a for loop in Python to iterate through a given list of numbers and print the square of each number, but only if the number is prime. The time complexity of your solution should be O(n√m), where n is the number of elements in the list and m is the maximum number in the... |
glaive | [
{
"from": "human",
"value": "You are tasked with creating a CMake clean rule to remove specific files and directories from your build directory. The clean rule should remove the specified files and directories every time the clean target is invoked. You need to ensure that the clean rule is implemented for ... |
codefeedback | [
{
"from": "human",
"value": "How would you construct a Python script to visualize the hierarchical structure of a MongoDB database?"
},
{
"from": "gpt",
"value": "<think>\nOkay, so I need to figure out how to create a Python script that visualizes the hierarchical structure of a MongoDB database... |
magicoder | [
{
"from": "human",
"value": "You are tasked with creating a program that processes a given directory and its subdirectories to find all files that match a specific file name pattern. Your program should search for files with a particular file name pattern and return a list of the full file paths for all mat... |
codefeedback | [
{
"from": "human",
"value": "Create a Migration Script in Node.js for creating a table for customers with the following columns: \n1. customer_id (primary key) - this column should be an auto-incrementing integer to uniquely identify each customer. \n2. first_name (string) - this column should store the fir... |
sharegpt | [
{
"from": "human",
"value": "Is there a way to merge `META-INF/services` files, like `META-INF/services/javax.ws.rs.ext.Providers`, when building a `jar-with-dependencies` using the Maven Assembly plugin? I have seen solutions using the Maven Shade plugin, but we are already heavily using the Maven Assembly... |
evolcodegolf | [
{
"from": "human",
"value": "Powerball is an American lottery that has recently gained attention because the current jackpot (as of January 11, 2016) is the largest lotto prize in history, at about $1.5 billion (USD). Powerball players choose 5 distinct numbers from 69 numbered white balls, and 1 \"Powerbal... |
magicoder | [
{
"from": "human",
"value": "You are tasked with creating a Python function that validates a JSON object against a set of expected keys. Your function should ensure that the JSON object contains all the keys specified in a given list and raise an exception if any key is missing.\n\nWrite a function `validat... |
glaive | [
{
"from": "human",
"value": "You are tasked with creating a function in Emacs Lisp that takes a list of numbers and returns the sum of all the even numbers in the list. You should also ensure that the function is robust and can handle edge cases such as an empty list or a list with no even numbers."
},
... |
codefeedback | [
{
"from": "human",
"value": "Devise a proficient PHP technique for managing exceptions, with a particular emphasis on uncaught and bespoke exceptions. Furthermore, illustrate the application of your technique in a practical context by crafting a code snippet. This code should not only demonstrate the use of... |
sharegpt | [
{
"from": "human",
"value": "Is there a way to retrieve the version of the operating system currently installed in Python?"
},
{
"from": "gpt",
"value": "<think>\nOkay, I need to figure out how to retrieve the OS version using Python. Let me start by recalling what I know. There's the os module ... |
magicoder | [
{
"from": "human",
"value": "You are given a list of integers representing the heights of people standing in a line. The people are standing in a row, and their heights are represented by the integers in the list. You need to find the height of the person who is neither the tallest nor the shortest in the l... |
evolcodegolf | [
{
"from": "human",
"value": "Design a system that takes a collection of user-defined key-value pairs and rotates the values among the keys, ensuring that each value is uniquely assigned to a different key than its original. The output must represent this reallocation, while allowing for every possible confi... |
codefeedback | [
{
"from": "human",
"value": "Develop a function that can extract substrings enclosed within square brackets [ ] from a given text string. This function should be capable of handling nested square brackets and should return the enclosed substrings in the sequence of their appearance. The function should also... |
magicoder | [
{
"from": "human",
"value": "You are tasked with creating a program that checks whether a given number is a perfect number or not. A perfect number is a positive integer that is equal to the sum of its proper divisors, excluding itself. For example, 6 is a perfect number because the sum of its proper diviso... |
evolcodegolf | [
{
"from": "human",
"value": "Given a string of lowercase letters, devise a method to shuffle its characters systematically such that the resultant arrangement forms a palindrome. The solution must demonstrate multiple-step reasoning and provide various possible configurations. For instance, the string adadb... |
magicoder | [
{
"from": "human",
"value": "You are tasked with implementing a notification system in Python. The system should allow for the registration of notifiers for specific notification IDs and the triggering of notifications to the registered notifiers. You are provided with a partial implementation of the `Notif... |
glaive | [
{
"from": "human",
"value": "Can someone help me compare two lists in Python and return the elements that are not common in both lists?"
},
{
"from": "gpt",
"value": "<think>\nOkay, so I need to compare two lists in Python and find the elements that aren't common between them. Let's see, how do ... |
sharegpt | [
{
"from": "human",
"value": "What is the code to generate random passwords in Python?"
},
{
"from": "gpt",
"value": "<think>\nOkay, I need to figure out how to generate a random password in Python. Let me start by recalling what a password typically requires. Usually, passwords should include a ... |
glaive | [
{
"from": "human",
"value": "You are tasked with developing a CMake script to handle the implicit dependencies for a project. The project involves multiple C language files, each with its corresponding object file, and you need to set up the include file search paths and target link information. Additionall... |
codefeedback | [
{
"from": "human",
"value": "Create an HTML page containing a text field and a button. When the button is clicked, validate the input in the text field to ensure it is a valid email address. If the input is not a valid email address, display an error message below the text field. Additionally, disable the b... |
evolcodegolf | [
{
"from": "human",
"value": "Your objective is to compute the n-th element of the sequence designated as A190810, utilizing the specified generation rules outlined below:\n\n1. The initial element is defined as 1.\n2. The sequence is characterized as strictly increasing.\n3. If a number x is present in the ... |
glaive | [
{
"from": "human",
"value": "You are working with a database in a Groovy application and need to retrieve specific information from the database using SQL queries. The information you need includes usernames, names of humans, names of groups, and email addresses. You also need to perform various operations ... |
sharegpt | [
{
"from": "human",
"value": "Is the TLB hierarchy inclusive on modern x86 CPUs like Skylake or other Lakes? Specifically, does the \"prefetchtn\" instruction bring data to the level cache n+1 and also create a corresponding TLB entry in the STLB?"
},
{
"from": "gpt",
"value": "<think>\nOkay, so ... |
glaive | [
{
"from": "human",
"value": "I am working on a web application that uses a MoviesDB.Core library and I need to initialize the IoC container using StructureMap. Can someone provide a code snippet on how to initialize the IoC container using StructureMap for the given context?"
},
{
"from": "gpt",
... |
dolphin | [
{
"from": "human",
"value": "port this code from Objective-C to Elixir:\n```objective-c\n- (NSInteger)findLucky:(NSArray<NSNumber *> *)arr {\n NSMutableDictionary *freq = [NSMutableDictionary dictionary];\n for (NSNumber *num in arr) {\n freq[num] = @([freq[num] integerValue] + 1);\n }\n ... |
dolphin | [
{
"from": "human",
"value": "Please explain the following problem in detail and provide code in Object Pascal:\nYou are given the `head` of a linked list with `n` nodes.\n\nFor each node in the list, find the value of the **next greater node**. That is, for each node, find the value of the first node that i... |
codefeedback | [
{
"from": "human",
"value": "Write a Python program that can interpret and translate a string to morse code and vice versa. Your program should be able to accept a string of words and translate it to morse code as well as accept a string of morse code and translate it back to alphanumeric characters. Your p... |
codefeedback | [
{
"from": "human",
"value": "You have been granted access to a public API about global environmental data: 'https://api.data.gov/environment/'. Write a JavaScript program to forecast the carbon footprint for the upcoming decade in any developing country and display the findings in a bar chart."
},
{
... |
glaive | [
{
"from": "human",
"value": "Can someone help me create a chess engine in C Language? I want to implement a program that can handle chess moves and visualize the current state of the board. Can you provide some guidance on how to get started?"
},
{
"from": "gpt",
"value": "<think>\nOkay, I need ... |
sharegpt | [
{
"from": "human",
"value": "How can I iterate through a specified list in descending order using a for loop? I want to start at the index of the last element and stop at the index of the first element. I have an array of data: `data_array = [1, 2, 3, 4, 5]`."
},
{
"from": "gpt",
"value": "<thin... |
evolcodegolf | [
{
"from": "human",
"value": "This inquiry represents the contrary of a previous one posed by James Williams.\n\nRövarspråket\nRövarspråket is an engaging word game traditionally enjoyed by Swedish children, notably depicted in the Kalle Blomkvist series authored by Astrid Lindgren. The fundamental encoding ... |
evolcodegolf | [
{
"from": "human",
"value": "Task \nGiven an integer m, determine the product of all prime numbers less than or equal to m. \nExamples \nm output \n------------- \n10 210 \n20 9699690 \n30 2310 \n\n\n\nMost efficient solution in terms of computational complexity wins"
},
{
"from... |
glaive | [
{
"from": "human",
"value": "You are tasked with creating a batch script for elaborating a compiled design using Xilinx Vivado Simulator. The script should include the necessary commands and options for the xelab tool. The script should also handle the exit status of the xelab command and print appropriate ... |
magicoder | [
{
"from": "human",
"value": "You are tasked with implementing a class for managing a tree structure. The class should have methods for adding child nodes and retrieving the path to a specific node.\n\nYou are given a partial code snippet for the tree node class:\n\n```python\nclass TreeNode:\n def __init... |
evolcodegolf | [
{
"from": "human",
"value": "In the extensive domain of competitive chess, numerous advancements have been documented, including the utilization of a standardized file format, .pgn, which encapsulates the intricate details of a chess match along with the sequential list of strategic moves. Furthermore, ther... |
dolphin | [
{
"from": "human",
"value": "port this code from Julia to R:\n```julia\nfunction kInversePairs(n::Int, k::Int)::Int\n mod = 10^9 + 7\n dp = zeros(Int, n+1, k+1)\n for i = 1:n\n dp[i,1] = 1\n for j = 2:k+1\n dp[i,j] = (dp[i,j-1] + dp[i-1,j]) % mod\n if j-i >= 0\n ... |
codefeedback | [
{
"from": "human",
"value": "You are tasked with creating a simple user authentication system using PHP. Your goal is to implement a User class that extends the Authenticatable class and utilizes the Notifiable trait for notifications. Additionally, you need to incorporate the Auth facade for user authentic... |
evolcodegolf | [
{
"from": "human",
"value": "In this intellectually stimulating challenge, you are tasked with developing a sophisticated computer program capable of constructing a vertically stacked arrangement of a thousand identical \\$1 \\times 1\\$ frictionless homogeneous blocks, ensuring that each block is sufficien... |
dolphin | [
{
"from": "human",
"value": "Please focus on the algorithm of this problem and provide code in F#:\nGiven an array of **distinct** integers `candidates` and a target integer `target`, return _a list of all **unique combinations** of_ `candidates` _where the chosen numbers sum to_ `target`_._ You may return ... |
dolphin | [
{
"from": "human",
"value": "translate this code to Dart:\n```vb.net\nFunction countDistinctSubsequences(s As String) As Integer\n Dim n As Integer = s.Length\n Dim mod_num As Integer = 1000000007\n Dim dp(n) As Integer\n Dim last(26) As Integer\n dp(0) = 1\n For i As Integer = 0 To n - 1\... |
sharegpt | [
{
"from": "human",
"value": "How can I modify the given Python function to include exception handling?"
},
{
"from": "gpt",
"value": "<think>\nOkay, so the user wants to modify a Python function to include exception handling. Hmm, first I need to figure out what the original function does, but t... |
dolphin | [
{
"from": "human",
"value": "translate this code to javascript:\n```python\ndef longestOnes(nums, k):\n left, right, max_ones, zero_count = 0, 0, 0, 0\n while right < len(nums):\n if nums[right] == 0:\n zero_count += 1\n while zero_count > k:\n if nums[left] == 0:\n... |
glaive | [
{
"from": "human",
"value": "You are tasked with creating a Racket program that utilizes the JSON library to perform various operations on JSON data. Your program should include the following functionalities:\n1. Define a procedure jsexpr? that performs a deep check to determine whether a given value is a j... |
magicoder | [
{
"from": "human",
"value": "You are tasked with implementing a function that processes an array of integers and returns a modified array based on the following rules:\n\n1. If the integer is a multiple of 3, replace it with the string \"Fizz\".\n2. If the integer is a multiple of 5, replace it with the str... |
glaive | [
{
"from": "human",
"value": "You are tasked with creating a program that generates an unsampled report in Google Analytics using the Analytics API. The program should be able to retrieve the unsampled report data and store it in either Google Drive or Google Cloud Storage, based on the user's preference. Th... |
codefeedback | [
{
"from": "human",
"value": "The challenge is titled: Swap Nodes in Pairs with Additional Constraints and Reverse Order. The task is as follows: Given a linked list, the requirement is to swap every two adjacent nodes and return the head of the modified list. However, there are additional constraints to con... |
evolcodegolf | [
{
"from": "human",
"value": "i.e each byte appears in a different ANSI shell colour and must ensure that any color changes respect the terminal's current text background color. \nRules\n\nResetting the color of the shell after output is not required \nMust be output in STDOUT or the primary colour text ou... |
sharegpt | [
{
"from": "human",
"value": "Using time series data about air passengers (which can be found at this URL: https://raw.githubusercontent.com/jbrownlee/Datasets/master/airline-passengers.csv), create a time series forecast model. This model should not only predict the number of passengers but also provide an ... |
glaive | [
{
"from": "human",
"value": "You are tasked with creating a Flutter widget finder that can locate specific widgets in a widget tree. The finder should be able to match various types of widgets based on different criteria. Your task is to create a finder that can locate widgets based on specific text content... |
codefeedback | [
{
"from": "human",
"value": "Write a SQL statement to join table1 and table2 on the \"name\" column, but also include only the rows where the \"age\" column in table1 is greater than 25."
},
{
"from": "gpt",
"value": "<think>\nOkay, let's see. The user wants a SQL statement that joins table1 and... |
dolphin | [
{
"from": "human",
"value": "translate this code to Go:\n```scala\nimport scala.collection.mutable.PriorityQueue\n\ndef minRefuelingStops(target: Int, startFuel: Int, stations: Array[Array[Int]]): Int = {\n var pos = 0\n var fuel = startFuel\n var stops = 0\n val pq = PriorityQueue.empty[Int]\n\n for (... |
evolcodegolf | [
{
"from": "human",
"value": "Imagine a unique scenario where you can only use topics from the 120 lesser-known Q&A platforms within the Stack Exchange network. Your task is to select one of these platforms and craft a script where every line of code is an anagram derived from the title of a different, activ... |
codefeedback | [
{
"from": "human",
"value": "Explain the difference between static and dynamic polymorphism in Python. Provide code examples to illustrate each concept."
},
{
"from": "gpt",
"value": "<think>\nOkay, I need to explain the difference between static and dynamic polymorphism in Python with code exam... |
magicoder | [
{
"from": "human",
"value": "You are given a Python code snippet that includes a decorator `@print_calls` and two functions `part2` and `load`. The `part2` function takes a graph as input and returns the shortest path length between nodes \"YOU\" and \"SAN\" in the graph, after converting the graph to an un... |
evolcodegolf | [
{
"from": "human",
"value": "As a musician seeking to deepen my understanding and application of polyrhythms, I require an advanced method for generating intricate polyrhythmic patterns. A polyrhythm is characterized by two events—such as taps or notes—occurring at distinct, regular intervals, and the frequ... |
codefeedback | [
{
"from": "human",
"value": "I'd like this translated to Perl:\nimport pandas as pd\n from sklearn.model_selection import train_test_split\n from transformers import AutoTokenizer\n\n def preprocess_data(filename):\n # load the data\n df = pd.read_csv(filename, delimiter='\\t')\n ... |
evolcodegolf | [
{
"from": "human",
"value": "Let's define a function on natural numbers \\$n\\$, expressed as base 10 digits \\$d_k\\; d_{k-1}\\; \\dotsc\\; d_1\\; d_0\\$, as follows:\nAs long as there are equal adjacent digits \\$d_i\\;d_{i-1}\\$, replace them by their sum \\$d_i+d_{i-1}\\$ from left to right. If there we... |
sharegpt | [
{
"from": "human",
"value": "How can I generate a list that contains all integers within two given ranges?"
},
{
"from": "gpt",
"value": "<think>\nOkay, so I need to generate a list of all integers between two given ranges. Let me think about how to approach this. Hmm, the user probably has two ... |
magicoder | [
{
"from": "human",
"value": "You are tasked with implementing a simple key-value store in Rust. The key-value store should allow users to set and get values associated with keys. Additionally, the key-value store should support the ability to set a default value for a specific key if no value has been expli... |
evolcodegolf | [
{
"from": "human",
"value": "Transform a string of alphanumeric characters into their hexadecimal representations, each formatted as a 2-digit code separated by a specified delimiter. \n\nFor instance:\nHello, world!\n\nShould be converted to:\n48 65 6C 6C 6F 2C 20 77 6F 72 6C 64 21\n\nEnsure that the outpu... |
codefeedback | [
{
"from": "human",
"value": "You are tasked with creating a Python function that manages the creation of directories for machine learning model storage. The function should take in the name of the model and create a new directory for that model within the specified directory. If a directory with the same na... |
dolphin | [
{
"from": "human",
"value": "port this code from Perl to R:\n```perl\npackage TreeNode;\n\nsub new {\n my ($class, $val, $left, $right) = @_;\n my $self = {};\n $self->{val} = $val;\n $self->{left} = $left;\n $self->{right} = $right;\n bless($self, $class);\n return $self;\n}\n\nsub val... |
codefeedback | [
{
"from": "human",
"value": "Write a function that takes a date and time in the format \"YYYY-MM-DD HH:MM:SS\" and converts it to the format \"DD-MM-YYYY HH:MM\". Additionally, handle any potential errors that may occur during the conversion process.\n\nIn addition to the previous requirements, your solutio... |
glaive | [
{
"from": "human",
"value": "I need to create a function in Clojure that takes a string as input and returns a URL-encoded version of that string. The URL-encoded version should replace spaces with \"%20\" and handle any special characters appropriately. I want to ensure that the function is able to handle ... |
evolcodegolf | [
{
"from": "human",
"value": "In this problem, the objective is to ascertain whether a run ascending list can be constructed from a specified set of positive integers. This task initially considered code-golf solutions, which often yield inefficient results. To enhance performance, the challenge now requires... |
magicoder | [
{
"from": "human",
"value": "You are tasked with creating a Python function that processes a given SQL query and returns the block number from the result set. The function should use the `google-cloud-bigquery` library to execute the query and retrieve the block number from the result.\n\nThe function signa... |
glaive | [
{
"from": "human",
"value": "You are tasked with creating a command file for Sphinx documentation. Your task is to write a script that takes in a command line argument and performs the corresponding action. The script should be able to handle the following commands: \n- html: to make standalone HTML files\n... |
glaive | [
{
"from": "human",
"value": "After reading [this post](https://stackoverflow.com/questions/31518130/go-lang-error-using-regex), I know I need to use a backquotes ( ` ) to wrap my regex pattern. Now I have a regex pattern `/^(?=^.{8,}$)(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?!.*\\s)[0-9a-zA-Z!@#$%^&*()]*$/` to chec... |
codefeedback | [
{
"from": "human",
"value": "You are tasked with implementing a Python class for a statistical model used in genetics research. The class, named `GeneticModel`, is responsible for calculating and storing various parameters related to genetic analysis. The class has the following attributes and methods:\n\nA... |
sharegpt | [
{
"from": "human",
"value": "Refactor and optimize the given Python function, which aims at finding the minimum value from a provided array, to ensure it embodies a more succinct and performance-efficient form.\ndef find_min(arr):\n min_val = float('inf')\n for i in arr:\n if i < min_val:\n min_val = i\n re... |
dolphin | [
{
"from": "human",
"value": "convert this code from Fortran to Scheme:\n```fortran\nfunction searchMatrix(matrix, target) result(found)\n integer, intent(in) :: matrix(:,:)\n integer, intent(in) :: target\n logical :: found\n integer :: m, n, l, r, mid, mid_val\n \n m = size(matrix, 1)\n ... |
magicoder | [
{
"from": "human",
"value": "You are tasked with implementing a Python class that simulates a simple stack data structure. The stack should support the following operations:\n1. `push(item)`: Add an item to the top of the stack.\n2. `pop()`: Remove and return the item at the top of the stack. If the stack i... |
codefeedback | [
{
"from": "human",
"value": "Write a Python program to create a dictionary with five elements. Each element should have a key-value pair, where the key is a string and the value is a list of integers. However, each integer in the list should be a prime number."
},
{
"from": "gpt",
"value": "<thi... |
magicoder | [
{
"from": "human",
"value": "You are tasked with creating a program that reads a PDF file and extracts specific information from it. The PDF file contains a list of products with their names, prices, and quantities. Your program needs to extract this information and calculate the total value of the products... |
glaive | [
{
"from": "human",
"value": "You are tasked with creating a program that takes in user input for the color and then displays the color on the screen using OpenGL. You need to write a function that sets the fragment color to the input color."
},
{
"from": "gpt",
"value": "<think>\nOkay, so I need... |
evolcodegolf | [
{
"from": "human",
"value": "Create a function that takes a sequence of natural numbers and computes a value based on a non-standard encoding of these numbers into a different numerical base. The goal is to construct a function \\$\\mathbb{N}^n \\to \\mathbb{N}\\$, where \\$n\\$ is a positive integer of you... |
codefeedback | [
{
"from": "human",
"value": "Create a web application that allows users to input a paragraph of text in English and convert it into a non-Latin script randomly chosen from a set of five options (e.g., Chinese, Arabic, Devanagari, Thai, and Hebrew) each time the conversion button is clicked. The converted te... |
magicoder | [
{
"from": "human",
"value": "You are tasked with creating a Rust function that loads Gitlab configuration from environment variables and returns a `GitlabConfig` struct. The `GitlabConfig` struct has two fields: `token` and `api_url`. Your task is to complete the implementation of the `load_from_env` functi... |
codefeedback | [
{
"from": "human",
"value": "You are tasked with implementing a Python function that calculates the average of a given list of numbers, excluding the maximum and minimum values. The function should take a list of numbers as input and return the average of the remaining values. You should also write a helper... |
sharegpt | [
{
"from": "human",
"value": "Below you're given a dictionary of users sorted by their last names in ascending alphabetical order. Your task is to write a Python program to sort these users in reverse alphabetical order by their last names. In addition, when last names are identical, sort them in ascending o... |
codefeedback | [
{
"from": "human",
"value": "You are tasked with implementing a custom JSON deserialization method in C#. The method should take a JSON token, a property name, and a parameter type, and return the deserialized value of the specified property as an object of the given parameter type. The deserialization shou... |
glaive | [
{
"from": "human",
"value": "I am trying to find a way to automatically detect and display outdated packages in a dependencies file. The goal is to create a method that can identify any outdated packages and then print out a list of the outdated packages along with their old and new versions.\n\nCan anyone ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.