source
stringclasses
6 values
conversations
listlengths
2
2
evolcodegolf
[ { "from": "human", "value": "Your objective is to devise an intricate Tetris strategy that meticulously balances the trade-off between the score accrued and the size of the code utilized. In this rendition of the game, tetrominoes will be rotated and dropped from a position above into a rectangular grid com...
evolcodegolf
[ { "from": "human", "value": "You are given a sentence composed of phrases separated by punctuation (such as \"Hello! What a wonderful day, isn't it?\"). Your task is to determine and return the median length of the phrases in the sentence, where a phrase is defined as a continuous sequence of alphabetical c...
evolcodegolf
[ { "from": "human", "value": "You are faced with a substantial quantity of heavy boxes and your objective is to arrange them into the minimal number of stacks feasible. A significant constraint is that you cannot place more boxes on top of a box than it is capable of supporting; thus, heavier boxes must occu...
glaive
[ { "from": "human", "value": "How can I modify the provided JavaScript code to log a message in the console when the window is resized?" }, { "from": "gpt", "value": "<think>\nOkay, the user wants to modify their existing JavaScript code to log a message when the window is resized. Let me think a...
sharegpt
[ { "from": "human", "value": "Create a function 'removeLetters' that takes a string and removes all instances of a given letter from it. The function should have a time complexity of O(n) and a space complexity of O(n), where n is the length of the string. The function should not use any built-in functions o...
codefeedback
[ { "from": "human", "value": "Compose a loop in PHP language that conducts a mathematical computation to find the accumulative total of each individual integer element encompassed within this predetermined array: [2, 3, 8, 9]." }, { "from": "gpt", "value": "<think>\nOkay, I need to write a PHP lo...
codefeedback
[ { "from": "human", "value": "You are tasked with creating a Python function that converts UTM (Universal Transverse Mercator) coordinates to latitude and longitude. UTM is a global map projection system that divides the Earth into a series of zones, each 6 degrees of longitude wide. The function should take...
evolcodegolf
[ { "from": "human", "value": "Challenge \nGiven two non-negative integers a and b, where a is less than b, provide a comprehensive listing of all sovereign nations from the extensive compilation of the Top 100 Countries ranked by land area, for which the geographical" }, { "from": "gpt", "value"...
evolcodegolf
[ { "from": "human", "value": "You find yourself in a culinary environment governed by an unusual stipulation: each time an ingredient is incorporated into a pot, you are mandated to introduce at least one novel component. This implies that while you can successfully combine pasta, oil, salt, and then pesto, ...
sharegpt
[ { "from": "human", "value": "What is the code to generate an optimized machine learning model for a given dataset using Python?" }, { "from": "gpt", "value": "<think>\nOkay, the user is asking for code to generate an optimized machine learning model in Python. Let me break down what they need. T...
glaive
[ { "from": "human", "value": "I want to create a message format using proto3 in C#. The message should contain a list of agent information, a map of agent information, and environment statistics. Can someone provide a complete example of how to define this message format in proto3 and then implement it in C#...
glaive
[ { "from": "human", "value": "I need to create a program that uses Apache Thrift to define a service with the following requirements:\n\n- Define a struct named ThriftArgs with two fields:\n - Field 1: a 32-bit integer named 'a'\n - Field 2: a 32-bit integer named 'b'\n\n- Define a struct named ThriftReply...
evolcodegolf
[ { "from": "human", "value": "The intriguing scenario of 100 Prisoners and a light bulb presents a captivating conundrum that you may have encountered in various puzzle exchanges or discussions. Should this puzzle be unfamiliar to you, I highly recommend exploring the details of 100 Prisoners and a Light bul...
glaive
[ { "from": "human", "value": "You are tasked with creating a React component for a home page. The component should have the following functionalities:\n- When the component mounts, if the hash in the props is '#/', it should add a class 'home-background' to the body element and play a video.\n- When the comp...
magicoder
[ { "from": "human", "value": "You are tasked with creating a program that can parse and extract function signatures from a given source code. A function signature consists of the function name, its parameters, and return type. The function signature should be extracted in a specific format.\n\nYou are given ...
codefeedback
[ { "from": "human", "value": "You are tasked with implementing a class that represents a simple shopping cart. The class should have the following functionalities:\n\n1. Add items to the cart with a specified quantity.\n2. Remove items from the cart.\n3. Calculate the total cost of all items in the cart.\n4....
evolcodegolf
[ { "from": "human", "value": "PARI/GP serves as an open-source computational algebra system specifically tailored for the intricacies of (algebraic) number theory rather than the whimsical practice of code golfing, which only adds to its unique appeal. As anticipated, it excels in tackling various mathematic...
glaive
[ { "from": "human", "value": "You are tasked with creating a hydra menu in Emacs using the origami package. The hydra menu should have the following keybindings and actions:\n- Keybinding \"t\": Toggle origami node recursively\n- Keybinding \"u\": Undo origami action\n- Keybinding \"r\": Redo origami action\...
sharegpt
[ { "from": "human", "value": "I am trying to append data to an existing table using the pandas function `df.to_sql()`. The issue I am encountering is that my table has primary keys and I keep getting duplicate entry errors. I have set `if_exists='append'` in my code, but I would like to do the equivalent of ...
dolphin
[ { "from": "human", "value": "port this code from Scheme to Lisp:\n```\n(define (find-redundant-directed-connection edges)\n (let ((n (+ (length edges) 1))\n (parent (make-vector (+ (length edges) 1) 0))\n (candidateA #f)\n (candidateB #f))\n (do ((i 0 (+ i 1)))\n ((= i (lengt...
codefeedback
[ { "from": "human", "value": "Write an SQL query to find the names and hire dates of all employees who have \"Programmer\" as their job title and have been working for more than 5 years, considering current date is October 1, 2022." }, { "from": "gpt", "value": "<think>\nOkay, let's tackle this S...
magicoder
[ { "from": "human", "value": "You are tasked with implementing a time formatting function in Java. The function should take four integer parameters representing the day, hour, minute, and second, and return a formatted string representing the time in the format \"dd:hh:mm:ss\", where \"dd\" represents the da...
sharegpt
[ { "from": "human", "value": "How can I retrieve the top three most reviewed products using a SQL query?" }, { "from": "gpt", "value": "<think>\nOkay, I need to figure out how to write a SQL query that retrieves the top three most reviewed products. Let's start by understanding the problem. The u...
codefeedback
[ { "from": "human", "value": "You are given a code snippet that manipulates a 3D array `function_array` using NumPy operations. The array represents a mathematical function and is indexed by `n` and `m`. The code snippet performs operations to update the values of `function_array` based on certain mathematic...
glaive
[ { "from": "human", "value": "You are working on implementing the Abel-Ruffini theorem in your programming project. The theorem states that if an element is solvable by radicals, then its minimal polynomial has a solvable Galois group. You need to create a function to check if an element is solvable by radic...
evolcodegolf
[ { "from": "human", "value": "In this engaging strategic game, participants utilize their military forces to confront the armies of rival players, seize territories, and strive to emerge as the ultimate victor. Each round begins with players receiving a predetermined quantity of armies, but this base number ...
magicoder
[ { "from": "human", "value": "You are tasked with implementing a function to find the first occurrence of a given value within a blob of data. The blob is represented as a contiguous block of memory, and the function should return the position of the first occurrence of the value within the blob. If the valu...
codefeedback
[ { "from": "human", "value": "Could you provide me with a method to transform an array of individual text elements into a unified, singular textual entity using Python, with consideration to instances where the string elements may carry unique identifiers or special characters?" }, { "from": "gpt", ...
evolcodegolf
[ { "from": "human", "value": "Devise an intricate program or function that exclusively accepts a string comprised solely of the characters ^ and v, with the assurance that no extraneous characters will be present. As you process this string from left to right, it delineates the specific sequence of mouse cli...
codefeedback
[ { "from": "human", "value": "Compose a SQL directive that establishes a fresh database table designated as \"users\" and incorporates an exemplary user data entry." }, { "from": "gpt", "value": "<think>\nOkay, I need to compose a SQL directive to create a new table called \"users\" and insert an...
glaive
[ { "from": "human", "value": "You are tasked with implementing a notification service using the following data structures and interfaces:\n\n1. Define a data structure for a Notification, which includes an id, name, subject, creation and update timestamps, period, frequency, channel, status, and template id....
magicoder
[ { "from": "human", "value": "You are tasked with creating a Python function that processes a given configuration dictionary and extracts specific information from it. The configuration dictionary contains various settings for a machine learning experiment, including the name of a pretrained model, and the o...
evolcodegolf
[ { "from": "human", "value": "Challenge \nMotivated by the intricate patterns observed in this challenge and the tumultuous effects of Hurricane Matthew, we will be engaging in the dynamic generation of intricate lightning bolt structures. \nn = 15: \n \\ \n /\\ \n / \\ \n / / \n/\\ /\\ \n /...
sharegpt
[ { "from": "human", "value": "Consider the provided Python code, can you ascertain the expected output considering the specific integer values assigned to variables a, b, c and the multiple conditional statements and the arithmetic operations applied?\n\n```python\na = 7\nb = 3\nc = 5\n\nif a % b == 0:\n ...
glaive
[ { "from": "human", "value": "How can I design a machine learning algorithm to predict the future sales of a product using the scikit-learn library?" }, { "from": "gpt", "value": "<think>\nOkay, so I need to design a machine learning algorithm using scikit-learn to predict future sales of a produ...
evolcodegolf
[ { "from": "human", "value": "Task \nConstruct a straightforward regex as a non-empty regular expression that includes solely \n\ncharacters 0 and 1, \ngrouping parentheses ( and ), \nand the one-or-more repetition quantifier +. \n\nGiven a non-empty string comprised exclusively of 0s and 1s, your progra...
glaive
[ { "from": "human", "value": "You need to create a Python class that simulates an event loop, similar to the one provided in the given code snippet. The event loop should support adding and removing file descriptors, modifying file descriptors, and running periodic callbacks. The event loop should use the 'e...
glaive
[ { "from": "human", "value": "I need to create a new project in Vivado and add some specific IP cores to it. I want to use the Xilinx Vivado tool to create and manage the project. Can someone provide me with the code to create and map the project, as well as add the necessary IP cores to it?" }, { "f...
evolcodegolf
[ { "from": "human", "value": "I would greatly appreciate any insightful tips specifically tailored for golfing in Erlang. My goal is to gather detailed advice that applies exclusively to Erlang, distinct from Elixir, which I recognize has its own set of recommendations. Please ensure that each piece of advic...
codefeedback
[ { "from": "human", "value": "You are tasked with implementing a simple reactor management system for a nuclear power plant simulation. The system should allow for the addition, removal, and disposal of reactors. Reactors are represented by instances of the `Reactor` class, which has a unique identifier and ...
sharegpt
[ { "from": "human", "value": "How can I create a web interface using Flask that allows staff to search for an employee's records?" }, { "from": "gpt", "value": "<think>\nOkay, the user wants to create a web interface with Flask for staff to search employee records. Let me break down what needs to...
sharegpt
[ { "from": "human", "value": "How can I create a Python program that can identify whether a character is uppercase, lowercase, or a digit?" }, { "from": "gpt", "value": "<think>\nOkay, I need to create a Python program that can tell if a character is uppercase, lowercase, or a digit. Let's think ...
codefeedback
[ { "from": "human", "value": "Rewrite the given function without using the ternary expression and without using any built-in mathematical functions or operators. Additionally, the rewritten function must have a time complexity of O(1). The function should now also handle negative numbers and must output the ...
sharegpt
[ { "from": "human", "value": "How can I design and write a Java program that reverses the elements of an input array of integers?" }, { "from": "gpt", "value": "<think>\nOkay, so I need to design a Java program that reverses an input array of integers. Hmm, let's think about how to approach this....
glaive
[ { "from": "human", "value": "You are tasked with implementing a module that performs error calculations and mapping operations for quadrature signals in a digital communication system. The module must include the following functionalities:\n- Generation of reference levels for calibrating slicing due to unk...
sharegpt
[ { "from": "human", "value": "I just discovered that when I run the query \"SELECT 1 / 1000000;\", it returns 0 instead of the expected decimal value. This is causing issues in my program that involves VAT calculations. Is there a way to set the default number of decimals without having to modify every singl...
dolphin
[ { "from": "human", "value": "translate this code from Perl to Rust:\n```perl\nsub hasPath {\n my ($maze, $start, $destination) = @_;\n my @dirs = ([0,1],[0,-1],[1,0],[-1,0]);\n my @q = ($start);\n while (@q) {\n my ($x, $y) = @{shift @q};\n return 1 if $x == $destination->[0] and $...
dolphin
[ { "from": "human", "value": "translate this code from ANSI C to Swift:\n```c\n#define MOD 1000000007\n\nint numFactoredBinaryTrees(int* arr, int arrSize){\n long long dp[arrSize];\n long long ans = 0;\n int i, j;\n qsort(arr, arrSize, sizeof(int), cmpfunc);\n for(i = 0; i < arrSize; i++){\n ...
glaive
[ { "from": "human", "value": "I am using the jmoiron/sqlx library in my Go applications to communicate with my PostgreSQL server. In one part of my code, I have the following query:\n\n```go\nsqlQuery := `\n INSERT INTO table_to_insert (\n code,\n status,\n create_time,\n crea...
evolcodegolf
[ { "from": "human", "value": "Introduction \nThe well-known \"Die Hard with a Vengeance\" water jugs puzzle challenges the two heroes to obtain exactly 4L of water in a 5L container, provided an unlimited supply of water and another container of 3L. This problem has a viable solution because the target valu...
magicoder
[ { "from": "human", "value": "You are given a Python script that processes a tab-separated input file and performs certain operations based on the values in the input. The script reads each line of the input file, splits it into a list of values, and then checks conditions based on specific elements of the l...
dolphin
[ { "from": "human", "value": "translate this code to c++:\n```rust\npub fn check_numbers_increasing(s: &str) -> bool {\n let mut last_num = -1;\n for word in s.split_whitespace() {\n if let Ok(num) = word.parse::<i32>() {\n if num <= last_num {\n return false;\n ...
dolphin
[ { "from": "human", "value": "translate this code from Object Pascal to c++:\n```pascal\nfunction largestValsFromLabels(values: array of Integer; labels: array of Integer; numWanted: Integer; useLimit: Integer): Integer;\nvar\n items: array of record\n value: Integer;\n label: Integer;\n...
magicoder
[ { "from": "human", "value": "You are tasked with implementing a Swift class that manages user authentication for a mobile application. The class, named `UserAuthManager`, should handle the storage and retrieval of user credentials, as well as the validation of user input. The class should have the following...
glaive
[ { "from": "human", "value": "You are tasked with creating a programming solution to implement a class for handling unit links in a PI system. The class should have the following requirements:\n- The class should be named PIUnitClassLinks.\n- The class should have a constructor function that takes in four pa...
glaive
[ { "from": "human", "value": "You are tasked with creating a service that checks the status of various systems using the NCTSConnector. The checkStatus method should return a valid status response when the systems are healthy, and an error response when an error occurs. The status response includes the statu...
magicoder
[ { "from": "human", "value": "You are given a list of integers. Write a function `max_prod_three` to find the maximum product that can be obtained by multiplying three integers from the list.\n\nFor example, given the input list `[5, -2, 3]`, the maximum product that can be obtained by multiplying three inte...
glaive
[ { "from": "human", "value": "You are tasked with implementing a function that creates a new instance of a `log` node, which is a type of a `NodeDefinition` used for logging the value of a target node every time it emits a new value. The function should take a `NodeLike` or `NodeDefinition` as a parameter an...
evolcodegolf
[ { "from": "human", "value": "Given a sequence of lowercase letters, perform the following intricate tasks:\n\nFor each character, ascertain the prime factorization corresponding to its index within the English alphabet. For every identified prime factor, denoted as p, construct a diamond shape with a side l...
sharegpt
[ { "from": "human", "value": "How do I develop a game AI to play a classic Atari game using Python?" }, { "from": "gpt", "value": "<think>\nOkay, I need to figure out how to develop a game AI to play a classic Atari game using Python. Let me start by recalling what I know about AI and game develo...
sharegpt
[ { "from": "human", "value": "Are there any differences in semantics between using the \"sub\" and \"add\" instructions in programming? Is one of them likely to be faster under specific circumstances?" }, { "from": "gpt", "value": "<think>\nOkay, so I'm trying to figure out if there's any semanti...
evolcodegolf
[ { "from": "human", "value": "Qat serves as a powerful utility designed for searching words that conform to specific patterns, which is particularly beneficial for individuals engaged in crossword construction and word puzzle resolution. In this undertaking, your task will be to create a designated segment o...
sharegpt
[ { "from": "human", "value": "I've been using discord.py for my project and everything was running perfectly until I got an error out of nowhere. The error is: `TypeError: __new__() got an unexpected keyword argument 'deny_new'`. This error pops up in my PyCharm console. I haven't made any changes to my code...
glaive
[ { "from": "human", "value": "I have a string and I want to generate another string that contains only the unique characters from the original string. How can I achieve this using Python?" }, { "from": "gpt", "value": "<think>\nOkay, let's see. The user wants to take a string and create another s...
sharegpt
[ { "from": "human", "value": "Can you provide a Python program that prints out the Fibonacci series up to a given number?" }, { "from": "gpt", "value": "<think>\nOkay, I need to write a Python program that prints the Fibonacci series up to a given number. Let's see... The Fibonacci series starts ...
sharegpt
[ { "from": "human", "value": "How can I configure a Docker container to use matplotlib.pyplot?\n\nI'm currently using a specific Python setting in a Docker image named 'deep'. In order to run my Python code, I use the following command:\n\n```\ndocker run --rm -it -v \"$PWD\":/app -w /app deep python some-co...
sharegpt
[ { "from": "human", "value": "Calculate the scalar product of two vectors and print the result. The vectors can have a maximum length of 10^6. The vectors must contain only positive integers. The program should handle the case where one or both vectors are empty. Vector1: [1,2,3,4,5,6,7,8,9,10]. Vector2: [11...
magicoder
[ { "from": "human", "value": "You are tasked with implementing a custom data loader for a computer vision project using PyTorch. The goal is to create a DataLoader class that loads images from a specified dataset path and performs batch processing with shuffling. Your task is to complete the implementation o...
codefeedback
[ { "from": "human", "value": "Create a regular expression pattern to find all words ending with \"able\" that are preceded by a digit, followed by a punctuation mark, and are not part of a larger word. Additionally, ensure that the word \"able\" is not immediately followed by another word starting with the s...
codefeedback
[ { "from": "human", "value": "Write a SQL query for selecting all the people who were born after January 1st, 1960, have a last name that starts with the letter 'S', and have at least one child who was born after January 1st, 2000." }, { "from": "gpt", "value": "<think>\nOkay, I need to write a S...
codefeedback
[ { "from": "human", "value": "Help me create a parallax effect using this SVG on a webpage.\n<svg width=\"32\" height=\"32\" viewBox=\"0 0 32 32\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M14 12H9.97817C9.36099 12 8.77838 12.2849 8.39946 12.7721L2.84259 19.9167C2.29649 20.6188 2 21.4829...
glaive
[ { "from": "human", "value": "You are tasked with creating a simple web application using Flask framework in Python. Your application should have a single route that displays a basic HTML page. The HTML should include a form with a submit button. When the form is submitted, the data should be sent to the ser...
glaive
[ { "from": "human", "value": "I'm using the CodeDom to allow custom scripts (C#) to be run in an application I'm creating. While writing the script, I would like to be able to check for compile errors. The code gets added to and compiled into memory at a much later time and run, so I don't want the assembly ...
evolcodegolf
[ { "from": "human", "value": "Devise a sequence of 7 assembly instructions (totaling 28 bytes) that effectively implements a logical equivalent of the following C code snippet: \nc = a + b + 6; \nwhile (c > 5) { \n c = c - a; \n b = b + 1; \n} \n \nIt is imperative to adhere to specific restrictions...
codefeedback
[ { "from": "human", "value": "Use the given JSON data to create a function that returns the number of males in the dataset. However, the function should ignore any individuals whose age is less than 20 or greater than 40. Additionally, the function should be implemented with a time complexity of O(log(n)), w...
evolcodegolf
[ { "from": "human", "value": "Calculate the value of x(1/n) for given integers where 0 < x < 10106 and 0 < n < 106, ensuring the computation is completed within a strict timeframe of 15 seconds (on TIO or your own computer) while adhering to a memory limit of 1GB. Additionally, you must validate that the com...
evolcodegolf
[ { "from": "human", "value": "A superabundant number is defined as an integer n that establishes a novel upper limit concerning its ratio with the divisor sum function σ. Specifically, an integer n qualifies as superabundant if, for every positive integer x that is less than n, the following inequality holds...
sharegpt
[ { "from": "human", "value": "How can I create a Ruby program that groups a list of numerical input by a given range?" }, { "from": "gpt", "value": "<think>\nOkay, I need to create a Ruby program that groups a list of numerical inputs by a given range. Let me think about how to approach this. \n\...
glaive
[ { "from": "human", "value": "How can I retrieve the oldest customers from a customer table using a SQL query?" }, { "from": "gpt", "value": "<think>\nOkay, so I need to figure out how to retrieve the oldest customers from a customer table using SQL. Let me start by understanding what exactly is ...
magicoder
[ { "from": "human", "value": "You are tasked with creating a web application that displays a log of database table changes. The application uses PHP with the CakePHP framework for the backend and HTML for the frontend. The provided code snippet is a part of the HTML table that displays the details of a speci...
sharegpt
[ { "from": "human", "value": "I need help developing a function in Python that can convert a binary string into decimal, hexadecimal, and octal numbers. Can you also explain how to handle possible errors such as non-string inputs, non-binary digits in the string, and strings that exceed the length limit? It ...
codefeedback
[ { "from": "human", "value": "I have a question for estimating factor return. I’ve found that there seems to be 2 methods for estimating factor return.\nFirst, with return of an asset i(r_i) and factor loadings such as PER, EPS, Momentum etc(B_i), factor return can be estimated by doing regression - cross se...
evolcodegolf
[ { "from": "human", "value": "In the richly crafted universe of Skyrim, the protagonist wields formidable mystical invocations known as Thu'ums to fulfill various objectives. Each invocation comprises a triad of words, yet the character possesses the option to utilize merely the initial or second word, there...
glaive
[ { "from": "human", "value": "You are tasked with creating a program that validates an XML file against an XSD schema. The program should read an XML file and use XML validation to check if it complies with the specified XSD schema. If the validation fails, the program should display the validation error mes...
magicoder
[ { "from": "human", "value": "You are tasked with implementing a function to calculate the total number of internal sectors in a given 2D grid. An internal sector is defined as a contiguous area of the grid that is completely surrounded by filled cells. The grid is represented as a 2D array of characters, wh...
magicoder
[ { "from": "human", "value": "You are tasked with creating a Python function that processes a given configuration dictionary to extract and manipulate metadata related to a SQLAlchemy database engine. The function should take the configuration dictionary as input and return a modified version of the dictiona...
evolcodegolf
[ { "from": "human", "value": "You will be provided with a collection of radii, and your task is to calculate the area of the minimal rectangle that can encompass circles of these radii. For instance, given the input list [5,3,1.5], the expected output would be 157.460. The accompanying diagram illustrates th...
glaive
[ { "from": "human", "value": "You are tasked with implementing a function in Lean programming language that takes in two natural numbers m and n, and returns true if the function f defined as f(x) = 4^x + 6^x + 9^x satisfies the condition f(2^m) divides f(2^n), where m and n are both greater than 0 and m is ...
evolcodegolf
[ { "from": "human", "value": "Your laboratory is tasked with simulating the evolutionary process of a specific cell across a 2D grid space over a defined period. Below is an example of a 2D grid configuration showcasing a single cell positioned at the center of the grid.\n\n```\n0 0 0 0 0\n0 0 0 0 0\n0 0 1 0...
dolphin
[ { "from": "human", "value": "Please explain the following problem in detail and provide code in Dart:\nYou are given a sorted integer array `arr` containing `1` and **prime** numbers, where all the integers of `arr` are unique. You are also given an integer `k`.\n\nFor every `i` and `j` where `0 <= i < j < ...
dolphin
[ { "from": "human", "value": "convert this code to Perl:\n```R\nmaxHeight <- function(cuboids) {\n cuboids <- apply(cuboids, 1, sort)\n cuboids <- cuboids[order(cuboids[,1], cuboids[,2], cuboids[,3]),]\n \n n <- nrow(cuboids)\n dp <- rep(0, n)\n ans <- 0\n \n for (i in 1:n) {\n dp[i] <- cuboids[i,...
glaive
[ { "from": "human", "value": "How can I import helper functions in Python test files without creating packages in the `test` directory? I am currently doing this via importing a module inside my project's `test` directory, but I'd like to use some other mechanism if possible. I want my `test` directory to co...
sharegpt
[ { "from": "human", "value": "Create a function that takes in a list of integers and returns the average of all the prime numbers in the list. The function should ignore any non-integer values in the list. If there are no prime numbers in the list, the function should return -1." }, { "from": "gpt", ...
magicoder
[ { "from": "human", "value": "You are tasked with creating a Python class that manages a library of forms for user authentication. The class should allow for the addition and retrieval of different forms, such as login and registration forms. Each form should be associated with a unique identifier and should...
glaive
[ { "from": "human", "value": "You are tasked with implementing a REBOL 3 program that performs various arithmetic operations on two integer values. You need to create functions for addition, multiplication, subtraction, and squaring of integers. The program should also have a function to append two strings a...
evolcodegolf
[ { "from": "human", "value": "\"Execute a segmentation operation on a two-dimensional array of integers along the line where the cumulative sum of the absolute disparities of the 'separated' neighboring elements is minimized.\nExample\nConsider the following matrix:\n 1 2 -4\n 5 -1 3\n 2 -2 0\n\nThis matr...
evolcodegolf
[ { "from": "human", "value": "You suddenly find yourself atop a giant, intricate game of checkers that stretches as far as the eye can see. The exit beckons from the far side, but the journey is perilous. You are approached by four checkers: a Red, a Black, a King, and a Queen. Each offers you a means of tra...
evolcodegolf
[ { "from": "human", "value": "A centered polygonal number is a positive integer that corresponds to the count of vertices of a point enclosed by (successively larger) regular polygons, each having an identical number of sides, as depicted below. For instance, \\$p_5(3) = 1 + 5 + 10 + 15 = 31\\$ exemplifies a...
magicoder
[ { "from": "human", "value": "You are tasked with implementing a function that will parse a given HTML file and extract the classes of all the div elements with the \"col-lg-6\" and \"col-md-6\" classes. The function should return a list of unique class names found in these div elements.\n\nFunction Signatur...
codefeedback
[ { "from": "human", "value": "Suggest a valid select statement to display the name, age, salary, and department of the youngest employee who has a salary greater than $50,000, has been with the company for at least 5 years, and is not a manager. Additionally, the query should be optimized to have a time comp...