instruction_seed stringlengths 29 40.5k | source stringclasses 6
values |
|---|---|
You are tasked with creating a Perl script that automates the process of running tests for an application. The script will need to handle various modes of operation, including running all tests, running only selected tests, and running code coverage tests. Additionally, the script must be able to handle different confi... | glaive |
You are tasked with implementing a CUDA function in C++ that multiplies the elements of two input tensors and stores the result in a third tensor. If the input tensors are the same, the function should multiply each element by a specified constant value. If the input tensors are different, the function should resize th... | glaive |
You are tasked with creating a communication ring buffer unit test using the OmniThreadLibrary project. Your goal is to write a program that tests the functionality of the TOmniMessageQueue class. The program should include the following steps:
1. Create a new instance of the TOmniMessageQueue with a capacity of 100.
2... | glaive |
You are tasked with implementing a new trait called `Decode` for a given programming framework. The `Decode` trait is responsible for decoding a specific type from a byte stream. The trait should provide a method `decode_with` which takes a byte and a reader, and returns the decoded value. The byte is used to determine... | glaive |
You are tasked with implementing a Lua script that manages a task queue in a Redis database. The script needs to retrieve a set number of task sets from the queue and update their status in the database based on certain conditions. Each task set is represented by a key in the Redis database and contains various attribu... | glaive |
I am working with a dataset that consists of multiple rows, each containing a different number of integers. I need to find the maximum value in each row and then calculate the sum of these maximum values. Can someone help me write a program to accomplish this task? | glaive |
A soccer team has twice as many defenders as midfielders, and three times as many forwards as defenders. The total number of both defenders and midfielders is 18, while the total team member count including forwards is 30. How many defenders and forwards are there in the team? | glaive |
You are tasked with creating a Python service that communicates with a backend service to execute Python console scripts, retrieve variable values, and evaluate expressions. The service must be able to handle multiple lines of code, provide code completions, and handle array responses. Additionally, it should be able t... | glaive |
You are tasked with creating a webpage layout using HTML and CSS. The layout should include a header, a main content area, and a footer. The header should have a pink background with white text, and the main content area should have a specific image as the background. Additionally, the main content area should have a s... | glaive |
You are provided with a dataset containing 11 chemical attributes of red wine, as well as the quality of the wine based on evaluations by wine experts. Your task is to explore the dataset, analyze the relationships between the chemical attributes and wine quality, and build a predictive model to determine the most infl... | glaive |
I'm trying to clear the screen in my simple 16-bit real mode operating system. Below is the code:
```
clearScreen:
pusha
mov ah, 0x7
mov al, 0
int 0x10
popa
ret
```
I read that setting `al` to 0 and calling the scroll screen interrupt would clean the screen but it only seems to change the co... | glaive |
You are tasked with creating an XML-based language model using JetBrains MPS, with specific dependencies and language versions. Your task is to create a new language namespace with a unique UUID, language version, and module version. Additionally, you need to define the source root location and the facet type for the g... | glaive |
I am trying to set up a generic csh script to put a specific directory into the path. I want to be able to evaluate the variable $PROD_DIR and then source the setup.common script from that directory. However, I am currently encountering an issue and the $PROD_DIR variable is being unset. Can someone provide a solution ... | glaive |
You are tasked with creating a script that will monitor a specific file for any changes and then copy the updated file to a new location. The script should be able to detect any changes made to the file and then automatically copy the updated version to a specified destination.
Create a script using bash that takes th... | glaive |
You are tasked with creating a WPF application that includes a Window with multiple ListBox controls. The application should have a class called MyData that inherits from ObservableCollection of type String. The MyData class should have a constructor that adds three string items to the collection.
Your task is to crea... | glaive |
You are tasked with implementing a Verilog module for an AXI clock converter. The module must include the following ports and connections:
- Input wire s_axi_aclk
- Input wire s_axi_aresetn
- Input wire [15 : 0] s_axi_awid
- Input wire [63 : 0] s_axi_awaddr
- Input wire [7 : 0] s_axi_awlen
- Input wire [2 : 0] s_axi_aw... | glaive |
Write a Python program to parse a WEPP soil input file made using USDA-SCS Soil-5 (1992) database. The program should be able to extract the soil name, texture, and other relevant parameters from the input file and display them in a readable format. Additionally, the program should be able to handle different types of ... | glaive |
You are tasked with creating an Erlang module that handles the management of IP sets using the `minuteman_ipsets` module. The module should be able to start the server, initialize the state, handle call and cast messages, and handle all non-call/cast messages. The specific requirements for each function are detailed in... | glaive |
I'm trying to develop a Node.js code to create a HTTP server. Can someone provide me with an example of how to do this? | glaive |
You are tasked with writing a program to retrieve data from a graph database and apply filters to the results. The program should retrieve all triples from a specified graph, with a specific URI as the subject. It should also retrieve an optional comment for the specified URI, if available. Additionally, the program sh... | glaive |
You are tasked with creating a program to manage sprite frames for a game. Each frame contains information about the sprite's dimensions, position, and images associated with it. Your program needs to be able to handle the creation, modification, and retrieval of sprite frames, as well as image manipulation within each... | glaive |
I am looking to create a bash script that will recursively sync the contents of three different directories. The script should sync the contents of the "D2MPClient" directory from one location to the "d2mpclient" directory, the "D2MPClientInstaller" directory from another location to the "d2mpclientinstaller" directory... | glaive |
I want to create a mobile application menu with a floating action button that expands and collapses when clicked. The menu should have a list of items that expand from the top to bottom when the FAB is clicked and collapses back when the FAB is clicked again. Additionally, I want the menu items to change color when hov... | glaive |
You are tasked with creating a script that sets and manages a list of message and service files in a programming project. The script should be able to add new files to the list, remove existing files, and display the current list of files. You are given a programming project using a shell script, and you need to implem... | glaive |
You are tasked with implementing a function in OCaml that will take a Clambda.ulambda expression and perform two key operations: substitution and elimination. The Clambda.ulambda expression represents a linear identifier and its defining expression.
The function must first identify which expressions are linear and can... | glaive |
You are tasked with creating a simple web application using Laravel. The application should have a navigation bar with a brand name, a dropdown menu for user authentication, and a main content area. The dropdown menu should display the user's name and have an option to log out. The application should also include a CSR... | glaive |
I want to create an HTML web page with a Navbar that displays a few elements. How can I achieve that? | glaive |
You are tasked with creating a web-based calendar application using HTML, CSS, and JavaScript. The calendar should have the following features:
- Display events with different categories such as chill, info, important, and success, each with a distinct background color
- Highlight the current day when hovered over, usi... | glaive |
You are tasked with creating an online shopping website using Java with Struts framework. The website should have a navigation bar with product categories, gender, and price filters. When a user selects a category or filter, the website should display the products accordingly. Each product should have an image, product... | glaive |
You are tasked with implementing an extended Minimum Independent Set (MIS) algorithm for graph aggregation. The goal is to create partitions of a given graph such that nodes within the same partition have a limited number of neighbors in other partitions. The algorithm should be able to handle a large number of nodes a... | glaive |
You are tasked with creating a CMake clean rule for a specific language in a C++ project. The clean rule should remove specific files and directories from the build directory. You need to create a CMake script that will handle the clean rule for the given language. | glaive |
How can I transform a scipy sparse csr matrix from sklearn.preprocessing.OneHotEncoder back into my original pandas dataframe along with other columns? I tried using pd.concat but I get a TypeError: cannot concatenate a non-NDFrame object. | glaive |
I am trying to retrieve data from an RDF dataset using SPARQL query. I have an RDF graph with information about product offers, reviews, and their details. I want to fetch all the reviews for a specific product, along with their title, text, review date, publish date, and rating details. Can someone help me write a SPA... | glaive |
I am a beginner in Rails and I am trying to run a demo from this GitHub repository: [https://github.com/rubytaiwan/jobs.ruby.tw](https://github.com/rubytaiwan/jobs.ruby.tw). However, when I run the command `bundle`, I encounter an error. The error message I receive is:
```
An error occurred while installing mysql2 (0.... | glaive |
You are tasked with creating a plugin for Envisage that presents preferences with two different extension points: PREFERENCES and PREFERENCES_PAGES. The first extension point is for programmatic access to preferences, while the second one is for displaying UIs to the user in the workbench plugin. Your task is to create... | glaive |
:
You are tasked with creating a class that visualizes drawables in a GUI application using the osu! framework. Your task is to implement a DrawVisualiser class with the following features:
1. The DrawVisualiser class should be an OverlayContainer and should contain a TreeContainer and a CursorContainer.
2. It should ... | glaive |
You are tasked with implementing a CUDA CC (Connected Components) solver using the given code snippet as a reference. The goal is to create a program that can efficiently find and compress connected components in a graph using CUDA parallel computing.
The program should take as input a graph represented by its edges a... | glaive |
You are tasked with implementing a VHDL entity and architecture for a system reset module. The module needs to have the following ports:
- slowest_sync_clk: input, STD_LOGIC
- ext_reset_in: input, STD_LOGIC
- aux_reset_in: input, STD_LOGIC
- mb_debug_sys_rst: input, STD_LOGIC
- dcm_locked: input, STD_LOGIC
- mb_reset:... | glaive |
You are tasked with creating a ViewModel class for a dogs app using Kotlin and the Android Architecture Components library. The ViewModel should observe changes in the list of dogs from a repository and update the UI accordingly. You need to define the DogsViewModel class with the following requirements:
- It should ha... | glaive |
You are tasked with implementing a series of functions using Haskell that involve higher order functions, lambdas, and function composition. Each function must be implemented using either a lambda or a partially applied function as specified. Here are the specific functions you need to implement:
1. Write a lambda or p... | glaive |
You are tasked with creating a new weapon for a first-person shooter game using the ArcCW (ArcCW - Firearms: Source 2) framework. The weapon is a double-barrel shotgun called "BM-16" and needs to be implemented with the following specifications:
- The weapon should use 12 Gauge ammunition.
- It should have a damage of ... | glaive |
You need to create a Lua program that simulates a console interface with the following functionalities:
- Accepting user input and evaluating it as Lua code
- Setting the output format to either YAML or Lua
- Setting a custom delimiter for input
- Connecting to a remote instance for evaluation
- Providing auto-completi... | glaive |
You are tasked with creating a web form using Spring MVC to allow users to add a description for a category. The form should include a label for the description input field and a submit button. You need to ensure that any errors in the form submission are displayed in a red message box. Write the necessary Java code an... | glaive |
I am trying to create a Cypress helper function that will allow me to run a series of commands in a specific order. The commands must be executed one after the other, and I need to ensure that the application under test is stable before executing each command. Additionally, I need to be able to handle errors and failur... | glaive |
You are tasked with creating a PowerShell script that retrieves scheduled tasks and their schedules from a Windows system. The script should be able to handle scenarios where a task does not exist, support wildcards, and compare expected and actual task properties. The script should also be able to handle multiple sche... | glaive |
You are working on a graphics program in OpenGL with version 420. You need to write a shader program that calculates the lighting for a 3D object. The program should take into account the camera, material, and light properties to determine the final color of the object. You are required to implement the main function t... | glaive |
You are required to implement a MaxPool layer using CUDA for a neural network library. The MaxPool layer is used for down-sampling the input along the spatial dimensions, which reduces the computational load and controls overfitting. The code snippet provided includes the CUDA kernels `MaxPoolForwardImpl` and `MaxPoolB... | glaive |
You are tasked with implementing a module in Erlang that will handle topic metrics for an MQTT broker. The module should be able to register, deregister, and maintain metrics for different topics. It should also be able to calculate and provide metrics such as messages in, messages out, messages dropped, and messages d... | glaive |
You are tasked with creating a CMake build system that includes code coverage analysis for a project. The project requires the use of LCOV for code coverage reporting. Your task is to implement a CMake script that checks for the presence of LCOV, enables code coverage compilation flags, and sets up a custom target to g... | glaive |
I need to write a CMake function that downloads a library from a given source and unpacks it into a specified destination directory. The function should check if the library already exists in the destination directory and if not, it should download it from the given source. After downloading, it should unpack the libra... | glaive |
I am working on a Node.js project and need to set up a Dockerfile to install specific dependencies and packages. I want to install Google Chrome, Yarn, and Bower within the Docker container. Can someone provide me with a Dockerfile that achieves this setup? | glaive |
You are tasked with creating a Clojure program that handles encrypted credentials. The program should include functions for encrypting and decrypting credentials, as well as validating the encryption and decryption processes. Additionally, the program should be able to determine the secring path and retrieve the secret... | glaive |
Can someone please explain to me how the `:source` option works in the `has_many/has_one :through` association in Rails? The explanation in the Rails API documentation is not very clear to me.
> "Specifies the source association name used by `has_many`/`has_one` `:through`. Only use it if the name cannot be inferred f... | glaive |
You are tasked with implementing a routing header for an Ethernet packet in a Mesa design. The routing header should contain specific fields such as node, port, CoS, dp, ecn, test, length, pkttype, ctlWord, and reserved. Additionally, you need to define types for internal communication within Mesa, such as VffPacketLen... | glaive |
I need to create a program that uses Apache Thrift to define a service with the following requirements:
- Define a struct named ThriftArgs with two fields:
- Field 1: a 32-bit integer named 'a'
- Field 2: a 32-bit integer named 'b'
- Define a struct named ThriftReply with one field:
- Field 1: a 32-bit integer ... | glaive |
I am working on a project and it won't compile due to a missing assembly. The file that causes the error includes the line `using Microsoft.VisualStudio.DebuggerVisualizers;` and the `VisualStudio` part is highlighted in red. I have Visual Studio installed, so shouldn't this assembly be available? What do I need to ins... | glaive |
What is the difference between using `after_create :after_create` and `after_commit :after_commit_on_create, :on => :create` in Rails? Can these two be used interchangeably? | glaive |
How can I sort the following array [135, 781, 79, 6, 903, 5] in ascending order using the radix sort algorithm? | glaive |
I am trying to check if a specific linker flag, "no-export-dynamic", is supported in my C code. I want to be able to determine if this flag is supported or not so that I can configure my build process accordingly. Can someone provide a way to check for the support of this linker flag in C code? | glaive |
I'm currently developing a little Python website using Pyramid. But I don't know how to design the permission system. The System should be very flexible: I have to establish connections between many different tables. Instead of writing one permission table for every variant i thought to just create one table - I call i... | glaive |
You are tasked with creating a new module in Perl using the Mojo framework. The module should be named JobCenter::MojoClient and should have the following functionality:
- It should be able to connect to a PostgreSQL database using Mojo::Pg.
- The module should be able to create and manage jobs in a job center system.
... | glaive |
You are tasked with implementing a program that generates a sequence of numbers based on the rules of a cellular automaton. The cellular automaton is initiated with a single ON (black) cell and follows "Rule 51". The sequence is read by rows and each number in the sequence is determined by a specific rule. The initial ... | glaive |
I'm encountering issues while trying to install spacy by running `pip install spacy` command on Python version 3.6.1. Earlier, I had the issue of 'cl.exe' not being found, which I resolved by adding the Visual Studio path to the environment variables where cl.exe exists. Now, I'm getting errors like 'Failed building wh... | glaive |
You are tasked with creating a Rust program that involves loading and calling a Rune that does nothing, as well as calling a host function from a manifest. You will need to define and implement the necessary structs and traits, as well as compile a standalone wasm file using the `wasmer` and `hotg_rune_wasmer_runtime` ... | glaive |
I need to create a program that lists the variables in a specified variable list as a table to a file and/or to the Stata log with a value delimiter string and optional begin-line and/or end-line strings. The program should mainly output data to a file which is then input into a TeX table, where the value delimiter is ... | glaive |
I need to create a Least Recently Used (LRU) cache in Clojure using the crux.cache.lru library. The cache should have a specified size and should evict the least recently used item when it reaches its maximum capacity. I also need to implement methods to compute a value if it is not already present in the cache, evict ... | glaive |
I'm trying to figure out how to negate a signed integer in MIPS32. I came across two different approaches. The first one uses the definition of 2's complement like this:
```
nor $t0, $s0, $s0 ; 1's complement
addiu $t0, $t0, 1 ; 2's = 1's + 1
```
Then, I found another way to do it:
```
sub $t0, $zero, $s0
```
I... | glaive |
You are tasked with creating a smart contract in Solidity for a new cryptocurrency token. The token should have the following features:
- The token should have a name and a symbol for display purposes.
- The token should have a total supply that can be initialized upon deployment of the contract.
- The contract should ... | glaive |
You are tasked with creating a SQL view to generate a report on internal standards in a database. The view should include the name, ID, description, number of components, type, mix name, protein collection name, and active status of each internal standard. The view needs to be created using the following tables: T_Inte... | glaive |
You are working on a web application using the Elmish and Bolero frameworks in F#. You need to implement a feature that allows users to input an SQL query and generate test data based on that query. The generated test data should then be displayed on the web page for the user to view. Create a program that initializes ... | glaive |
I am implementing the "Wave Collapse Function" algorithm in Python 2.7 but my implementation is flawed. I am having trouble identifying the problem. The goal of my implementation is to simplify the algorithm, making it easier to understand and closer to pseudo-code. The characteristics of my implementation include usag... | glaive |
Can you provide an example of a Java class that can store user data such as name, address, phone number, and email? | glaive |
How can I create an Angular application with a user authentication system? | glaive |
You are tasked with creating a resource manager class for a game development project. The resource manager should be able to handle localized strings and other resources for the game. You need to create a class with the following functionalities:
- A method to retrieve a cached ResourceManager instance.
- A property to... | glaive |
You are tasked with creating a program that tests for survival metrics that should run both on CPU and GPU. The program should verify metric values over individual data points and aggregate output from the AFT metric over a small test data set. The program should also configure the AFT metric and run interval regressio... | glaive |
You are tasked with creating a CMake clean rule for a specific language. The clean rule should remove all the generated files and directories associated with the language. You need to ensure that the clean rule is included properly and that it effectively removes all the necessary files and directories. | glaive |
You are tasked with implementing a CUDA kernel called TQHistogram_gpu, which takes in several input parameters and performs certain operations on them. The kernel processes a set of tasks stored in multiple queues and updates a histogram based on the data provided. The kernel is responsible for fetching tasks, computin... | glaive |
I have some data that I want to cluster using the k-means clustering algorithm. How can I do this in Python? | glaive |
What is the correct sequence to open a file, print the lines of the file in reverse, and then close the file? | glaive |
You are tasked with automating the generation of a header file `generated_dts_board_unfixed.h` based on information encoded in Device Tree Source (DTS) files. The goal is to create a CMake configure-time process that calls on dtc (device tree compiler), the gcc preprocessor, and a Python script to generate the header f... | glaive |
Can you help me implement a function in Python that calculates the Hamming distance between two strings? | glaive |
You are working on a game development project and need to implement a function to automatically add family members to different tiles on the game map based on certain conditions. The game map is represented by a list of tiles, where each tile has a status indicating whether it is controlled by a player, to be controlle... | glaive |
You are tasked with creating a program that takes in a username as input and then stores it in a variable for later use. The program should be able to handle input from any type of object and store the username in a case-insensitive manner. Your task is to implement a function or method that accomplishes this task and ... | glaive |
You have been tasked with creating a CMake macro that will install a set of JIT (Just-In-Time) files. Each file in the list consists of a pair of paths - the target file path and the existing file path. The macro should take each pair, extract the target file and its path, and install the existing file to the specified... | glaive |
I need to create a program that will solve a series of puzzles in a room. The room contains doors, rooms, objects, and a robot that can perform actions like moving, pushing, carrying, and unlocking. Each puzzle is represented as a set of conditions that must be satisfied to solve it. These conditions include the robot’... | glaive |
I am trying to implement a spiking learning algorithm for a neural network using CUDA in C++. The code snippet provided includes a kernel function `run_spiking_learning` that is supposed to perform the spiking learning on a list of neurons. The kernel function takes in various parameters such as `NeuronList`, `old_devi... | glaive |
I need to write a CMake script that will remove a specific file from my project directory. How can I achieve this using the file command in CMake? I want to ensure that the file is removed from the directory and any subdirectories. | glaive |
I am trying to implement a function in a programming language that checks whether a given polynomial is separable or not. A polynomial is separable if it is coprime with its derivative. I want to create a function that takes a polynomial as input and returns true if the polynomial is separable, and false otherwise. The... | glaive |
You are tasked with implementing an elliptic curve cryptography (ECC) domain parameter for prime239v2. You are required to create a class that extends ECDomainParametersImpl and implements the necessary methods and configurations for the prime239v2 domain. The class should include the necessary constants for q, a, b, G... | glaive |
Why does the calculated width and height in pixel of a string in Tkinter differ between platforms? I have a Python script which calculates the exact size of arbitrary strings displayed in arbitrary fonts to generate diagrams using Tkinter. However, the results seem to be dependent on the version of Python or the system... | glaive |
I am trying to create a genetic algorithm in Clojure to generate a string that matches a target string. The target string is "Hello Clojure World!" and the alphabet I am working with consists of lowercase and uppercase letters, as well as the characters "!" and " ".
I need to implement the following functions:
1. `dif... | glaive |
You are tasked with implementing a graph class in C++ that supports adding edges and retrieving the edges of the graph. The graph should be represented using an adjacency list and should allow for the addition of weighted edges. Additionally, you need to create a function to generate a random graph with a specified num... | glaive |
You are required to implement a CUDA kernel function in C++ for a N-way tree traversal algorithm. The goal is to write a CUDA kernel that takes input data, tree information, and various parameters, and then generates children and leaf masks for each input node. The CUDA kernel function should be able to handle differen... | glaive |
You are tasked with creating a Python script that sets up a package for distribution using setuptools. Your script should include the necessary information such as package name, version, author, email, description, URL, license, keywords, and platforms. Additionally, your script should handle the case where the user is... | glaive |
You are tasked with creating a program that simulates a basic repmgr election test. The program must open three clients of different priorities and ensure that repmgr elects the expected master. It should then shut down the master and make sure repmgr elects the expected remaining client as the master. Finally, it shou... | glaive |
You are tasked with creating a payment gateway class for the Tenpay payment service in PHP. The class should include methods to check if the configuration is set up correctly, build a request form for payment, verify the notification received from Tenpay, and create a signature for the payment parameters. Additionally,... | glaive |
You are tasked with writing a Perl script to scrape a website and extract all the unique URLs that match a specific pattern from the given website. The URLs should be printed to the console in the format "https://example.com".
You are required to use the `Mojo::UserAgent` module for making the HTTP request and parsing... | glaive |
I am trying to set up a virtual environment for my Python project, but I am encountering some issues with the activation script. I want to create an activation script that sets the virtual environment and updates the PATH variable, but I am not sure how to do it properly. Can someone provide a solution for creating an ... | glaive |
You are tasked with setting up implicit dependencies for a project using CMake. The project consists of multiple languages, including CXX. You need to define the set of files for implicit dependencies for each language and also set up the include file search paths, the targets to which this target links, and the Fortra... | glaive |
I need to write a function in a functional programming language that takes a year as input and returns true if the year is a leap year, and false otherwise. A leap year is a year that is evenly divisible by 4, but not by 100 unless it is also divisible by 400. Can someone provide a function that implements this logic? | glaive |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.