source
stringclasses
6 values
conversations
listlengths
2
2
glaive
[ { "from": "human", "value": "Can you provide a MySQL query to retrieve the latest posts from a blog database?" }, { "from": "gpt", "value": "<think>\nOkay, I need to write a MySQL query to get the latest posts from a blog database. Let's think about how a blog database might be structured. Typic...
codefeedback
[ { "from": "human", "value": "Create a Kotlin program which prints out all the prime numbers between 1 and 100 and also calculates the sum of all the prime numbers." }, { "from": "gpt", "value": "<think>\nOkay, I need to create a Kotlin program that finds all prime numbers between 1 and 100 and t...
sharegpt
[ { "from": "human", "value": "Can you provide an R program that counts the number of occurrences of each element in a vector?" }, { "from": "gpt", "value": "<think>\nOkay, I need to write an R program that counts how many times each element appears in a vector. Let me think about how to approach ...
sharegpt
[ { "from": "human", "value": "Can you help me create a C++ function that generates a random number between 3 and 8?" }, { "from": "gpt", "value": "<think>\nOkay, I need to create a C++ function that generates a random number between 3 and 8. Hmm, let's see. I remember that in C++, the rand() func...
dolphin
[ { "from": "human", "value": "translate this code from ANSI C to Scala:\n```c\n#include <stdio.h>\n#include <stdlib.h>\n\nint MAX_PAIRS(int nums[], int n) {\n int freq[501] = {0};\n for (int i = 0; i < n; i++) {\n freq[nums[i]] += 1;\n }\n for (int i = 1; i <= 500; i++) {\n freq[i] ...
codefeedback
[ { "from": "human", "value": "Given a list of integers, find the longest common substring of the list, considering the numbers in the list as characters. The substring should consist of consecutive integers in the list, and the characters in the substring should be in strictly increasing order. If there are ...
codefeedback
[ { "from": "human", "value": "Create a function that takes a sentence as a string and returns a string containing the sentence in reverse order.\n\"I am learning to code\"" }, { "from": "gpt", "value": "<think>\nOkay, I need to create a function that takes a sentence as a string and returns the s...
glaive
[ { "from": "human", "value": "You are tasked with creating a function in JavaScript that takes in an array of numbers and returns the sum of all the even numbers in the array. If the array is empty or does not contain any even numbers, the function should return 0.\n\nWrite a function called `sumEvenNumbers`...
glaive
[ { "from": "human", "value": "You are tasked with creating a Subscriber class in Ruby for Google Cloud Pub/Sub. The Subscriber class should have the ability to listen for messages from a specific topic and subscription, with the flexibility to set various parameters such as deadline, streams, inventory, and ...
glaive
[ { "from": "human", "value": "You are tasked with creating a program to manage education assignments. You need to define a struct type EducationAssignment with various properties such as class ID, display name, instructions, due date, assign date, grading type, assigned recipient, submission resources, and m...
codefeedback
[ { "from": "human", "value": "I'm learning Django and I had an error in code\n\nclass Nomzod(models.Model):\n\nY = [\n (\"Erkak\", \"Erkak\"),\n (\"Ayol\", \"Ayol\"),\n]\n\nism_f = models.CharField(max_length=100)\nemail = models.EmailField(unique=True, blank=True)\nbirinchisi = models.BooleanField(def...
sharegpt
[ { "from": "human", "value": "How can I add a row to a database table and update it if a row with the same unique key already exists?\n\nHere is my current query:\n```php\n$query = \"INSERT INTO audit_section_markrecord(`audit_section_id`,`form_details_subquestion_id`,`form_details_section_id`,`mark`) VALUES...
codefeedback
[ { "from": "human", "value": "Construct a Django model field for storing a user's age, where the age should be stored as a hexadecimal string representation. Additionally, the model field should have a validation rule that ensures the age is greater than or equal to 18 years old." }, { "from": "gpt",...
glaive
[ { "from": "human", "value": "You are tasked with creating a program that calculates the timeout for a setup process. The setup process should have a timeout of 20 minutes, which needs to be converted to seconds. Implement a function that takes in the timeout in minutes and converts it to seconds." }, { ...
glaive
[ { "from": "human", "value": "You are tasked with creating a class in Kotlin that represents a balance change cause in a financial system. The class should have the following functionalities:\n\n1. A subclass for AML Alert, with a constructor that takes a reason as a parameter.\n2. An open class for Offer, w...
codefeedback
[ { "from": "human", "value": "Create a function in Python that adds two numbers, but the numbers must be positive prime integers less than 1000." }, { "from": "gpt", "value": "<think>\nOkay, I need to create a Python function that adds two numbers, but these numbers have to be positive prime inte...
glaive
[ { "from": "human", "value": "I have two models, `Courier` and `Order`. I have the following query:\n\n```\nactive_couriers = Courier.\n available_courier_status.\n where(:service_region_id => @service_region.id).\n includes(:orders)\n```\n\nThis query works, but it pulls in all orders. I want to limit th...
glaive
[ { "from": "human", "value": "I need to write an XSL stylesheet that transforms XML elements into a specific format. The output should include a new \"hero\" element for each original element, with attributes for \"name\", \"age\", \"catchphrase\", and \"sex\". The \"sex\" attribute should default to \"Femal...
sharegpt
[ { "from": "human", "value": "How can I find out the UTC time offset that my computer is set in Python?" }, { "from": "gpt", "value": "<think>\nOkay, I need to find out the UTC time offset of my computer using Python. Let me think about how to approach this. \n\nFirst, I remember that Python has ...
evolcodegolf
[ { "from": "human", "value": "In the realm of matrix theory, the special linear group \\$ SL_2(\\mathbb{Z}) \\$ stands as a notable construct, encompassing the multiplicative group comprised of \\$ 2 \\times 2 \\$ matrices populated by integers with a determinant equaling 1. It is established that any matrix...
codefeedback
[ { "from": "human", "value": "Optimize the following code by using the C++ vector container and implement a binary search algorithm to find a specific element in the vector. Add the following constraints:\n\n1. The vector `a` should be dynamically allocated with a size of N, where N is a number input by the ...
sharegpt
[ { "from": "human", "value": "How can you expand the \"Guri and Gura\" book series by introducing a new character who has a unique personality and plays a significant role in the plot? In addition, what modifications can you make to the existing plot to showcase the new character's contributions to the adven...
glaive
[ { "from": "human", "value": "You are tasked with creating a Perl module called Acme::Flat::AV that represents an Array Value. The module should have a version number of '0.001002' and should inherit from the Acme::Flat::PVMG module. Additionally, you need to use the Class::Tiny module for creating the class...
codefeedback
[ { "from": "human", "value": "Convert the following list into a dictionary in Python while ensuring that all keys are unique and values are of type integer. The input list may contain duplicate elements, and your task is to handle these duplicates in the following manner:\n\n- If a duplicate element is encou...
sharegpt
[ { "from": "human", "value": "Suggest a way to complete the following Python program which takes two strings as input, checks if they have any common characters, and prints out the longer string only if they do. Additionally, if they are the same length, concatenate them.\nfirst_str = 'hello'\nsecond_str = '...
glaive
[ { "from": "human", "value": "You are tasked with creating a LaTeX document that includes an image with text and colored elements. The image must be included using the `input` command and should be scalable. Additionally, the document should be able to handle the color and transparency properties of the imag...
codefeedback
[ { "from": "human", "value": "Could you elaborate on the assorted techniques one can employ to execute recursive functions in the programming language of Python?" }, { "from": "gpt", "value": "<think>\nOkay, so I need to figure out the different techniques for writing recursive functions in Pytho...
codefeedback
[ { "from": "human", "value": "Construct a JavaScript function that applies the modulus operation to determine the residue after division of a given array of numbers by a specified divisor. Your function should handle edge case scenarios, such as receiving empty input, letters, negative numbers, and non-whole...
glaive
[ { "from": "human", "value": "You are tasked with implementing a fully-connected AXI4-Lite crossbar module using Verilog. The crossbar module should have the following parameters:\n- Number of Slave Ports (Cfg.NoSlvPorts)\n- Number of Master Ports (Cfg.NoMstPorts)\n- Number of Address Rules (Cfg.NoAddrRules)...
glaive
[ { "from": "human", "value": "You are tasked with creating a controller test for rendering an asciicast file in both v1 and v2 formats. The controller test should ensure that the proper JSON response is returned with the correct version, width, and stdout for the respective formats. You will need to use the ...
glaive
[ { "from": "human", "value": "You are tasked with implementing the graphical processing unit (GPU) for an arcade hardware system. The GPU is responsible for implementing the graphical layers, including the VRAM using a dual-port RAM to allow concurrent access by both the CPU and GPU. The VRAM consists of spr...
codefeedback
[ { "from": "human", "value": "Design a SQL query to find the first name of all employees of a company who have joined within the last 3 months and have an email extension specific to the company. \nThe createdAt column is given in the format 'YYYY-MM-DD HH:MI:SS'\nTable \"Employee\" with columns: FirstName, ...
dolphin
[ { "from": "human", "value": "port this code to c++:\n```java\nimport java.util.ArrayList;\nimport java.util.List;\n\npublic class Main {\n public static final int mod = 1000000007;\n\n public static List<Integer> getPowers(int n) {\n List<Integer> powers = new ArrayList<>();\n while (n >...
evolcodegolf
[ { "from": "human", "value": "Your task is to develop a program that receives a degree sequence represented as a partition of an even integer. The objective is to determine and return the count of loop-free labeled multigraphs corresponding to this degree sequence, which necessitates multiple layers of analy...
sharegpt
[ { "from": "human", "value": "I'm encountering an issue when running unit tests with Resharper. The tests run fine in Visual Studio, but when I run them with Resharper, I get an error on the following line of code:\n\n```csharp\nvar services = Assembly.Load(\"SomeAssembly\");\n```\n\nThe error message states...
codefeedback
[ { "from": "human", "value": "Create an intricate Java application that implements advanced sorting algorithms like Tim Sort or Heap Sort. The application should efficiently sort a doubly linked list while preserving the original sequence of equivalent elements." }, { "from": "gpt", "value": "<th...
codefeedback
[ { "from": "human", "value": "Write a function in C++ to convert a list of integers to a tuple, where each element in the tuple must be a positive integer." }, { "from": "gpt", "value": "<think>\nOkay, so I need to write a C++ function that converts a list of integers into a tuple, and each eleme...
evolcodegolf
[ { "from": "human", "value": "The concept bears resemblance to the centers of a triangle, albeit focusing on a distinct point known as the Fermat Point. This point, labeled P within triangle ABC, is defined by the criterion that the sum of distances AP, BP, and CP is minimized. There exist two distinct scena...
magicoder
[ { "from": "human", "value": "You are working on a software system that manages accounting processes for a company. One of the functionalities involves determining whether a sales order can be reinvoiced based on certain conditions. The system has a method `_sale_can_be_reinvoice()` that needs to be implemen...
sharegpt
[ { "from": "human", "value": "I have a code that creates a new record in Rails like this:\n\n```ruby\ntruck = Truck.create(:name=>name, :user_id=>2)\n```\n\nMy database already has thousands of truck entities, and I have manually assigned some of the IDs, leaving some IDs available. The issue I'm facing is t...
sharegpt
[ { "from": "human", "value": "Determine the value within the Fibonacci sequence corresponding to a specific numerical input by utilizing a for loop construct in programming." }, { "from": "gpt", "value": "<think>\nOkay, so I need to figure out how to find the value in the Fibonacci sequence that ...
codefeedback
[ { "from": "human", "value": "For example, will this `data` variable be garbage collected instantly?\n\n{\n const data = new Array(10000);\n}\n\n\n...and if so, does this mean using scope-blocks in JavaScript can be a practical method of localizing short-lived data? I know this shouldn't be high priority or...
glaive
[ { "from": "human", "value": "I am working on a placement and routing tool for my digital design and I need to implement a feature that checks for free instances and performs placement based on certain conditions. The tool reads in Liberty and LEF files, as well as a DEF file and performs operations based on...
codefeedback
[ { "from": "human", "value": "You are tasked with implementing a Python class that generates test cases for a block-level diagram problem. The block-level diagram consists of a series of blocks connected by arrows, where each block has a unique identifier and may have multiple input and output arrows. Your t...
evolcodegolf
[ { "from": "human", "value": "The cosmic call represents an intricate communication dispatched into the vastness of space in the years 1999 and 2003. This message is composed of 23 monochrome bitmap images, each sized at 127*127 pixels, the specifics of which are elaborated in the referenced documentation. Y...
magicoder
[ { "from": "human", "value": "You are tasked with creating a program to manage the cycling schedules for different office positions. The program should determine the maximum cycle number, retrieve the cycles, and filter the cycles based on the office position.\n\nYou are given a code snippet that initializes...
magicoder
[ { "from": "human", "value": "You are working on a machine learning project and need to create a custom data loader for your dataset. You have been provided with a code snippet that imports various modules related to data handling and transformation. Your task is to implement a custom data loader using the p...
evolcodegolf
[ { "from": "human", "value": "You are the chief campaign advisor for an independent candidate entering a surprise late season gubernatorial race in a swing state. \nYour task: identify a combination of counties within the state that will collectively secure at least 50% of the total votes needed for victory...
evolcodegolf
[ { "from": "human", "value": "The task requires the formulation of code that can derive concise logical formulae to represent the sums of binary digits. The primary objective is for your implementation to identify the most minimal propositional logical formula capable of determining whether the summation of ...
codefeedback
[ { "from": "human", "value": "Create a JavaScript function that converts a given number to an array of its prime factors. Additionally, the function should handle input validation and error handling." }, { "from": "gpt", "value": "<think>\nOkay, I need to create a JavaScript function that convert...
sharegpt
[ { "from": "human", "value": "How can I terminate threads after a certain duration of time in Python? I have a code where threads are running an infinite while loop and they can stall for a random, large amount of time. I want the threads to not last longer than the time set by a certain 'duration' variable....
magicoder
[ { "from": "human", "value": "You are tasked with implementing a C++ program to calculate the least common multiple (LCM) and greatest common divisor (GCD) of two positive integers. The LCM of two integers a and b is the smallest positive integer that is divisible by both a and b, while the GCD is the larges...
codefeedback
[ { "from": "human", "value": "In the process of managing data packet compilation for a distinct Kafka topic, I recurrently stumble upon a 'TimeoutException'. Can you elucidate the precise configuration prerequisites for a Kafka producer, the most effective strategy for transmitting messages, and any common p...
codefeedback
[ { "from": "human", "value": "Write a code to simulate Conway's Game of Life with the following additional rules:\n\n1. In addition to the standard rules of Conway's Game of Life, cells that are alive and have exactly 2 or 3 neighbors will change their state to dead.\n2. Implement a \"glider\" pattern, where...
glaive
[ { "from": "human", "value": "You are tasked with creating a web page that displays a specific article based on the link provided in the URL. The article information is stored in a database table named \"artigo\" and the user information in a table named \"usuario\". The HTML structure for the page is provid...
dolphin
[ { "from": "human", "value": "port this code from javascript to Scala:\n```javascript\nfunction findShortestSubArray(nums) {\n const freq_map = {}, start_map = {};\n let max_freq = 0, min_length = nums.length;\n\n for (let i = 0; i < nums.length; ++i) {\n if (!start_map.hasOwnProperty(nums[i]...
glaive
[ { "from": "human", "value": "I need to convert an input string into a Hash-key string using the md5 function in Go. I have already implemented a function that returns the Hash-key in bytes format using `h.Sum(nil)`. However, I want to modify this function to return the Hash-key in %x format so that I can us...
magicoder
[ { "from": "human", "value": "You are tasked with creating a Python script to automate the management of Docker containers using the `docker-compose` command. Your script should be able to start, stop, and list containers based on the provided command-line arguments.\n\nYour script should accept the followin...
codefeedback
[ { "from": "human", "value": "Elevate the intricate facets of this computational assessment problem:\n\nIn addition to deciphering a coded input string that resulted from the proposed encode_cyclic function, the subsequent script is also expected to manage outliers such as unique symbols and void space. Furt...
codefeedback
[ { "from": "human", "value": "Given a webpage containing multiple paragraphs of text, write a function to increase the font size of each paragraph from 12px to 24px. The function should preserve the original formatting and styling of the webpage. \n\nYou should not use any third-party libraries or frameworks...
codefeedback
[ { "from": "human", "value": "Convert a given XML document to a JSON document while maintaining the original hierarchical structure of the XML elements and adding a new constraint that the JSON output should only include specific XML elements that meet certain criteria." }, { "from": "gpt", "valu...
glaive
[ { "from": "human", "value": "I am working on a programming problem where I need to create an R program that can encrypt a given sentence by replacing certain characters. Can anyone help me with this?" }, { "from": "gpt", "value": "<think>\nOkay, so I need to create an R program that encrypts a s...
evolcodegolf
[ { "from": "human", "value": "Five friends—Fiona, George, Hannah, Isaac, and Jack—are preparing for a friendly competition in the park and require assistance in determining their lineup order. \n\nYour task is to process a series of statements that form conditions and include optional logical boolean operato...
evolcodegolf
[ { "from": "human", "value": "The Post's Correspondence Problem (PCP) presents a challenge involving a collection of pairs of binary strings, denoted as P_1 through P_n. Your objective is to identify a specific integer k, along with a sequence comprising k indices, such that when the first components of the ...
sharegpt
[ { "from": "human", "value": "I am trying to develop a neural network to recognize handwritten digits. Can you provide me with a code example in Python using the Keras library?" }, { "from": "gpt", "value": "<think>\nOkay, the user wants to create a neural network for handwritten digit recognitio...
dolphin
[ { "from": "human", "value": "Please write the following solution using Fortran:\nYou are given a 2D integer array `trees` where `trees[i] = [xi, yi]` represents the location of the `ith` tree in the garden.\n\nYou are asked to fence the entire garden using the minimum length of rope possible. The garden is ...
evolcodegolf
[ { "from": "human", "value": "Compose a segment of code that accomplishes the following tasks:\n\nAccept as input a signed integer, which may be represented in either signed decimal notation or signed octal format (as detailed below). If the input is in decimal, it should be converted to its octal equivalent...
codefeedback
[ { "from": "human", "value": "Write a function that takes an array of integers and multiplies them together. The function should handle negative numbers and should return the product as a floating-point number. If the array is empty, the function should return 1. Additionally, the function should handle the ...
glaive
[ { "from": "human", "value": "I am trying to create a Perl program that calls a procedure multiple times without passing any arguments. However, I am encountering some issues in implementing this. Can someone please provide a solution to call a procedure multiple times without passing any arguments in Perl?"...
magicoder
[ { "from": "human", "value": "You are given a list of integers and a list of lists. Each inner list contains a series of integers. Your task is to write a function that finds the index of the first occurrence of the given list within the list of lists. If the given list is not found within any of the inner l...
glaive
[ { "from": "human", "value": "I need to write a program that will manipulate strings by removing a specified number of characters from the beginning and end of the string. The program should take the input string and the number of characters to remove from the beginning and end, and then output the resulting...
evolcodegolf
[ { "from": "human", "value": "The challenge at hand is fundamentally straightforward, as it revolves around an answer chaining contest wherein participants sequentially print numbers commencing from 1. Specifically, User 1’s contribution must yield the output of 1, followed by User 2 generating the output of...
glaive
[ { "from": "human", "value": "You want to create a git repository to store your dotfiles and keep them in sync with your home directory. However, you find it difficult to keep the repository up-to-date and are looking for a solution to easily sync the repository with your home directory.\n\nWrite a script or...
codefeedback
[ { "from": "human", "value": "Design a MySQL query to find the average monthly salary of people in the table \"Employees\" who have worked for at least 2 years.\nTable: Employees\nColumns: employee_id, name, salary, hire_date" }, { "from": "gpt", "value": "<think>\nOkay, let's tackle this problem...
glaive
[ { "from": "human", "value": "You are tasked with implementing a GPU kernel for calculating one-dimensional constraint forces in a particle system. The kernel will be used to compute forces and virials for a specified group of particles in the system. The particle positions, velocities, masses, net forces, a...
evolcodegolf
[ { "from": "human", "value": "In this engaging challenge, you are tasked with resolving four distinct computational tasks utilizing the same specified set of characters. While you may rearrange the characters at your disposal, the addition or removal of any character is strictly prohibited. The ultimate vict...
sharegpt
[ { "from": "human", "value": "I have written a program in Go and created a Dockerfile and docker-compose.yml to run it. When I run \"docker-compose up\" without a proxy, everything works fine. However, when I try to run it behind a proxy, it fails. I have modified the Dockerfile and docker-compose.yml to inc...
magicoder
[ { "from": "human", "value": "You are tasked with implementing a function that processes messages received from a WebSocket in a Rust application. The application uses a model to handle different types of messages, such as `SearchText` and `QueryText`. The model contains a `web_socket` field, which represent...
dolphin
[ { "from": "human", "value": "translate this code to Scheme:\n```lua\nfunction min_sum_with_k_unique_integers(nums, k)\n local max_num = math.max(unpack(nums))\n local freq = {}\n for i = 1, max_num + k + 1 do\n freq[i] = 0\n end\n for _, num in ipairs(nums) do\n freq[num] = freq...
sharegpt
[ { "from": "human", "value": "In Python, how can I trim or remove whitespace (spaces and tabs) from a string? For instance, how can I convert the input string \" \\t example string\\t \" to \"example string\"?" }, { "from": "gpt", "value": "<think>\nOkay, I need to figure out how to trim whitespa...
sharegpt
[ { "from": "human", "value": "Is there a built-in method in Python to clear the terminal screen from a script, or is it necessary to use libraries such as curses?" }, { "from": "gpt", "value": "<think>\nOkay, the user wants to know if Python has a built-in method to clear the terminal screen from...
magicoder
[ { "from": "human", "value": "You are working on a web application that uses the Laravel framework. The application has a view file located at `C:\\xampp\\htdocs\\jotus_a\\app\\views\\defaults\\create.blade.php`. This view file is responsible for rendering a form to create new default settings for the applic...
sharegpt
[ { "from": "human", "value": "How can I create a React component that displays a table with student-teacher pairs and their corresponding scores?" }, { "from": "gpt", "value": "<think>\nOkay, so the user wants to create a React component that displays a table of student-teacher pairs and their sc...
codefeedback
[ { "from": "human", "value": "What are the steps involved in training a Naive Bayes classifier and how does it make predictions on new data?" }, { "from": "gpt", "value": "<think>\nOkay, so I need to figure out the steps to train a Naive Bayes classifier and how it makes predictions. Let me start...
magicoder
[ { "from": "human", "value": "You are tasked with creating a Python program that processes a list of integers and performs specific operations on them. The program should take command-line arguments to specify the input list and the operations to be performed. The operations include finding the maximum, mini...
codefeedback
[ { "from": "human", "value": "Given 2 string variables, write a function to find out if the 2 strings are anagrams. Additional requirement: The function should be case-sensitive and ignore any spaces or special characters. str1 = 'schoolmaster!', str2 = 'the classroom'" }, { "from": "gpt", "value...
glaive
[ { "from": "human", "value": "I am trying to perform text analysis on a dataset of tweets posted by federal politicians. I need to find out how federal politicians talked about the coronavirus pandemic on Twitter. The dataset includes the content of the tweets, the user IDs that posted these tweets, their po...
sharegpt
[ { "from": "human", "value": "How can I generate an SQL query to retrieve the 3 most recent orders for a specific customer?" }, { "from": "gpt", "value": "<think>\nOkay, let's see. The user wants to generate an SQL query to get the 3 most recent orders for a specific customer. Hmm, I need to thin...
evolcodegolf
[ { "from": "human", "value": "In the realm of quines, an intron (or payload) is a segment of a quine that does not contribute to producing output yet is nevertheless present within the data section. For instance:\n\n```javascript\nfunction quine() {\n const data = \"function quine() {\\n const data=\\\...
codefeedback
[ { "from": "human", "value": "Create a program to encrypt or decrypt a given text using a chosen cipher technique.\n\nThe Caesar cipher is a substitution cipher where each letter in the plaintext is shifted a certain number of positions down the alphabet. For example, with a shift of 1, A would be replaced b...
magicoder
[ { "from": "human", "value": "You are given a code snippet that manipulates a vector of pairs of integers, `ans`, and performs certain operations based on the values of `M` and `N`. Your task is to implement a function that simulates the behavior of the given code snippet and returns the final state of the v...
glaive
[ { "from": "human", "value": "You are required to implement a program that performs matrix operations using the xTRSM algorithm. The program should have the following functionalities:\n- Allocate memory for matrices A, B, and X.\n- Initialize matrices A and B with random values.\n- Copy matrix B to matrix X....
magicoder
[ { "from": "human", "value": "You are tasked with implementing a Python function that processes a list of dictionaries representing statistical data. Each dictionary contains keys \"min_rank\", \"max_rank\", \"avg_rank\", \"stddev\", and \"variance\", with corresponding values representing statistical measur...
dolphin
[ { "from": "human", "value": "port this code to Object Pascal:\n```scheme\n(define (eliminate-maximum dist speed)\n (let ((n (length dist))\n (time-to-reach-city (make-vector n)))\n (do ((i 0 (+ i 1)))\n ((= i n))\n (vector-set! time-to-reach-city i (ceiling (/ (vector-ref dist i) (v...
glaive
[ { "from": "human", "value": "You are tasked with creating a CMake script to add a doxygen target that runs doxygen to generate HTML and optionally LaTeX API documentation for a project. The script should allow for global installation, as well as including it in a project. Additionally, you need to define va...
evolcodegolf
[ { "from": "human", "value": "It is widely recognized among knowledgeable individuals that, in the context of legacy BIOS systems, the smallest boot" }, { "from": "gpt", "value": "<think>\nOkay, so I need to figure out the smallest bootable disk for a legacy BIOS system. I remember that legacy BI...
codefeedback
[ { "from": "human", "value": "Write a function that takes in two lists of numbers as input. The first list represents the coefficients of a polynomial equation, while the second list represents the values to be substituted into the equation. The function should return a new list that contains the results of ...
glaive
[ { "from": "human", "value": "You are tasked with creating a shader program in GLSL (OpenGL Shading Language) version 330 that takes in a color and a texture, and outputs the resulting color after applying the texture to it.\n\nThe input to the shader program includes:\n- vec4 vColor: the color input\n- vec2...
codefeedback
[ { "from": "human", "value": "You are tasked with implementing a generic relationship mapping system in C#. The system should allow for defining relationships between different entity types and provide a mechanism for accessing related entities.\n\nYour task is to create a class `RelationshipMap` that can st...
dolphin
[ { "from": "human", "value": "convert this code to Lisp:\n```haskell\ncheckStraightLine :: [[Int]] -> Bool\ncheckStraightLine xs = all (\\(x1, y1) (x2, y2) -> dx * (y2 - y1) == dy * (x2 - x1)) $ zip xs (tail xs)\n where dx = xs !! 1 !! 0 - xs !! 0 !! 0\n dy = xs !! 1 !! 1 - xs !! 0 !! 1\n```" }, ...