source stringclasses 6
values | conversations listlengths 2 2 |
|---|---|
dolphin | [
{
"from": "human",
"value": "translate this code from Julia to javascript:\n```julia\nusing StatsBase\n\nfunction largest_connected_component(nums::Array{Int,1})\n graph = Dict()\n for i in 1:length(nums)\n graph[nums[i]] = Set()\n for j in i+1:length(nums)\n if gcd(nums[i], n... |
codefeedback | [
{
"from": "human",
"value": "Construct a SQL query to retrieve all records in a table whose salary is greater than 50,000 and whose job title is \"Manager\". Additionally, the query should return the average salary of all records that meet the initial conditions."
},
{
"from": "gpt",
"value": "<... |
sharegpt | [
{
"from": "human",
"value": "Given the dataset located at https://raw.githubusercontent.com/Keystone-Strategy/coding_exercise_data/master/msas.csv, write a program that not only arranges the videogames in decreasing order of their user ratings, but also calculate average user ratings based on the game genre... |
codefeedback | [
{
"from": "human",
"value": "Two autonomous ships depart from the same port at the same time. One navigates northwest with a fluctuating, but known, speed that varies based on a given function f(t) = t^2 - t + 20 in km/h, where 't' denotes time in hours. The other steers southeast with a varying speed descr... |
codefeedback | [
{
"from": "human",
"value": "Develop a JavaScript form that accepts international phone numbers as input and not just local ones. The form should be capable of recognizing and validating the country code and the format of the input. Upon successful validation, it should display a \"Success\" message and the... |
evolcodegolf | [
{
"from": "human",
"value": "How can we succinctly express the function \n\ng(x,y)(m,n)=(x*m,y*n) \n\nin point-free style? \n\nUsing pointfree.io, we find a representation like \nuncurry (flip (flip (.) (*) . (ap .) . flip (flip (.) (.) (flip fst) . (. (*) ) . flip . (((.) . (,)) .) . (*)). \n\nWith some re... |
codefeedback | [
{
"from": "human",
"value": "Write a recursive function in Java that prints out the even integers from 2 to a given number in increasing order, without using any loops. The recursive function must also identify if a number is prime or not, then print a message stating whether the number is prime with each i... |
glaive | [
{
"from": "human",
"value": "How can I write a Python function that calculates the factorial of a number recursively, and then modify the function to return the product of the factorial and the sum of the digits in the number?\n\nHere is the provided code that calculates the factorial of a number recursivel... |
sharegpt | [
{
"from": "human",
"value": "What is the code to find the longest string among two given strings in Python?"
},
{
"from": "gpt",
"value": "<think>\nOkay, so I need to figure out how to write Python code that finds the longest string between two given strings. Hmm, let's start by thinking about w... |
codefeedback | [
{
"from": "human",
"value": "I have this problem : Single Element in a Sorted Array with a Twist\nDescription are as below: You are given a sorted array consisting of only integers where every element appears exactly twice, except for one element which appears exactly once. Find this single element that app... |
sharegpt | [
{
"from": "human",
"value": "Create a GraphQL query to get the list of products from a database, including their ID, name, price, and any related categories. Make sure your query can handle pagination with parameters for a limit and an offset. Additionally, provide a sample erroneous GraphQL query that demo... |
evolcodegolf | [
{
"from": "human",
"value": "Mr. Mackey is a South Park character well-known for adding \"m'kay\" in everything he says. Write a program or function that transforms a string of text into something Mr. Mackey would say, ensuring that the output maintains the same length as the input. \n\nM'kay placement\n\nm... |
sharegpt | [
{
"from": "human",
"value": "Can you provide a Python code to sort a given list in ascending order?"
},
{
"from": "gpt",
"value": "<think>\nOkay, I need to write a Python code that sorts a list in ascending order. Let's think about how to approach this. The user probably wants a simple and effic... |
codefeedback | [
{
"from": "human",
"value": "Embark on a comprehensive exploration of the MergeSort algorithm, a prevalent sorting technique that employs the divide-and-conquer paradigm. In your elaborate elucidation, demystify the intricate stages of partitioning, recursive amalgamation, and unification. Furthermore, unde... |
glaive | [
{
"from": "human",
"value": "You are tasked with writing a module in the ListN programming language that creates a list of integers and then modifies one of the elements. The module should then iterate through the list and display each element. Your task is to write the code for the module that achieves thi... |
magicoder | [
{
"from": "human",
"value": "You are given a Python class representing a custom binary number. The class has three methods: `__init__`, `__repr__`, and `__str__`. The `__init__` method initializes the binary number, the `__repr__` method returns the binary representation of the number, and the `__str__` met... |
sharegpt | [
{
"from": "human",
"value": "Design a Python function that not only connects to an AWS Redshift cluster using psycopg2 but also implements transaction control and error handling mechanisms. This function should execute multifaceted SQL queries for data manipulation and analysis."
},
{
"from": "gpt",... |
evolcodegolf | [
{
"from": "human",
"value": "Construct a function that, given a string comprised solely of the characters ()[]{}, outputs the paired brackets in the same sequence as their initial appearance within the string. It is important to note that any opening bracket from the set ([{ can be matched with any correspo... |
sharegpt | [
{
"from": "human",
"value": "I need help with a Python function that checks if a string is a palindrome and also counts the occurrence of each character in the palindrome. Can you provide me with a solution? I want the function to give different responses based on whether the palindrome has an even or odd n... |
magicoder | [
{
"from": "human",
"value": "You are tasked with creating a TypeScript function that processes an array of JavaScript library mixins and returns a new array containing the names of the mixins. Each mixin is represented as an object with a `name` property.\n\nYou are given the following TypeScript code snipp... |
sharegpt | [
{
"from": "human",
"value": "I have come across some articles discussing the issue of helpers within an engine not being accessible to the consuming application. Here is an example of the code structure:\n\n```ruby\nmodule MyEngine\n module ImportantHelper\n def some_important_helper\n ...do someth... |
codefeedback | [
{
"from": "human",
"value": "You are tasked with implementing a class that represents a trading session and overloading the equality operator for comparing instances of this class. The trading session can be of two extents: \"Day\" or \"Week\". The equality comparison should consider both the extent and the... |
evolcodegolf | [
{
"from": "human",
"value": "You are presented with a \\$3\\times3\\$ square matrix where each cell contains a digit ranging from \\$0\\$ to \\$9\\$ excluding \\$7\\$. Your objective is to determine the minimum quantity of digits that necessitate replacement with \\$7\\$'s so that the total sums of digits i... |
magicoder | [
{
"from": "human",
"value": "You are tasked with implementing a custom collection class in Java that supports adding, removing, and retrieving elements. The collection should also provide a method to return the number of elements it contains. Additionally, you need to ensure that the collection can only sto... |
magicoder | [
{
"from": "human",
"value": "You are tasked with creating a command-line interface for a chatbot using Python's `asyncio` library. The chatbot has a predefined list of commands and their corresponding categories. Your goal is to implement a function that processes user input and provides appropriate respons... |
sharegpt | [
{
"from": "human",
"value": "I want to build an application feature that can recognize handwritten numbers using TensorFlow. Can you provide me with a code example to accomplish this?"
},
{
"from": "gpt",
"value": "<think>\nOkay, the user wants to build a handwritten number recognition feature u... |
magicoder | [
{
"from": "human",
"value": "You are tasked with simulating a smart home device that controls the charging of a battery using a Raspberry Pi and Python. The device is connected to a relay module, and its behavior is determined by the state of the battery. If the battery is full, the relay should be activate... |
codefeedback | [
{
"from": "human",
"value": "Create a SQL query that pulls the top 5 products by revenue for each category. Additionally, provide a breakdown of the revenue by region. The query should also handle cases where there are less than 5 products in a category."
},
{
"from": "gpt",
"value": "<think>\nO... |
evolcodegolf | [
{
"from": "human",
"value": "I want to format a JSON string into a human-readable form while ensuring that the output follows specific indentation and spacing conventions. A string like this:\n'{\"foo\":\"hello\",\"bar\":\"world\",\"c\":[1,55,\"bye\"]}'\n\nwould be formatted as:\n{\n \"foo\": \"hello\",\n ... |
glaive | [
{
"from": "human",
"value": "You are tasked with creating an XML configuration file for a language module. The configuration file should define the language namespace, UUID, language version, and module version. It should also include models, generators, dependencies, and language versions. Your task is to ... |
glaive | [
{
"from": "human",
"value": "How can I extract the name of a customer from a JSON record using Python?"
},
{
"from": "gpt",
"value": "<think>\nOkay, so I need to extract a customer's name from a JSON record using Python. Let me think about how to approach this. First, I remember that JSON data i... |
sharegpt | [
{
"from": "human",
"value": "Can you provide a Python function that I can use to convert a telephone number into its numerical representation?"
},
{
"from": "gpt",
"value": "<think>\nOkay, the user wants a Python function to convert a telephone number into its numerical representation. Let me th... |
dolphin | [
{
"from": "human",
"value": "convert this code to Erlang:\n```R\nMAX_ALTERNATING_SUM <- function(nums) {\n total_sum <- 0\n max_sum <- -Inf\n min_sum <- Inf\n n <- length(nums)\n for (i in 1:n) {\n total_sum <- total_sum + nums[i]\n if (i %% 2 == 1) {\n max_sum <- max(max_sum, -nums[i])\n ... |
glaive | [
{
"from": "human",
"value": "You are tasked with implementing a fast histogramming function in CUDA. The function should be able to efficiently count the occurrences of symbols in an input array and update a histogram accordingly.\n\nThe input to the function will be an array of input data, along with the s... |
evolcodegolf | [
{
"from": "human",
"value": "For each non-negative integer n, please provide the minimal power of 2 that contains two identical substrings of n digits when expressed in decimal format, along with the respective starting indices of these substrings in a zero-based manner.\n\nn Output Proof (don't o... |
glaive | [
{
"from": "human",
"value": "You are working on a project where you need to access Visual Studio or other hosts from a text template. You need to use the methods and properties exposed by the host running the template, such as Visual Studio. In a text template, you want to be able to resolve file names, dis... |
evolcodegolf | [
{
"from": "human",
"value": "Context:\n\nYou are a cryptographer. You have stumbled upon a mysterious group of individuals, who present you with a challenge, which you must solve in order to join their secret society.\n\nDescription:\n\nYou have been given a binary stream consisting of 3 byte sequences that... |
magicoder | [
{
"from": "human",
"value": "You are tasked with implementing a set data structure in Python without using the built-in set data type. Your set should support the following operations:\n1. `add(element)`: Add the element to the set if it is not already present.\n2. `remove(element)`: Remove the element from... |
sharegpt | [
{
"from": "human",
"value": "Can you provide a regular expression pattern to identify URLs in a given text?"
},
{
"from": "gpt",
"value": "<think>\nOkay, the user is asking for a regular expression to identify URLs in text. Let me start by recalling what components a URL can have.\n\nFirst, the ... |
magicoder | [
{
"from": "human",
"value": "You are tasked with implementing a Python class that represents a computer peripheral device. The class should have the ability to track the status of various fields, such as pointing device and headphones. Additionally, the class should provide methods to update and retrieve th... |
sharegpt | [
{
"from": "human",
"value": "I want to create a Python program that can check if two given strings are anagrams. Can someone help me with the code?"
},
{
"from": "gpt",
"value": "<think>\nOkay, I need to create a Python program that checks if two strings are anagrams. Hmm, anagrams are words for... |
codefeedback | [
{
"from": "human",
"value": "Refine the provided C++ code such that it executes with increased efficiency while outputting the first 50 numbers of the Fibonacci sequence. \n#include <iostream>\n\nusing namespace std;\n\nint main () \n{ \n int n = 50;\n unsigned long long f[n+1]; \n \n f[0]=0; \n ... |
magicoder | [
{
"from": "human",
"value": "You are tasked with creating a custom authentication strategy for a Node.js application using the NestJS framework. The application uses JSON Web Tokens (JWT) for authentication and authorization. Your goal is to implement a JwtStrategy class that extends the PassportStrategy cl... |
sharegpt | [
{
"from": "human",
"value": "I have a validation in my Rails model that checks for the presence and length of a body attribute. However, I want to also validate that the text is not just filled with spaces or non-visible characters. How can I modify my validation to achieve this?\n\n```ruby\nvalidates :body... |
magicoder | [
{
"from": "human",
"value": "You are tasked with implementing a simple expression evaluator for a custom programming language. The language supports basic arithmetic operations and parentheses for grouping. Your task is to write a function that takes a string representing an arithmetic expression and return... |
glaive | [
{
"from": "human",
"value": "You are tasked with creating a web page that displays information about sold products. The page should include the total number of products sold and the number of products sold today. It should also have the functionality to add a new product and a search feature to filter the d... |
dolphin | [
{
"from": "human",
"value": "Please write the following solution using Scheme:\nGiven an integer `columnNumber`, return _its corresponding column title as it appears in an Excel sheet_.\n\nFor example:\n\nA -> 1\nB -> 2\nC -> 3\n...\nZ -> 26\nAA -> 27\nAB -> 28 \n...\n\n**Example 1:**\n\n**Input:** columnNu... |
codefeedback | [
{
"from": "human",
"value": "Devise a function in C language that not only interchanges the values of dual integer pointers, but also performs bitwise operations on them. The function should also consider situations where one or both of the integers are zero. Let the integers be pointers '*p' and '*q', init... |
dolphin | [
{
"from": "human",
"value": "port this code from C# to Perl:\n```csharp\nusing System.Collections.Generic;\n\npublic class Solution {\n public int ShortestPathBinaryMatrix(int[][] grid) {\n int n = grid.Length;\n if (grid[0][0] == 1 || grid[n - 1][n - 1] == 1) return -1;\n\n int[][] ... |
evolcodegolf | [
{
"from": "human",
"value": "The challenge \nHow effectively can you manipulate the electoral boundaries of North Carolina into 13 voting districts while adhering to the principles of gerrymandering? \nIn this intricate task, you will utilize the provided datasets to create distinct maps favoring the Repu... |
evolcodegolf | [
{
"from": "human",
"value": "The Challenge \nConsider the intricate 3x3 king grid, represented in the subsequent ASCII graphic: \nA--B--C \n|\\/|\\/| \n|/\\|/\\| \nD--E--F \n|\\/|\\/| \n|/\\|/\\| \nG--H--I \n \nYou are provided with a length-9 list of integers that correspond to a labeling of the ... |
magicoder | [
{
"from": "human",
"value": "You are tasked with creating a web application that manages columns in a database. The given code snippet is a part of the HTML table that displays the columns' information and provides options to edit or delete a column. Your task is to implement the functionality for editing a... |
glaive | [
{
"from": "human",
"value": "I am working with time series data and want to perform predictive analysis using the R programming language. I need to create a model to forecast future values based on the historical data. Can someone provide a solution to create an autoregressive integrated moving average (ARI... |
glaive | [
{
"from": "human",
"value": "How can I design an API in Node.js to retrieve the weather and forecast for a specific city?"
},
{
"from": "gpt",
"value": "<think>\nOkay, I need to design a Node.js API that retrieves weather and forecast data for a specific city. Let me start by breaking down what ... |
magicoder | [
{
"from": "human",
"value": "You are tasked with creating a function to distribute parts of a table to different servers while ensuring that the part sizes are balanced. Each part of the table is represented by a list of files, and the goal is to distribute these parts across two servers in a balanced manne... |
codefeedback | [
{
"from": "human",
"value": "Write a function in JavaScript to check if the given string contains at least three consecutive vowels, which must be followed by two or more consecutive consonants, or not."
},
{
"from": "gpt",
"value": "<think>\nOkay, I need to write a JavaScript function that chec... |
codefeedback | [
{
"from": "human",
"value": "Which sorting algorithm would be the most efficient to use for a nearly sorted array of 1,000,000 elements, taking into account time complexity and computational resources? Can you justify your answer mathematically?"
},
{
"from": "gpt",
"value": "<think>\nOkay, so I... |
codefeedback | [
{
"from": "human",
"value": "Three types of investments are available, yielding annual returns of 7%, 9%, and 11% respectively. If a total of $10,000 is invested, and the yield after a year is $930, write a program to determine how much was invested in each option. To further complicate the problem, include... |
dolphin | [
{
"from": "human",
"value": "port this code from python to Perl:\n```python\ndef min_changes(nums1, nums2, k):\n n = len(nums1)\n operations = 0\n for i in range(n):\n diff = abs(nums1[i] - nums2[i])\n if diff % k != 0:\n return -1\n operations += diff // k\n retu... |
codefeedback | [
{
"from": "human",
"value": "Write a code that generates a random password of 12 characters including at least two uppercase letters, two lowercase letters, two numerical digits, and two special characters. The password should not contain any repeating characters."
},
{
"from": "gpt",
"value": "... |
glaive | [
{
"from": "human",
"value": "I need to create an XSLT style sheet that will allow me to modify various subsystems and their parameters based on certain conditions. The style sheet needs to have the ability to modify the behavior of different subsystems, such as logging, threads, datasources, security, and e... |
evolcodegolf | [
{
"from": "human",
"value": "Picolisp incorporates an advanced functionality known as \"super parentheses\":\n\nBrackets ('[' and ']') serve as super parentheses, where a closing bracket corresponds to [all parentheses up to and including] the closest preceding opening bracket, or [if there are no outstandi... |
sharegpt | [
{
"from": "human",
"value": "Tabulate and enumerate the quantity of each unique word represented in the following passage of text. This is a sample text"
},
{
"from": "gpt",
"value": "<think>\nOkay, I need to figure out how to tabulate and enumerate each unique word in the given passage. Let me ... |
sharegpt | [
{
"from": "human",
"value": "What is a function that finds the first n Fibonacci numbers in Python?"
},
{
"from": "gpt",
"value": "<think>\nOkay, so I need to write a Python function that finds the first n Fibonacci numbers. Hmm, let me think about how Fibonacci numbers work. The sequence starts... |
codefeedback | [
{
"from": "human",
"value": "Construct an algorithm to check if two strings have the same characters and same frequency of characters. However, in addition to comparing the characters and their frequencies, you should also consider the case sensitivity of the characters. Furthermore, the algorithm should al... |
glaive | [
{
"from": "human",
"value": "You are required to implement a warp-level GEMM (General Matrix Multiply) operator given the fundamental instruction shape (8x8x4), overall shape, data type of each operand, and layout of each operand. The goal is to perform a collective GEMM operation by a warp on arbitrary mat... |
evolcodegolf | [
{
"from": "human",
"value": "As you are undoubtedly aware, the World Cup group stage has concluded, and starting tomorrow, the top 16 teams will embark on the knockout stage:\n\nBrazil (BRA) \nMexico (MEX) \nNetherlands (NED) \nChile (CHI) \nColombia (COL) \nGreece (GRE) \nCosta Rica (CRC) \nUruguay ... |
glaive | [
{
"from": "human",
"value": "You are tasked with creating a script to retrieve and display information about AspNetPageLoadViewstateEnter from a Windows Management Instrumentation (WMI) namespace. The script should be able to connect to a remote computer and gather the required data. You should display the ... |
magicoder | [
{
"from": "human",
"value": "You are tasked with creating a Python function that processes a given string to extract specific substrings based on predefined patterns using regular expressions.\n\nYou need to implement a function `extract_substrings` that takes in a string `input_string` and a list of patter... |
glaive | [
{
"from": "human",
"value": "You are tasked with implementing a new instance of the GetPickingListResponse class in the Microsoft.Dynamics.Commerce.Runtime.Messages namespace. The class should have a constructor that initializes the new instance of GetPickingListResponse.\n\nWrite the code for the construct... |
evolcodegolf | [
{
"from": "human",
"value": "Introduction \nAron Nimzowitsch was a prominent chess master and a significant chess writer whose contributions are widely recognized. In his seminal work 'My System', the initial chapter emphasizes the critical importance of controlling the center of the board and provides com... |
magicoder | [
{
"from": "human",
"value": "You are tasked with implementing a function to efficiently copy a portion of an image from a source buffer to a destination buffer. The source image is represented by the `src` object, which contains configuration information such as horizontal and vertical resolutions. The dest... |
magicoder | [
{
"from": "human",
"value": "You are tasked with implementing a function that processes incoming messages based on their type. The function should handle two specific message types: `Disconnect` and `OutboundCommand`. For the `Disconnect` message type, the function should call a method `disconnect` on a sin... |
glaive | [
{
"from": "human",
"value": "How can I create a Recurrent Belief Network (RBN) using TensorFlow?"
},
{
"from": "gpt",
"value": "<think>\nOkay, the user wants to create a Recurrent Belief Network (RBN) using TensorFlow. Hmm, first I need to recall what an RBN is. From what I remember, RBNs are a ... |
evolcodegolf | [
{
"from": "human",
"value": "Given a specified integer, formulate a succinct expression that derives it from zero through the application of unary negation (-) and the bitwise complement operator (~), with a right-to-left evaluation order applied to these operators. \n\n...\n-3 = ~-~-~0\n-2 = ~-~0\n-1 = ... |
dolphin | [
{
"from": "human",
"value": "translate this code to Rust:\n```kotlin\nfun maxProfit(prices: IntArray): Int {\n var buy1 = Int.MAX_VALUE\n var buy2 = Int.MAX_VALUE\n var profit1 = 0\n var profit2 = 0\n\n for (price in prices) {\n buy1 = minOf(buy1, price)\n profit1 = maxOf(profit... |
sharegpt | [
{
"from": "human",
"value": "Refine the provided programming test question:\n\nFine-tune the following code:\n\ndef weighted_avg_custom_base(n, m, base, d):\n \"\"\"\n You've been handed three integral positive values n, m, and d (n <= m; 1 <= d <= m-n+1). The requirement is to calculate the\n weig... |
glaive | [
{
"from": "human",
"value": "You are tasked with writing a program to find the number of palindromes in base 9 that are below a given power of 9. A palindrome is a number that reads the same forwards and backwards. For example, 121 is a palindrome in base 10. Your program should take an integer n as input a... |
evolcodegolf | [
{
"from": "human",
"value": "The Challenge \nYour task is to create a program that takes any given string input, and outputs the input in a squared format, ensuring that the diagonal elements of the output are reflected in reverse order of the original string. Empty strings should return an empty string. ... |
magicoder | [
{
"from": "human",
"value": "You are tasked with creating a simple simulation program for a virtual world using the PyAFai library. The PyAFai library provides functionalities for creating agents, shapes, and running simulations in a virtual environment. Your goal is to implement a program that creates a sh... |
glaive | [
{
"from": "human",
"value": "You are tasked with creating a Git workflow command called \"git-popb\" that will allow users to pop multiple commits from the branch stack.\n\nYour task is to write the code for the \"git-popb\" command, which should have the following features:\n\n- The command should be able ... |
dolphin | [
{
"from": "human",
"value": "Please focus on the efficiency of this problem and provide code in Scheme:\nImplement the `myAtoi(string s)` function, which converts a string to a 32-bit signed integer (similar to C/C++'s `atoi` function).\n\nThe algorithm for `myAtoi(string s)` is as follows:\n\n1. Read in a... |
sharegpt | [
{
"from": "human",
"value": "I am analyzing the following ASM code in OllyDbg, and I suspect that it contains a structure developed in C. Can someone please help me understand how the structure looks like in the C programming language? Additionally, could you provide an explanation of how you determined the... |
codefeedback | [
{
"from": "human",
"value": "Create a GraphQL endpoint for a given database.\nDatabase — users.sqlite"
},
{
"from": "gpt",
"value": "<think>\nOkay, I need to create a GraphQL endpoint for a SQLite database called users.sqlite. Let me think about how to approach this.\n\nFirst, I should check wha... |
evolcodegolf | [
{
"from": "human",
"value": "Engage in a Competitive Round of Kick The Can! \nWhile Moogie currently holds the title of champion, any player who dares to challenge him is wholeheartedly invited to seize the opportunity. Kick the can is not merely a children's pastime; it is transformed into a sophisticated... |
glaive | [
{
"from": "human",
"value": "You are tasked with creating a program that calculates the probability of a quantum state. The amplitude of the state is given by the function `amplitude[x_,y_]` and `amplitude2[x_,y_]`. The probability of the state is given by the function `probability[x, y]`, which calculates ... |
magicoder | [
{
"from": "human",
"value": "You are tasked with implementing a function that inserts or updates a batch of rows in a database. The function should handle the scenario where an exception is raised and should also return the row count after the operation. You are given a code snippet from a unit test that ai... |
evolcodegolf | [
{
"from": "human",
"value": "A number is classified as abundant when the total of its proper divisors exceeds the number itself. For illustration, the proper divisors of 12 include:\n1, 2, 3, 4, 6\n\nWhen summed, these yield 16. As 16 exceeds 12, we categorize 12 as abundant. It is crucial to note that \"Pe... |
codefeedback | [
{
"from": "human",
"value": "Can you illustrate the procedure of formulating a Python script capable of transposing the subsequently listed dictionary into a syntactically precise JSON format?\nThe dictionary is: {\"name\": \"John\", \"age\": 30, \"city\": \"New York\"}"
},
{
"from": "gpt",
"val... |
glaive | [
{
"from": "human",
"value": "You are tasked with creating a GraphQL client to interact with a server that exposes a series of queries and mutations to manage a todo list. The server is hosted at a given URL and the GraphQL schema is generated using gqlgen. You need to implement the following functionality i... |
magicoder | [
{
"from": "human",
"value": "You are tasked with implementing a function to calculate the area of an oriented bounding box in a 2D space. An oriented bounding box is a rectangle that is not necessarily aligned with the x and y axes. The bounding box is defined by its center point and two half-lengths along ... |
sharegpt | [
{
"from": "human",
"value": "I have noticed that these two code snippets perform the same task of adding two float arrays together and storing the result back into them. However, when I measured the execution time, I found that the inline assembler code takes approximately 10 times longer in Release mode co... |
glaive | [
{
"from": "human",
"value": "You are tasked with implementing a shader program using OpenGL ES version 300. The program should include various features such as lighting, bone and weight attributes, morphing, shadow projection, and occlusion. The given code snippet provides the basic structure for the shader... |
codefeedback | [
{
"from": "human",
"value": "Create a function which takes two strings as parameters and return the concatenating of the two strings. Additionally, check if either of the input strings is empty and handle it accordingly by returning an error message. If both strings are not empty, convert the first string t... |
glaive | [
{
"from": "human",
"value": "You are tasked with creating a function that takes a type and performs deep skolemisation on it. Deep skolemisation decomposes and skolemises a type, returning a type with all its arrows visible (i.e., not buried under foralls). The function should return a tuple containing a wr... |
codefeedback | [
{
"from": "human",
"value": "Increase the difficulty level of this code-based examination question:\n\nYou are to amend the given code, such that it incorporates the consideration of unique expiry dates for each individual fruit. Such dates shall be stored within a distinct dictionary.\n\ndef fruit_distribu... |
glaive | [
{
"from": "human",
"value": "I am working on a web application using the IWFrame3 framework, and I need to create a modal window with specific regions for header, body, footer, and title. Additionally, I need to include input fields, a select dropdown, and buttons within the modal body. \n\nCan someone prov... |
magicoder | [
{
"from": "human",
"value": "You are given a series of assembly-like instructions that operate on different types of data. Each instruction is represented by a mnemonic followed by the source and destination operands. The operands are represented by their data type (e.g., r for register, a for array, f for ... |
glaive | [
{
"from": "human",
"value": "I am using PyTorch 1.3.1 with Python 3.7 and trying to load two different datasets for training. I successfully created data_loaders separately and trained on them sequentially. However, I want to combine them into a single dataloader object. When I implement this as per the PyT... |
sharegpt | [
{
"from": "human",
"value": "Can you help me generate a random password that consists of 8 characters, including uppercase and lowercase letters as well as digits?"
},
{
"from": "gpt",
"value": "<think>\nOkay, the user wants a random password with 8 characters, including uppercase, lowercase let... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.