instruction_seed stringlengths 29 40.5k | source stringclasses 6
values |
|---|---|
You are tasked with creating a Dart function that takes in a list of errors from the analysis server engine and returns a list of AnalysisErrors. The function should map the engine errors to server errors, handling any severity overrides and filtering out errors with null severity. It should also construct AnalysisErro... | glaive |
You are tasked with creating a Windows Forms application that displays a progress bar, a label, and a cancel button. The progress bar should indicate the progress of an ongoing operation, the label should display relevant text, and the cancel button should allow the user to cancel the operation.
Create a form with the... | glaive |
You are tasked with creating a social networking context within a software application using the Strange framework. The social context will involve creating and managing user tiles, friend lists, and handling game completion events. Additionally, you need to implement the integration with social media services such as ... | glaive |
I'm working on a Rails application and I need to check if a URL provided by a user is a valid URL. I'm specifically interested in URLs with the HTTP protocol (and possibly HTTPS). I'm wondering if there is a built-in feature in Rails that can handle this for me. If not, can someone recommend a regular expression that c... | glaive |
You are tasked with implementing a subroutine in Fortran, called "turbl_tl", which calculates the Tangent linear of the "turbl" subroutine. The subroutine takes in several input arguments, including arrays of real numbers representing temperature, pressure, potential temperature, wind components, and other variables. I... | glaive |
You are tasked with creating a custom filter for an Android camera application that will invert the colors of the input image, essentially creating a negative effect. The filter should take the input image, invert the colors, and output the modified image. Your task is to implement the necessary code to achieve this fu... | glaive |
You are tasked with tuning a Forest model for multiple benchmark datasets using SAS programming. The goal is to optimize the Forest model for each dataset by adjusting various hyperparameters. The datasets include Banana, Breast Cancer, Diabetes, German, Image, Ringnorm, Splice, Thyroid, Twonorm, and Waveform. The Fore... | glaive |
You are tasked with creating an Elixir module to manage and interact with a cloud-based Memcached service. The module should include functions to create and manage Memcached instances in the Google Cloud Platform (GCP). Your task is to implement the necessary functions to achieve this.
Write an Elixir module that incl... | glaive |
You are tasked with creating a Dockerfile for a Python application. The Dockerfile should use the Alpine version 3.13 as the base image and should include the following steps:
1. Copy the requirements.txt file from your local directory to the /opt/app directory in the Docker container.
2. Set the working directory to /... | glaive |
You are tasked with creating a module in Erlang to decode error codes for a PostgreSQL database. The module should take a binary error code as input and return the corresponding error code as specified in the code snippet. You need to implement the `decode/1` function to achieve this functionality. | glaive |
You are tasked with testing the properties of addition, numerals, multiplication, exponentiation, power of sum, negation, and complicated expressions using the `ring_exp` tactic in Lean programming language. You need to create a program that verifies the associativity, commutativity, and distributivity of these operati... | glaive |
I am working on a web application using Clojure and Reitit for routing. I need to create a function that takes a route key and returns a relative URL for that route. The URL should be able to be used in HTML links. The function should be able to handle different combinations of parameters and query strings. Can someone... | glaive |
You are tasked with implementing a workaround for a bug in a compiler, specifically LLVM bug 39427. The bug affects the assembly output of the compiler, and this trio of files provides a workaround for the issue.
Your task is to create a set of files that implement the workaround for the bug. This involves setting the... | glaive |
You are tasked with creating a program in Zig that takes Markdown input and converts it to HTML. The program should be able to handle various command line options and extensions, and should use different memory allocation strategies based on whether it is in debug or release mode. Additionally, the program should be ab... | glaive |
You are tasked with creating a module in Erlang that handles purging of documents from a database. The module must include functions for emptying purged documents, purging all documents, starting a sequence of purging, and handling repeated purging of documents.
You need to implement the following functions:
1. `cpse_... | glaive |
Why am I unable to set a global variable in Python? I am experimenting with global variables, and I understand they are not recommended for use, but I'm still curious. I tried to set a global variable with the following code:
```python
G = None
def foo():
if G is None:
G = 1
foo()
```
When I run this cod... | glaive |
You are tasked with creating a CMake custom target to format and style check all C++ source and header files in a project directory using clang-format. The project directory contains subdirectories for source code and test files. You need to remove a specific file named "json.hpp" from the list of files to be formatted... | glaive |
I need help writing a Bash script that can reverse a given string. Can someone provide me with a solution? | glaive |
You are tasked with implementing a 4-bit Carry Lookahead Adder (CLA) block in Verilog. The module should take 4-bit inputs a and b, along with a single-bit carry-in (c_in), and produce a 4-bit sum along with a single-bit carry-out (c_out). The CLA block should consist of a ripple carry adder (adder_rc_4) and a generate... | glaive |
You are tasked with creating a web application that displays a list of rental records and allows users to perform various operations such as updating, deleting, and selecting individual records. The data is fetched from a backend server and displayed on an HTML page using JSP and JSTL.
Your task is to write the JSP co... | glaive |
You are tasked with implementing a function that checks if a given term is a translated call of `(mv-let)`. In translated form, `(mv-let (var1 ... varn) mv-term body-term)` is represented as:
```
((lambda (mv)
((lambda (var1 ... varn) body-term-trans)
(mv-nth '0 mv)
...
(mv-nth '... | glaive |
I am developing a Python project and I need to create a virtual environment to manage the dependencies of my project. I want to write a script to automate the process of creating and activating a virtual environment. The virtual environment should be created in a specific directory and the script should set the PATH en... | glaive |
You are tasked with creating a time-locked mini vault ERC20 contract in Solidity. The contract should include a function `defineWithdrawStatusLastAtTest` that accepts three parameters: an ERC20 token, a beneficiary address, and a timestamp. The function should update the withdrawal status for the specified token and be... | glaive |
You are tasked with creating a messaging interface generator using the given code snippet as a reference. Your task is to write a program that takes input from a file and generates a messaging interface based on the input. The program should parse the input file and generate code for datatype, message, enumeration, and... | glaive |
You are tasked with creating a function in the emailbuilder package that generates a unique Message-ID for an email. The Message-ID should be in the format "<randomID@golangmail.this>", where randomID is a randomly generated hexadecimal string. Your function should use the crypto/rand package to generate a secure rando... | glaive |
You are tasked with creating a program that reads a file containing binary strings and performs certain operations on the data. The file contains multiple lines of binary strings, and your program needs to calculate the frequency of '0's and '1's at each position across all the strings. You will then use these frequenc... | glaive |
What is a JavaScript method that can be used to add two numbers together? | glaive |
You are tasked with implementing a TextBuffer struct in Zig that facilitates text editing. The TextBuffer should support the following operations:
1. Initialization of the buffer with a given string.
2. Clearing the buffer.
3. Inserting a codepoint at a given index.
4. Appending a codepoint to the end of the buffer.
5.... | glaive |
You are tasked with creating a web application using the Eix framework. Your application should include the following components:
- A quick and flexible routing engine
- A powerful XSL-based templating system
- A fast and effective ORM-like persistence layer for your object hierarchy
- A deceptively simple request/resp... | glaive |
You are tasked with creating a module in Elixir to handle a response for listing notification channel descriptors. The module should include a function to decode the response and a function to encode the response. The response should include a list of monitored resource descriptors supported for a specified project, wi... | glaive |
I am trying to create a Vue component that renders an iframe with a specified URL. The component should take in a required prop called "url" which is the URL of the iframe content. The iframe should have a width of 560px and a height of 315px, with the frameborder set to 0, and allow attributes for autoplay, encrypted ... | glaive |
You are tasked with creating a web application using Java and Struts framework. The application should display a different message depending on whether a user is logged in or not. If the user is logged in, the application should display "Logged in as: [user email] | Logout", and if the user is not logged in, it should ... | glaive |
I am trying to find the X protocol C-language Binding (XCB) library in my C++ project. I need to define the XCB_INCLUDE_DIR, XCB_LIBRARIES, and XCB_FOUND variables to be able to use the library in my code. The library should be found in the standard include directories such as /usr, /usr/local, or /opt/X11, and the lib... | glaive |
You are tasked with creating a program that utilizes MPI, CUDA, and NCCL to implement multiple devices per thread. The program needs to perform the following tasks:
1. Initialize MPI and determine the rank and size of the process.
2. Calculate the localRank based on the hash of the hostname.
3. Allocate memory for send... | glaive |
I need to retrieve all rows from a MySQL database where the date falls between October 30th and December 11th. The year doesn't matter as long as the date falls within this range. How can I achieve this? | glaive |
I'm having trouble with the final part of my assignment. I have a stream of bits and within that stream is an integer representing the number of 1's in the text portion. I have successfully obtained this integer, which is 24. Now, I need to loop through the text data and count all the 1's in it. However, my procedure i... | glaive |
You are tasked with creating a CMake macro to handle the inclusion of the Vulkan library in a C++ project. The macro should find the Vulkan library, define a preprocessor macro if Vulkan is found, include the Vulkan headers, link the Vulkan libraries, and also handle the inclusion and linking of the glslang library if ... | glaive |
What is an example of a JavaScript comparison function that takes two parameters and returns a boolean value based on the comparison? | glaive |
You are tasked with implementing a Verilog module that instantiates a c_addsub_3 core from Xilinx. The core is a 16-bit adder/subtractor with synchronous reset and enable. The core has five ports: A (16-bit input), B (16-bit input), CLK (input clock), CE (input clock enable), and S (16-bit output). Your task is to crea... | glaive |
You are given a set of rotation matrices that describe the rotation of a 3D object in space. Specifically, you have three rotation matrices: rotX, rotY, and rotZ. Each of these matrices takes an angle (in radians) as input and outputs the corresponding rotation matrix.
You need to implement a function rpy(rr, pp, yy) ... | glaive |
You are tasked with creating a function that adds test cases to a testing context. The function should add various test cases for standalone applications and build files. Additionally, the function should consider the current operating system and architecture to add specific cases accordingly. Your task is to implement... | glaive |
You are tasked with creating a function in the `schema` package in InfluxDB 2.0 that returns a list of tag keys for all series that match a given predicate. The function should take in three parameters: `bucket` (string), `predicate` (function), and `start` (duration). The `predicate` parameter should default to `(r) =... | glaive |
You are tasked with creating a batch script that will copy specific files from one directory to another directory. The script should be able to copy the following files:
- ca.crt
- server.crt
- server.key
- All .cfg files
- rtp_msg_server.db
- All .exe files
- All .dll files
You should create a batch script that can b... | glaive |
How can I create a GUI application that visualizes a dataset and allows me to select points and visualize the change they create? | glaive |
You are tasked with implementing and verifying a hardware module that performs multiplication. The hardware module is a contrived 32-bit multiplier circuit that has two main components: a booth-encoding component that computes partial products, and an adder component that adds these partial products, appropriately shif... | glaive |
You are tasked with implementing a key-value store using the given Thrift API specifications. The key-value store should support the following operations:
1. Set a key-value pair in the store.
2. Retrieve the value for a given key.
3. Dump all key-value pairs in the store.
4. Set or unset flooding-topo child.
You need... | glaive |
You are tasked with creating a TCL procedure that generates configuration files for a specific hardware device. The procedure should define include files, configuration files, and canonical xparameters for the device. The procedure should take a driver handle as input and use the "xillib.tcl" library to achieve this.
... | glaive |
I'm trying to design a JavaScript code snippet to log all the elements of an array. Can someone help me with this? | glaive |
You are tasked with creating a web application using the Ext JS framework. The application should have a general search functionality where users can input search queries and view the results on the page. The application should also include a feature to save and load search bookmarks. Additionally, the application shou... | glaive |
You are tasked with creating a video player module in Julia with the following requirements:
1. Define an abstract type AbstractVideoBackend to be used in the module.
2. Include a function play() that takes in arguments and keyword arguments to play a video using the video backend.
Write the code for the VideoPlayer m... | glaive |
You are tasked with implementing a page cache (PCache) in C++ using the given code snippet as a reference. The PCache is responsible for managing a cache of pages in memory, including fetching, releasing, making pages dirty or clean, and other related operations.
Your task is to implement the following functionalities... | glaive |
You are tasked with creating a script to run a specific test case for a client testing suite. The script should execute the CommonRunTestCase.cmd file and pass the necessary parameters to it, including the path to the RDP_ClientTestSuite.dll, the test settings file, and the specific tests to be run. Your script should ... | glaive |
You are tasked with creating a class called ZtItemGroup that will handle grouping and organizing items in a system. The class should have the following attributes:
- itemTree: a sequenceable collection to store the items
- label: a string to label the group
You need to implement the following methods for the ZtItemGro... | glaive |
You are tasked with implementing a simple charity system using Substrate's framework. The charity has a pot of funds and allows donations from anyone and also absorbs imbalances from elsewhere in the runtime. Funds can only be allocated by a root call to the `allocate` extrinsic.
You need to implement the following fu... | glaive |
I need to create a module in JavaScript that exports two variables, `PretMinim` and `PretMaxim`, and a variable `Imagine`. Additionally, I need to export a default variable `LiftoffHero`. Can someone provide a solution for this using the import and export syntax in JavaScript? | glaive |
You are tasked with creating a Ruby module that handles environment variables and paths for a logstash application. The module needs to define the following:
- LOGSTASH_HOME as the expanded path of the directory containing the module file
- BUNDLE_DIR as the path to the vendor bundle directory inside LOGSTASH_HOME
- GE... | glaive |
You are tasked with designing a key manager top-level module in SystemVerilog. The key manager module should handle key generation, data input, and various operations related to cryptographic keys. The module interfaces with a variety of input signals and controls, including clock, reset, enable, error signals, and mor... | glaive |
You are tasked with creating a script that will sync files and folders from one location to another using fclone and rclone. The script should prompt the user to select the tasks they want to perform and then execute the selected tasks. After each task, the script should log the status of the backup operation to a file... | glaive |
I want to add clang's sanitizers (address, memory, and thread) to my C++ project's build options. I want to be able to enable or disable each sanitizer individually. How can I achieve this in my CMakeLists.txt file? | glaive |
I have a Python dictionary called `my_dict` with two key-value relationships. I would like to enrich this dictionary by adding three additional key-value relationships. One of the keys should correspond to a list of integers, the second key should be associated with a nested dictionary, and the third key should map to ... | glaive |
What is an optimized solution to find the closest value to a target in a given array using Java? | glaive |
You are tasked with creating a shell script that mounts the EFI System Partition (ESP) and performs various operations on it. The script should check if the target volume exists, handle the case where the target volume is the root of the current system, create a temporary directory on the target volume, mount the ESP t... | glaive |
You are tasked with creating a class in Dart that represents a Private Key for a cryptographic system. The PrivateKey class should have the following functionalities:
- A constructor that takes a BigInt value and ensures that it is less than a predefined value `defaultEc.n`.
- A factory method `fromBytes` that takes a ... | glaive |
I need to create a Jenkins pipeline to perform the following tasks:
1. Create a directory called "output".
2. Create a new file called "file.txt" in the "output" directory with the text "This file is my useful, we need to save it."
3. Create another file called "useless-file.md" in the "output" directory with the text ... | glaive |
I need to create a package in Common Lisp to handle various message types for a line tracing application. The package should include the following message types:
- CMD_STAMPED
- HSV_THRESH
- THETA_STAMPED
I want to define a package that exports these message types and allows for easy integration with the rest of my c... | glaive |
You are tasked with creating a Java class that uses the Jakarta Enterprise context scopes. Specifically, you need to write a class that is annotated with either @jakarta.enterprise.context.ApplicationScoped or @jakarta.enterprise.context.RequestScoped, and ensure that the class is also annotated with @io.micronaut.runt... | glaive |
Is there a standard or accepted method for using API keys for authentication in Flask? I have a small API and I want to add authentication. My goal is to generate API keys for API consumers, which they can then use to include in their requests. Is there a specific Flask library which provides this functionality? I've r... | glaive |
I need to create a function in Elixir that checks if a specific image exists in a given configuration. The function should take the configuration and the image name as input and return true if the image exists in the configuration, otherwise false. | glaive |
You are tasked with creating an install script for a specific directory, and you need to set the install prefix, install configuration name, install component, and handle the installation of shared libraries without execute permission. Additionally, you need to handle the case where the install component is "Unspecifie... | glaive |
You are tasked with creating a protocol buffer message definition for a communication library. The message should define an entry for a helper program, including the filename, device IDs, extra arguments, and variants. The message should also define a manifest that consists of multiple helper entries.
Create a protoco... | glaive |
You are tasked with implementing a data structure for a library management system. The structure should include the following elements:
- ImBitVector
- ImColor
- ImDrawCallback
- ImDrawChannel
- ImDrawCmd
- ImDrawCmdHeader
- ImDrawData
- ImDrawDataBuilder
- ImDrawFlags
- ImDrawIdx
- ImDrawList
- ImDrawListFlags
- ImDr... | glaive |
I am trying to determine the compiler to use for ASM programs in my CMake project. I want to set the compiler based on certain conditions, such as environment variables or specific compiler lists. Additionally, I need to handle cases where the compiler identification is unknown and find the assembler based on certain p... | glaive |
You are tasked with setting up a C++ project using CMake and need to define certain variables and paths in the CMakeLists.txt file. You need to set the set of languages for which implicit dependencies are needed, specify the set of files for implicit dependencies of each language, set the C++ compiler ID, define the in... | glaive |
You are tasked with setting up a minimal working environment for a project using Docker and Docker Compose. Your task is to create a Dockerfile and a docker-compose.yml file to set up the environment for a simple use case. The minimal setup should include the necessary configurations and dependencies to get the project... | glaive |
I need help generating a Bash script that can perform a set of tasks listed in the input. Can anyone provide a solution? | glaive |
You are tasked with creating a program that emits a gemstone for a client. The program should be able to initialize for a specific client and emit the gemstone for that client.
Write a program that takes in a gemstone client as input and emits a gemstone for that client. | glaive |
You are tasked with creating a React component for a timeline body/grid. The component should take in the following props: width, columnWidth, height, rowHeight, rowCount, grid_ref_callback, cellRenderer, shallowUpdateCheck, and forceRedrawFunc. The component should render a Grid from the 'react-virtualized' package wi... | glaive |
I am trying to find the full path to the pandoc executable in my program. I want to be able to check if the pandoc executable has been found or not, and if it hasn't been found and is required, I want to display an error message. Can someone help me write the code to achieve this in my program? | glaive |
You are tasked with implementing a shader function in GLSL that calculates the lighting and shadow effects for a 3D scene. The function should take into account the position, normal, and texture coordinates of the fragment being shaded, as well as the properties of the materials and the point lights in the scene. The s... | glaive |
Is there a way to create an SQL query that calculates the total cost of purchases made by each customer in the month of August? | glaive |
You are tasked with implementing a SystemVerilog module for a PCIe Bridge ICAP complex. The module should be intended for use with Xilinx Vivado Simulator (XSIM) only. The module should have input and output ports for AXI interface signals, including clock, reset, address, write data, write strobe, write valid, write r... | glaive |
Is there a way to translate each assembly instruction to its corresponding C statement? I already know that using "gcc -S test.c" converts the entire C code to assembly, but I need a per-instruction translator. Any suggestions? Thank you! | glaive |
I need to create a SAS program that simulates data for a study on quiz scores. The program should generate 45 records, with each record containing 5 quiz scores for either graduate or undergraduate students. The quiz scores should be randomly generated using a uniform distribution and rounded to the nearest whole numbe... | glaive |
You are tasked with writing a script in Windows batch scripting to perform a database restore operation using specific parameters. The script should set the following variables:
- database.name: the name of the database to be restored
- sql.files.directory: the directory where the SQL files are located
- backup.file: t... | glaive |
You are tasked with creating an XSL stylesheet that includes internationalization (i18n) support for a website. The stylesheet should be able to handle different languages, such as Japanese, and provide translations for common terms used in the website content. The i18n support should cover titles, numbers, cross-refer... | glaive |
I am trying to create a Docker image for a DNS load testing tool using Python 3 and Alpine Linux. I have a Dockerfile that includes two stages - the first one is for building the environment and the second one is for the final image. However, when I try to build the Docker image, I encounter an error. Can someone help ... | glaive |
You need to implement a function in Julia that can compose two binary quadratic forms. The function should take two binary quadratic forms as input and return their composition as another binary quadratic form. A binary quadratic form is represented as $ax^2 + bxy + cy^2$, where a, b, and c are coefficients. | glaive |
What is the code for finding the two numbers with the smallest difference in a given list of numbers? | glaive |
You are tasked with creating a batch script that takes in command line arguments and sets specific parameters based on the input. The script should support the following parameters:
- MEM: sets the memory value (default is 64)
- FLAVOR: sets the flavor
- FILENAME: sets the file name
The script should be able to parse ... | glaive |
I want to create a C++ class that can store a character string and compare it with another character string. How can I accomplish this? | glaive |
I am working on a web application that keeps track of a player's score and high score. I need to implement a module in JavaScript that will handle the score increment, score reset, and updating the high score in the local storage. The module should have methods to increment the score, reset the score to zero, and a pro... | glaive |
I am trying to create a tikz picture of a torus using LaTeX, and I want to include the tikz library for calculations. However, when I compile my document, I'm getting an error related to the tikz library path. The error message says "File `tikzlib.tex' not found." Can someone help me understand why this error is occurr... | glaive |
You are tasked with implementing a class that will encrypt and decrypt text using the given framework and technology. The class should have the following functionalities:
- A constructor that takes a key as a parameter
- A method to encrypt the given text using the key
- A method to decrypt the encrypted text using the... | glaive |
What exactly is the difference between saving a pandas dataframe to pickle and to csv in Python? In a tutorial I am following, it outlines two methods to save a pandas dataframe: `pd.to_csv('sub.csv')` to save and `pd.read_csv('sub.csv')` to open, and `pd.to_pickle('sub.pkl')` to save and `pd.read_pickle('sub.pkl')` to... | glaive |
You are working with the ACL2 programming language and need to create a function that takes in a list of numbers and returns the sum of the squares of all the odd numbers in the list. You need to define a function called "sum-of-squares-odd" that takes a list of numbers as input and returns the sum of the squares of al... | glaive |
You are tasked with updating the "gebruikteVoornaam" (used first name) of several persons in a graph using SPARQL. Each person has a unique ID and their current first name needs to be replaced with a new first name. Your task is to write a SPARQL query to delete the current first name and insert the new first name for ... | glaive |
You are tasked with creating a Spring Data repository for Elasticsearch and implementing CRUD operations using the repository. The repository class should provide methods for finding all documents, finding a document by its ID, indexing a new document, and deleting a document.
Your task is to write a Spring Data repo... | glaive |
You are tasked with creating a program that can parse a JSON object representing a folder structure and generate a specific output based on the given data. The JSON object will contain information about a folder, including its ID, name, children (subfolders), filter type, folder name, and other relevant details. Your p... | glaive |
I need help designing a program that can find the first non-repeating character in a given string. Can you provide a solution? | glaive |
I need to create a validatable form using the Comply framework in JavaScript. The form should extend the base validatable form and should be able to validate user inputs based on predefined rules. Can someone provide a complete implementation of a validatable form using the Comply framework, including how to define val... | glaive |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.