source stringclasses 6
values | conversations listlengths 2 2 |
|---|---|
sharegpt | [
{
"from": "human",
"value": "Given a collection of integers, write a code to sort the integers in ascending order. However, you are not allowed to use any built-in sorting functions or libraries.\n\narr = [5, 7, 3, 8, 10]"
},
{
"from": "gpt",
"value": "<think>\nOkay, I need to sort this array wi... |
codefeedback | [
{
"from": "human",
"value": "Determine the maximum sum of a subarray within the given array, but with the constraint that the subarray must contain at least three elements. Additionally, the array may contain negative numbers."
},
{
"from": "gpt",
"value": "<think>\nOkay, so I need to find the m... |
glaive | [
{
"from": "human",
"value": "You are tasked with creating an XSL stylesheet to define attribute sets for substeps in a document. The attribute sets must include specific formatting properties such as space-after, space-before, and margin-left. Additionally, the substeps.substep attribute set should have its... |
dolphin | [
{
"from": "human",
"value": "convert this code from Lua to Swift:\n```lua\nfunction solve_equation(equation)\n local coef, val, left, operate = 0, 0, 0, 0\n equation = equation .. \"+\"\n local parts = {}\n for part in equation:gmatch(\"([^+-]+)\") do\n table.insert(parts, part)\n end\... |
evolcodegolf | [
{
"from": "human",
"value": "This particular undertaking constitutes a nuanced variant of a Code Golf challenge. Instead of merely striving to align with input and output formats, the objective is to conform to a specified interface.\n\n**Context**\nFinite state machines (FSMs) serve as critical design para... |
magicoder | [
{
"from": "human",
"value": "You are tasked with creating a Flutter plugin for macOS that integrates with the bitsdojo_window package to customize the window appearance and behavior. The bitsdojo_window package provides functionalities for customizing the window frame, title bar, and other window-related fe... |
magicoder | [
{
"from": "human",
"value": "You are tasked with implementing a function to calculate the sum of all elements in a given array, using a specific method. The array is represented as a vector of integers. The method involves using OpenCL to perform the summation on a GPU device. The provided code snippet is a... |
codefeedback | [
{
"from": "human",
"value": "I'd like you to devise a code segment oriented at performing an addition operation on two integers, with the stipulation that the individual numerical components of these integers are distributed across the nodes of two separate linked data configurations. The linked structures ... |
evolcodegolf | [
{
"from": "human",
"value": "You are tasked with the evaluation of a countable ordinal \\$1 < r < \\varepsilon_0\\$. Ascertain whether this ordinal possesses the characteristics of a prime entity. In the event that it is not prime, please delineate precisely two ordinals \\$r_0, r_1 < r\\$ such that \\$r_0r... |
evolcodegolf | [
{
"from": "human",
"value": "In the realm of 95 printable ASCII characters: \n !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\n\nUtilizing the Consolas font, recognized as the default within Stack Exchange's code blocks, certain characters exhibit mirrors a... |
evolcodegolf | [
{
"from": "human",
"value": "Develop a function that accepts an integer and outputs an array of integers representing that number in balanced base twelve, adhering strictly to the following stipulations concerning the usage of 6 and -6 (from the aforementioned link):\n\n1. When determining the last digit of... |
glaive | [
{
"from": "human",
"value": "I am trying to understand how to use lenses in Haskell to access and modify data structures. I want to start by accessing and modifying elements of a tuple using lenses. Can someone provide a clear example of how to use lenses to access and modify tuple elements in Haskell?"
}... |
magicoder | [
{
"from": "human",
"value": "You are tasked with creating a Python function that processes a list of strings representing test cases for a testing module. Each test case is represented by a string in the format \"test_<module_name>_<function_name>()\", where <module_name> and <function_name> are placeholder... |
glaive | [
{
"from": "human",
"value": "I need to create a query to retrieve information about a person named \"Mark Birbeck\" who is known by a person named \"Ben\". The data is stored in a RDF dataset and I need to use SPARQL to retrieve the information. Can someone help me write a SPARQL query to accomplish this?"
... |
sharegpt | [
{
"from": "human",
"value": "Manipulate the given text string to extract the value of every third character, starting from the index of 2 (third position), utilizing their index values. Also, if the character found at the particular position is an alphabet character, replace it with the corresponding numeri... |
evolcodegolf | [
{
"from": "human",
"value": "Construct a program capable of handling HTTP requests on any user-defined port exceeding 1024, designed to return its own source code in response to requests directed at any user-specified URL. The solution must demonstrate compatibility with popular web browsers, specifically a... |
codefeedback | [
{
"from": "human",
"value": "The issue at hand pertains to the concept of 'Employee Free Time'. The problem is defined as follows: We are provided with a list, termed as `schedule`, which encapsulates the working hours for each individual employee.\n\nEach employee possesses a list of `Intervals` that do no... |
magicoder | [
{
"from": "human",
"value": "You are given a code snippet in Python that calculates and prints the result of 2 raised to the power of a given exponent. However, the code contains a commented-out section and an active section. Your task is to understand the code and predict the output of the active section.\... |
magicoder | [
{
"from": "human",
"value": "You are tasked with implementing a simple observer pattern in Swift. The goal is to create a class that allows other parts of the program to subscribe to changes in a specific value and be notified when that value changes.\n\nYour task is to create a class called `Observable` th... |
evolcodegolf | [
{
"from": "human",
"value": "Construct a solution that takes into account a provided list of unique 2-tuples and a specific element from one of those tuples; the objective is to determine its corresponding \"partner\". For instance, given the element a and the set of tuples [(i,j),...,(a,b),...,(l,m)], your... |
magicoder | [
{
"from": "human",
"value": "You are working on a web application that includes a module for managing equity token offerings (ETOs). The code snippet provided is from the backend of the application, written in TypeScript. The snippet includes imports for specific modules and functions related to ETOs. Your ... |
codefeedback | [
{
"from": "human",
"value": "In what ways could the doctrines of Quantum Superposition and Quantum Tunneling be exploited to augment the precision and effectiveness of sophisticated artificial intelligence mechanisms when grappling with extensive, intricate data collections brimming with countless variables... |
magicoder | [
{
"from": "human",
"value": "You are given a Python code snippet that takes three integer inputs and finds the largest and smallest among them. Your task is to write a Python function that achieves the same functionality as the given code snippet.\n\nWrite a function `find_largest_smallest` that takes three... |
codefeedback | [
{
"from": "human",
"value": "Using a switch-case statement, calculate the grade for the student using the percentage in the input. The percentage can be any floating-point number between 0 and 100, inclusive. The grades should be assigned according to the following scale:\n\n- 95-100: A+\n- 90-94: A\n- 85-8... |
glaive | [
{
"from": "human",
"value": "You are tasked with creating a function in the recipe module that takes a partition as input and outputs a series of objects. The function should iterate through each object in the partition and generate a series of objects using the @series macro.\n\nYour task is to implement t... |
glaive | [
{
"from": "human",
"value": "You are tasked with creating an Emacs Lisp package that defines additional Org link types, \"elisp-function\" and \"elisp-variable\", intended to be used mainly in user documentation. These links should open by calling `describe-function` and `describe-variable`, respectively. T... |
codefeedback | [
{
"from": "human",
"value": "Build a quickly-sortable tree from a given array.\nArray = [3, 8, 4, 5, 2, 10, 7]\n\nAdditional Instructions:\n1. Implement the sorting algorithm yourself instead of using built-in sort functions.\n2. The tree should be built in a way that allows for efficient insertion and retr... |
codefeedback | [
{
"from": "human",
"value": "Translate and explain this code to Perl\ndef special_numbers(array):\n def is_composite(n):\n if n < 2:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return True\n return False\n \n def ... |
sharegpt | [
{
"from": "human",
"value": "I am working on a Linux system using x86 architecture. I need to obtain the address of the current instruction for my project. Specifically, I want to create my own simplified versions of `setjmp` and `longjmp`. I came across a simplified implementation of `longjmp` provided by ... |
dolphin | [
{
"from": "human",
"value": "port this code to Fortran:\n```julia\nusing DataStructures\n\nfunction min_time(grid::Vector{Vector{Int}})::Int\n m, n = length(grid), length(grid[1])\n visited = fill(1000000, m, n)\n dx, dy = [-1, 0, 1, 0], [0, 1, 0, -1]\n visited[1, 1] = 0\n q = Queue([(1, 1)])... |
magicoder | [
{
"from": "human",
"value": "You are tasked with implementing a Python function that resizes images to fit within a specified maximum size while maintaining the original aspect ratio. The function should take in the path of the original image, the maximum size for either height or width, and the path where ... |
codefeedback | [
{
"from": "human",
"value": "Devise an intricate schematic for a quantum computational paradigm, coded in Python, specifically engineered to interact with a MongoDB NoSQL data management system, with the objective of augmenting sonorous analytics procedures and accelerating the speed of data mining and inte... |
magicoder | [
{
"from": "human",
"value": "You are tasked with implementing a function that calculates the total distance traveled by a sprite in a 2D game. The sprite's movement is determined by the product of its current position, a movement factor, and the number of coins collected. The movement factor is multiplied b... |
evolcodegolf | [
{
"from": "human",
"value": "In light of the recent lack of engaging challenges, let’s spice things up a bit. \n\nGiven a list of integers, all strictly greater than \\$0\\$ and an index as input, your task is to compute and return the percentage of the item at the specified index relative to the total sum ... |
codefeedback | [
{
"from": "human",
"value": "Write a recursive function in Python that takes a list of positive integers and returns the greatest difference between any two numbers in the list. However, you are not allowed to use any built-in functions such as max() or min().\n\nAdditionally, you are not allowed to use any... |
evolcodegolf | [
{
"from": "human",
"value": "Design a 4D variant of the classic game of Tic-Tac-Toe, where players compete against an AI. The game board can be customized by the user, with dimensions that may extend up to 5 x 5 x 5 x 5. The AI should utilize advanced strategies to ensure it plays optimally, although its in... |
magicoder | [
{
"from": "human",
"value": "You are tasked with implementing a Python class that combines the functionality of a themed label frame with features of a text-based Tkinter widget. Your goal is to create a class that inherits from `ttk.LabelFrame`, `BaseTextTkinterWidget`, and `BaseFrameMixin`. The `BaseTextT... |
evolcodegolf | [
{
"from": "human",
"value": "A palindrome is a lexeme that retains its identity when reversed. However, certain lexemes may appear to be palindromic but are not genuine examples. Consider the term sheesh; despite its superficial resemblance, sheesh fails to qualify as a palindrome due to its reversal being ... |
evolcodegolf | [
{
"from": "human",
"value": "This is a code-shuffleboard answer-chaining challenge, where the answers will aim to, together, output the lyrics to this beloved 80s song while adhering to a strict character count limit that varies for each line. This is the full lyrics of the song, line by line. The first ans... |
codefeedback | [
{
"from": "human",
"value": "Create a class in Python named ``Rectangle`` with two attributes length and width. The length and width should only accept positive integer values between 1 and 100, inclusive. Additionally, implement the following methods:\n\n1. A method named ``get_area`` that returns the area... |
magicoder | [
{
"from": "human",
"value": "You are tasked with implementing a Python class that manages search rows within a search group. The class `SearchRowForm` is initialized with optional arguments `*args` and `**kwargs`, and it contains a `search_group` attribute. The `search_group` attribute is extracted from the... |
sharegpt | [
{
"from": "human",
"value": "I need to have multiple submit buttons in my form. One button should create an instance of Contact_Call with the default attribute value, while the other button should create it with a different attribute value. Additionally, I need to set the attribute on a different model used... |
dolphin | [
{
"from": "human",
"value": "port this code to Scala:\n```c\n#include <stdio.h>\n\nint* solve(int* nums1, int* nums2, int nums1Size, int nums2Size, int** queries, int queriesSize, int* queriesColSize, int* returnSize){\n int* res = (int*)malloc(queriesSize * sizeof(int));\n int n = nums1Size;\n for... |
sharegpt | [
{
"from": "human",
"value": "Hello, I am using Rails version 3.0.7 and I encountered a warning when running the command \"rails generate model task name:string\". The warning message states that the version of mysql2 (0.3.2) I have installed no longer includes the ActiveRecord adapter, which is now part of ... |
magicoder | [
{
"from": "human",
"value": "You are tasked with creating a Python function that filters a list of packages based on certain criteria. The function should take in three parameters: a list of all available packages, a list of standard packages, and a list of packages to exclude. The function should filter ou... |
codefeedback | [
{
"from": "human",
"value": "Enhance the complexity of this programming test question:\n\nApart from decoding an encoded text string derived from a given encode_cyclic function, the code must now handle more complex edge cases such as UTF-8 encoded special characters and whitespace. Furthermore, modify the ... |
sharegpt | [
{
"from": "human",
"value": "I have an algorithm that outputs all prime numbers from 1 to 'n'. Can you help me make some adjustments to improve its performance? I understand that increasing the time or space complexity is acceptable in some cases, but it's not recommended to always do so. Please provide a m... |
glaive | [
{
"from": "human",
"value": "You are tasked with creating a new meta function in Lean, called `my_copy_decl`, which will copy a given declaration and update its name by adding a prefix \"my_\" to it. This new function should take in a declaration as an argument and add the modified declaration to the enviro... |
magicoder | [
{
"from": "human",
"value": "You are tasked with creating a program that processes a list of file extensions and counts the occurrences of each unique file extension. You are given a code snippet that includes the definition of a class `File` and a list of file extensions in JSON format. Your task is to wri... |
codefeedback | [
{
"from": "human",
"value": "Please write code to implement the Odd-Even Sort algorithm.\n\nAdditional requirements:\n- The sorting algorithm should be implemented as a function.\n- The function should take an array of integers as input and return the sorted array.\n- The function should handle arrays of an... |
evolcodegolf | [
{
"from": "human",
"value": "Given the context surrounding the concept of Generate Keyboard Friendly Numbers, a thorough examination of the numeric layout on typical number pads reveals the following arrangement:\n\n```\n789\n456\n123\n 0 \n```\n\nIn this scenario, we define the notion of a number's n... |
magicoder | [
{
"from": "human",
"value": "You are tasked with creating a Python function that processes permissions for form handler views. The function should take a list of permissions and return a filtered list containing only the permissions related to form data entries.\n\nThe permissions are represented as strings... |
magicoder | [
{
"from": "human",
"value": "You are tasked with creating a program that processes SQL commands for a simple database management system. The program should be able to handle two types of commands: import and list tables.\n\n1. Import Command:\nThe import command is used to load data from a CSV file into the... |
sharegpt | [
{
"from": "human",
"value": "I want to generate an AI chatbot to answer customer queries. How can I do that?"
},
{
"from": "gpt",
"value": "<think>\nOkay, so I want to create an AI chatbot to handle customer queries. Let's see, where do I start? I've heard about chatbots before, but actually bui... |
dolphin | [
{
"from": "human",
"value": "convert this code to Go:\n```groovy\nclass Solution {\n int bufferIndex = 0\n int bufferLen = 0\n def buf4 = new char[4]\n\n int read(char[] buf, int n) {\n int cnt = 0\n while (cnt < n) {\n if (bufferIndex == bufferLen) {\n bu... |
glaive | [
{
"from": "human",
"value": "You are tasked with creating a script in TCL that automates the interactive input for a command-line tool. The script must handle various prompts and provide default values as needed. The script should also check for specific questions and validate the input provided. The script... |
codefeedback | [
{
"from": "human",
"value": "Three cars depart simultaneously from the same place, heading in different directions. Car A maintains a consistent speed of 70 km/h and is heading east. Car B departs at a speed of 50 km/h headed north. Car C departs towards the west at a speed of 60 km/h. Calculate:\n\n1. The ... |
evolcodegolf | [
{
"from": "human",
"value": "Designing a Crossed Square Pattern \nYour task is to receive an input of a positive odd integer and generate a square pattern composed entirely of a single printable character of your selection, featuring a diagonal cross that intersects at the center. \nThe core objective is ... |
evolcodegolf | [
{
"from": "human",
"value": "It appears there hasn't been a competition focusing on the intricacies of slope fields, at least to my knowledge. Consequently, I see an opportunity to create one. \nThe challenge \nProvided: \n\nA black box function f that accepts two real-number parameters, x and y, and out... |
sharegpt | [
{
"from": "human",
"value": "What is the code in Swift to calculate a past or future date from today?"
},
{
"from": "gpt",
"value": "<think>\nOkay, I need to figure out how to write Swift code that calculates a past or future date from today. Let me start by recalling what I know about date hand... |
evolcodegolf | [
{
"from": "human",
"value": "Given three sidelengths of a triangle, evaluate its aspect ratio AR, employing the specified formula:\n\nwhere\n\nThe closer to equilaterality a triangle is, the closer to 1 its aspect ratio is. The aspect ratio is bigger or equal to 1 for valid triangles. Additionally, the outp... |
glaive | [
{
"from": "human",
"value": "I am trying to create an Emacs package that provides evil bindings for Eshell. I want to define a function that acts as an \"evil\" wrapper around the `eshell-next-prompt` function. Additionally, I need to set up key bindings for different modes in Eshell, such as normal, insert... |
sharegpt | [
{
"from": "human",
"value": "I need help performing operations on two tables using SQL. I have a Products table with columns like id, name, category, price, and supplier_id. I also have a new Suppliers table with at least two fields: id and name. How can I join these two tables based on their respective id ... |
glaive | [
{
"from": "human",
"value": "You are tasked with creating a program that parses a given thesis document and extracts the chapter number, chapter title, and any referenced books using a specific citation format. The input will be a string containing the text of the thesis. The chapter number will be denoted ... |
codefeedback | [
{
"from": "human",
"value": "Compile the following PHP code and explain the output.\n\n```php\n$a = 5;\n$b = '5';\n\nvar_dump($a === $b);\n\n$c = '5';\n$d = '5';\n\nvar_dump($c === $d);\n```\n\nExplain the output and provide a detailed explanation of the difference between the `==` and `===` operators in PH... |
sharegpt | [
{
"from": "human",
"value": "I have a cplusplus shared library with a c interface that writes log entries in stdout. I am using it in a python application using the `ctypes` library. The python application uses the `logging` library to write log entries. My goal is to capture the stdout entries of the share... |
evolcodegolf | [
{
"from": "human",
"value": "Evaluate, using the least number of bytes feasible, whether the two provided values correspond with any of the subsequent specified options: \nInitial value \n2 either a string or an integer - your choice \nto insensitively regarding case \ntoo insensitively rega... |
magicoder | [
{
"from": "human",
"value": "You are working on a project that involves processing satellite imagery data from the Antarctic region. The satellite images are stored on a remote server, and you need to retrieve a list of filenames for the Sentinel-1 (S1) data used in making the reference coastline.\n\nYou ha... |
glaive | [
{
"from": "human",
"value": "You are tasked with writing a Bash script that automates the process of building and tagging Docker images for a specific version of a software. The script should define a variable for the software version, run a clean build using Gradle for a specific project directory, and the... |
evolcodegolf | [
{
"from": "human",
"value": "Challenge \nThis is a more intricate challenge. Given two positive integers w and h, meticulously design an ASCII representation of a fence with a specified width of w and a specified height of h, adhering to the following detailed regulations:\n\n1. The + character will signif... |
evolcodegolf | [
{
"from": "human",
"value": "Formulating this inquiry may seem somewhat repetitive given the existing challenges, yet the intention persists. \nDevise a program that receives a textual string as an input parameter and generates a truncated or summarized output version, incorporating a designated separator i... |
evolcodegolf | [
{
"from": "human",
"value": "In my previous attempts to tackle challenges related to Kolmogorov complexity, particularly those involving string compression, I consistently find myself at a loss, largely due to my insufficient understanding of how to utilize string compression tools to their fullest potentia... |
codefeedback | [
{
"from": "human",
"value": "Implement a Bubble Sort algorithm.\n\nWrite a function called `bubble_sort` that takes in a list of integers and returns the list sorted in ascending order. The function should use the Bubble Sort algorithm to sort the list.\n\n**Constraints:**\n- The length of the input list wi... |
magicoder | [
{
"from": "human",
"value": "You are tasked with implementing a custom machine learning algorithm for binary classification. The algorithm is based on a simple decision tree model and should be implemented using object-oriented programming in Python. The provided code snippet is a part of the `fit` method o... |
evolcodegolf | [
{
"from": "human",
"value": "Transform two strings such that the vowel-to-consonant ratio of the first string is applied to the second string. Minimize the output size. \nInput: Hello World \nOutput: Hll Wrd \n\nBoth strings will be nonempty and of equal length, containing only alphabetic characters. The... |
magicoder | [
{
"from": "human",
"value": "You are tasked with implementing a class that represents a simple data structure for storing and retrieving information about a set of files. The class should provide methods for adding files, removing files, and retrieving the current state of a specific file.\n\nYou are given ... |
dolphin | [
{
"from": "human",
"value": "convert this code to TypeScript:\n```lisp\n(defclass PhoneDirectory ()\n ((maxNumbers :accessor maxNumbers :initarg :maxNumbers)\n (available :accessor available :initform (make-array maxNumbers :initial-element t))\n (released :accessor released :initform (make-array 0 :el... |
evolcodegolf | [
{
"from": "human",
"value": "Craft a program that outputs the digits from \"0\" to \"9\" (inclusive) in a single line, ensuring each digit is represented exactly once. However, to add an intriguing twist, the digits \"3\", \"5\", and \"7\" must appear in that specific order within your output. \n\nGuideline... |
glaive | [
{
"from": "human",
"value": "I need to create a Python function that takes in a list of integers and returns the average of all the numbers in the list. The function should be named \"calculate_average\" and should take a single parameter \"numbers_list\". The function should return the average as a floatin... |
sharegpt | [
{
"from": "human",
"value": "I have loaded a CSV file into a variable named 'dataset' as a Numpy array. I attempted to execute dataset.head() to check the first few entries, but it reported an error. Is there a head and tail method for Numpy arrays that would allow me to check the first and last few entries... |
evolcodegolf | [
{
"from": "human",
"value": "In our contemporary landscape, we have all become quite familiar with the traditional layout of the telephone keypad, haven't we? For your reference, here’s a visual depiction of its arrangement:\n\nConsider a given String composed exclusively of lowercase ASCII letters and sing... |
glaive | [
{
"from": "human",
"value": "You are tasked with implementing a function to search for a given string within an array of strings. The function should be case-sensitive or insensitive based on a specified mode. The array to be searched and the string to be located are both of type character.\n\nWrite a subro... |
evolcodegolf | [
{
"from": "human",
"value": "Develop a program that generates the precise string: \njan ale o, toki! \n\n(\"Hello, world\" translated into toki pona to circumvent builtins.) \nThe program should optionally append a trailing newline. Moreover, it must ensure that if any specific byte present in your imple... |
codefeedback | [
{
"from": "human",
"value": "You are tasked with creating a Python program that simulates a simple banking system. The program should be able to handle multiple user accounts, allowing users to create accounts, log in, deposit money, withdraw money, and view their balance. The program should also ensure tha... |
dolphin | [
{
"from": "human",
"value": "convert this code from Erlang to Lisp:\n```erlang\nfilter_restaurants(Restaurants, VeganFriendly, MaxPrice, MaxDistance) ->\n CustomCompare = fun(A, B) ->\n case A#restaurant.rating == B#restaurant.rating of\n true -> B#restaurant.id - A#restaurant.id;\n ... |
glaive | [
{
"from": "human",
"value": "You are tasked with implementing a tape data structure in Elixir that can be used for a Turing machine simulation. The tape should have the following capabilities:\n\n1. Create a new tape with an initial value of 0 at the current position.\n2. Read the value at the current posit... |
evolcodegolf | [
{
"from": "human",
"value": "Imagine you are managing a political website and have discovered that presenting the likelihood of winning or losing an election as a ratio, such as \"5 in 7\", enhances intuitive understanding compared to expressing it as a percentage like \"71%\". However, your aim is to avoid... |
codefeedback | [
{
"from": "human",
"value": "Can you find a mathematical formula to calculate the sum of the first 10 positive integers? Once you have the formula, can you express it using a loop structure in any programming language? Additionally, can you modify your loop to only sum up even numbers in the sequence of the... |
evolcodegolf | [
{
"from": "human",
"value": "Introduction:\nIn conventional discussions, we typically refer to four dimensions: three spatial dimensions represented by x, y, and z, alongside a singular temporal dimension. However, for the purposes of this specific challenge, we will further decompose the time dimension int... |
evolcodegolf | [
{
"from": "human",
"value": "Let \\$A\\$ be a collection of non-negative integers, which may contain elements of varying multiplicities but is guaranteed to be unordered. Your task is to devise a function or program that generates a new collection of non-negative integers \\$B\\$ (the order in \\$B\\$ does ... |
glaive | [
{
"from": "human",
"value": "You are tasked with creating a SPARQL query to retrieve features related to specific entities in a knowledge graph. You need to retrieve features related to a \"Lampe\" (lamp) and a \"Tuer\" (door) in German, as well as features created and annotated by specific individuals.\n\n... |
glaive | [
{
"from": "human",
"value": "You are tasked with implementing a simple bloom effect in a shader using HLSL. The shader should take two input textures, _MainTex and _BloomTex, along with their respective texel sizes (_MainTex_TexelSize and _BloomTex_TexelSize). The shader should have the following functional... |
codefeedback | [
{
"from": "human",
"value": "Create a function called \"find_primes\" that takes two arguments, \"start\" and \"end\", and returns a list of all the prime numbers between the two. \n\nThe function should handle cases where the \"start\" value is greater than the \"end\" value and vice versa. In such cases, ... |
glaive | [
{
"from": "human",
"value": "I'm trying to implement a CUDA kernel to solve a 3D advection-diffusion equation using the Runge-Kutta method. I have already written kernels for advection in the x, y, and z directions, as well as a kernel for diffusion (Laplace operator). Now, I need to write a kernel for the ... |
magicoder | [
{
"from": "human",
"value": "You are working on a machine learning project and need to preprocess image data for training a convolutional neural network (CNN). The given code snippet is a part of the data preprocessing step. The code is intended to perform the following tasks:\n1. Convert the data type of t... |
codefeedback | [
{
"from": "human",
"value": "Write SQL query to find all employee names who work in the IT department and have at least 5 years of experience. Display the employee names in descending order of their salary."
},
{
"from": "gpt",
"value": "<think>\nOkay, I need to write an SQL query to find employ... |
magicoder | [
{
"from": "human",
"value": "You are tasked with implementing a custom error handling system in Rust. Your goal is to create a macro that generates error handling code for a given type. The macro should generate an implementation of the `std::error::Error` trait for the specified type and provide a `from` m... |
magicoder | [
{
"from": "human",
"value": "You are working on a data processing application that involves cleaning and transforming strings. The application uses a set of custom string replacement rules to modify the input strings. The rules are applied in a specific order to transform the input string into a clean, form... |
magicoder | [
{
"from": "human",
"value": "You are tasked with implementing a custom error handling system for a web application. The application is built using the Laravel framework, and you need to create a new custom exception class to handle internal server errors. The custom exception class should extend the base Ex... |
codefeedback | [
{
"from": "human",
"value": "Write a Python program that employs regular expressions to not only identify but also replace specific phrases in lines of text. \n\nThe phrases for identification and replacement are: \n1. Identify: \"an apple a day keeps the doctor away\"\nReplacement: \"a healthy lifestyle ke... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.