instruction_seed stringlengths 29 40.5k | source stringclasses 6
values |
|---|---|
You are tasked with creating a Dockerfile for a Python application using the balenalib/via-vab820-quad-debian:bullseye-run base image. Your Dockerfile should install Python 2.7.18, pip 20.1.1, and setuptools 49.1.0. Additionally, it should set the environment variable LANG to C.UTF-8 and remove several traces of Debian... | glaive |
How can I create an HTML page with buttons that allow users to navigate to different pages? | glaive |
You are tasked with setting up a CMake project to include and build external libraries for a C++ project. The project requires the following external libraries:
1. clang-format for formatting code
2. mocha for nodejs-based interop tests
3. googletest for unit testing
4. BoringSSL for cryptographic functions
5. yajl JSO... | glaive |
You are tasked with creating a PHP configuration file for an API interface. The configuration should include the following parameters:
- 'authentication': a string value for authentication
- 'is_jwt': a boolean value (1 for true, 0 for false) to indicate whether jwt configuration is enabled
- 'jwt_key': a string value ... | glaive |
I am working on a Perl project and need to ensure that my code is properly tested for Pod coverage using the Test::Pod::Coverage module. I want to write a test to check that the Pod documentation for my module is complete. Can someone provide a code example to demonstrate how to use Test::Pod::Coverage to test my Perl ... | glaive |
You are tasked with implementing a function that performs tuple concatenation and multiplication in a programming language that supports metaprogramming.
Write a function that takes in two tuples and concatenates them to create a new tuple. Additionally, implement a function that takes a tuple and a number, and multip... | glaive |
You are working on a web application using the common-ui library and need to create a page to display details of a PCR profile. The PCR profile is a resource from the seqdb-api and contains information about a thermocycler profile. You need to create a React component that renders a form to display the PCR profile deta... | glaive |
I am unsure of what the `cbw` command actually does. I have a snippet of code:
```assembly
mov ax,0FF0h
cbw
idiv ah
```
How does the value of ax change after `cbw`? | glaive |
You are tasked with implementing a smart contract for a bounty system. The contract should allow users to issue bounties, fulfill them, and manage the payouts. The contract should support both ETH and token payments for fulfilling bounties.
Your task is to implement the following functions in the Solidity smart contra... | glaive |
I am working on a project where I need to create a database for user registration and login using C# in Visual Studio 2012. However, I am encountering some issues with my login code. It seems to iterate through all the users in the database and displays a login failure message until it finds the correct user. Can anyon... | glaive |
You are tasked with creating a script to automate the process of packaging and pushing a NuGet package to a remote repository. The script should first delete any existing .nupkg files, then run the "Pack" option on the project in Visual Studio to generate a new .nupkg file. Finally, it should move the newly created .nu... | glaive |
I am facing an issue with storing and retrieving data from Redis cache. The data is being stored by Python and I want to read it in my Rust application. However, when I store a string or an array in Redis, it gets stored in a weird form that I am unable to read into Rust. Similarly, I want to be able to write data from... | glaive |
You are tasked with creating a simple checkers game (with no AI player) using the `games/gl-board-game` library in Racket. The game should allow two human players to take turns moving their pieces on the board. The board should be an 8x8 grid and each player should have 12 pieces. The goal is for a player to capture al... | glaive |
I'm working on a Rails 3 app and I need to check if a translation exists before displaying it. If the translation is missing, I want to fallback to some static text. Currently, I'm using the following code to check if the translation is missing:
```ruby
if I18n.t("some_translation.key").to_s.index("translation missing... | glaive |
You are tasked with creating a script that will take user input for a new version and GPG pass-phrase, then use Maven to update the version, clean, deploy, and aggregate JavaDoc and source files. Additionally, the script should create a distribution zip file containing specific jar and war files. | glaive |
I am developing a configuration parser in OCaml and I need to implement a function to parse an XML configuration file and extract specific parameters. The XML file contains various elements and attributes, and I need to extract the values of certain elements and store them in corresponding variables. Specifically, I ne... | glaive |
I am trying to create a virtual environment for my project using csh. However, when I try to activate the virtual environment using "source bin/activate.csh", I receive an error message saying "deactivate nondestructive". It seems like some irrelevant variables are not being unset properly. Can someone help me figure o... | glaive |
You are tasked with creating a Python script that sets up a virtual environment and activates it with a specific prompt. The script should be able to activate the virtual environment and modify the prompt to indicate the environment name. Additionally, the script should handle deactivating the virtual environment and r... | glaive |
You are tasked with implementing a function that takes an integer `i` and a list `l` as input, and returns a new list where each element of `l` is multiplied by `i`, and if the result is a two-digit number, the tens place is dropped. If the list is empty, the function should return an empty list.
Write a function call... | glaive |
What is the algorithm to calculate the average of a given data set in Python? | glaive |
You are tasked with creating a program that generates a report with specific formatting and content. The report should include the current date and time, page dimensions, margins, font details, and text content in a multi-line string format. The program should be able to accurately render the text as multiple lines on ... | glaive |
I am working on a financial transaction system and need to implement a series of functions to handle the transfer of funds between a buyer and a seller. The system should support depositing and withdrawing funds, as well as verifying signatures and publishing them.
The functions needed are as follows:
1. `begin`: This... | glaive |
You are tasked with creating a PointChooser class in JavaScript using the CocoClass framework. The PointChooser class should have the following functionality:
- The constructor should take in options and set up a shape, add an event listener for mouse clicks, and disable camera dragging.
- The destroy method should rem... | glaive |
How can I create a React component that displays a table with data from an array of objects? | glaive |
I am trying to build a C++ project using CMake, and I want to optimize the build for release. I need to set specific compiler and linker flags to ensure that the release build is efficient and performs well. Can someone provide a CMake configuration that sets the appropriate flags for optimizing the release build of a ... | glaive |
You are tasked with creating a user style for a website to replace the home button with an image of a bunny named Melody. The image should be set as the background of the home button and be clickable to navigate to the home page. Additionally, the style should ensure that the image is properly positioned and aligned wi... | glaive |
You are tasked with implementing a program that uses CUDA to parallelize the computation of prime numbers. The goal is to efficiently determine whether each number from 1 to N (where N is a predefined constant) is a prime number or not. The program will use both the CPU and GPU to compare the performance of the two met... | glaive |
You are tasked with implementing a specialized shape representing a rectangle using the sfml.zig library. Your task is to create a new structure called RectangleShape with the following requirements:
1. The structure should have a constructor function called init that takes a size parameter of type sf.Vector2f and crea... | glaive |
I am trying to create a type of inference command profiles in my programming project. I need to define a module that includes constructors and destructors for this type, as well as functions for adding inferences and merging inference profiles. Additionally, I need a function for pretty-printing the inference profiles.... | glaive |
You are tasked with creating a program that will test whether a file produced matches the expectations. The program should run a specific test program with given arguments and check for any errors. If there are no errors, the program should compare the output file with the expected file and determine if they are identi... | glaive |
You are tasked with writing a SPARQL query to retrieve the sum of the number of accidents, as well as the number of accidents and their types related to a specific district from a given RDF graph. The graph contains information about accidents, their types, and the districts they are related to. Your goal is to write a... | glaive |
Can you provide a regular expression that matches strings starting with a lowercase letter or an underscore? | glaive |
I am working with a dataset that contains tasks and the number of hours per day spent on each task. I want to create a pie chart visualization of this data using SAS. Can someone provide a SAS program to accomplish this task? | glaive |
I am trying to create an authentication system in Clojure using the buddy library. I want to generate a session ID and then create a token for a user when they log in. Additionally, I need to authenticate the token and check if the user is authorized. I also need to handle unauthorized requests with a custom message. C... | glaive |
I apologize if this question shows ignorance or if there's something I'm not aware of. I'm currently working on a project that requires me to read the instructions under a function's address. I have managed to obtain the generated code size of the function by examining the .pdb file generated by the compiler. However, ... | glaive |
You are tasked with implementing a function that swaps the contents of two arrays, x and y, on a GPU using CUDA. The function takes in the following parameters:
- n: Number of elements in the arrays x and y. n >= 0.
- dx: COMPLEX array on GPU device. The n element vector x of dimension (1 + (n-1)*incx).
- incx: Stride ... | glaive |
I am building a game using GameMaker Studio and I need to create a script for a component called "HealthConsumeComponent" that will handle the health consumption logic. The script needs to be placed in the "folders/FaultyECS/Stats/Health/Components.yy" file and should not be marked as DnD or compatibility. Can someone ... | glaive |
In Rails 2, when removing a column with a Rails migration, will it automatically change or remove the associated indexes with the column? If not, is there an automated way to handle this instead of manually changing or removing each index?
Thanks,
A newbie Rails developer | glaive |
You are tasked with creating a CMake file to download a specific version of a library from a given URL, extract the source archive, and then install the necessary files into the appropriate directories. The library version to be downloaded is "498839d41519d38bb81089f7d0f517026bd042cc" from the GitHub repository "https:... | glaive |
You are tasked with creating a SAS macro that generates a sequence of delimited numbers or letters based on a given dash-separated range. The macro should accept a string and a delimiter character, and it should return the delimited individual elements of the requested range. When given a range in the form of "1-5" or ... | glaive |
You are tasked with implementing a function to process a refund for a shipping item in an e-commerce platform. The function should take in the amount to be refunded and whether the full shipping cost should be refunded. If the full refund is requested, the amount parameter should be ignored. The function should return ... | glaive |
You are tasked with creating a program that can parse and process the results of a SPARQL SELECT query serialized as a JSON object. The JSON object represents the head and results of the query, with specific structures and data types defined by the SPARQL standard.
The program needs to handle the following aspects of ... | glaive |
You are given the task of implementing a function to find the proper divisor of a given positive integer. A proper divisor of a positive integer n is a positive integer that is less than n and evenly divides n. The function should return the proper divisor of the input integer, or 0 if there is no proper divisor.
Your... | glaive |
You are working on a project that involves managing the release history of a software package. You need to create a Python program that can parse the release history data and extract certain information from it. Specifically, you need to extract the version number, release date, and release notes for each release.
Wri... | glaive |
I have a date value, "21/10/1999", manually inserted into an SQL database. When I retrieve it using the following code:
```
txtDOB.Text = readPatient["pDOB"].ToString();
```
It displays the date along with the time "12:00:00 AM". However, the data type for my date column is "date", not "datetime". Why is it displayin... | glaive |
You are tasked with creating a shader program that applies a specific transformation to the UV coordinates of a 3D model in a WebGL application. The transformation should involve flipping the y-axis of the UV coordinates and maintaining the x-axis as is. You need to write a shader program that takes in the UV coordinat... | glaive |
I am trying to create a function in R that takes some input data and formats it into a table in LaTeX. The function should have the following features:
- Ability to save the table to a file
- Option to show or hide certain columns in the table
- Ability to highlight the best values in the table
- Formatting of numerica... | glaive |
You are tasked with implementing a topological vector bundle in a programming language that supports noncomputable theory, open locale classical, and topological space. The task involves constructing the pullback bundle for a map `f : B' → B` whose fiber map is given simply by `f *ᵖ E = E ∘ f`. You need to define the t... | glaive |
What is the bash script solution to perform a backup of the /var/www directory? | glaive |
You are tasked with writing a program that automates the creation of bug report and feature request files for a list of software packages. The program should iterate through the list of package names, create new bug report and feature request files for each package, and populate them with the appropriate content.
You ... | glaive |
You are tasked with creating a function in TypeScript that calculates the average of a set of numbers. The function should take an array of numbers as input and return the average as a double.
Create a TypeScript function called "calculateAverage" that accepts an array of numbers as a parameter and returns the average... | glaive |
Can you provide an AI-generated code to solve a Fibonacci sequence using recursion in Python? | glaive |
You are tasked with implementing a solution in Java using the JOGL (Java Bindings for OpenGL) library to create a dynamic buffer for untextured objects. The solution should involve creating a program that initializes a vertex array and multiple buffers for storing vertex and index data, as well as transformation matric... | glaive |
You are tasked with creating a PowerShell function that lists the aliases imported by a module. The function should take a parameter for the name or path of the module to inspect, defaulting to the project path and project name if no input is provided. The function should import the module and then return a list of the... | glaive |
I am working on a C++ project and I need to incorporate the Google Test framework for unit testing. Can someone please provide a step-by-step guide on how to integrate Google Test into a C++ project using the FetchContent feature in CMake? I need to clone the Google Test repository from GitHub and make it available in ... | glaive |
You are tasked with creating a PowerShell function to update the configuration of a server using the Azure PowerShell module. The function should take in parameters such as the server configuration name, resource group name, server name, and subscription ID. It should also allow for identity parameter input and represe... | glaive |
Can you provide a function that takes a dictionary of items and their prices as input, and calculates the total cost of all the items? | glaive |
I am developing simple RESTful APIs using appengine and golang. When I start the service using goapp serve, the code works fine. However, I am encountering a panic error with the message "appengine: NewContext passed an unknown http.Request" when I try to run "goapp test". It seems that I am unable to pass the request ... | glaive |
I have a vector in my program and I need to write a function that takes this vector and an item as input, and then returns a new vector with the item inserted at the specified index. Can someone help me write a function to achieve this in a vector-lib framework? | glaive |
You are tasked with implementing a function in Common Lisp that performs K-normalization on a given form. K-normalization is a process that transforms an abstract syntax tree into a specific form that simplifies the subsequent stages of compilation.
The function takes a single argument, `form`, which represents the in... | glaive |
You are tasked with implementing a CUDA kernel for the SpatialClassNLLCriterion in C++ using the THCUNN library. The kernel should update the output and the gradient input.
The kernel should take into account the input, target, weights, size_average, batch_size, n_classes, map_nelem, blocks_per_sample, and ignore_inde... | glaive |
You are tasked with implementing a CUDA kernel that adds two 2D arrays and returns the result. The arrays are of size 32x16, and you need to ensure that the addition is performed in parallel using CUDA. The main function should allocate memory for the arrays on the device, copy the arrays from the host to the device, l... | glaive |
How can I create a Java servlet to store user data in a database table? | glaive |
I'm working on an IvyBridge and I want to test the L1d cache organization. From my understanding, the L1d cache on IvyBridge has a capacity of 32K, 64B cache line, and is 8 way set associative. This means that it has 64 sets. I also understand that I can compute the set index for a given main memory address using the f... | glaive |
You are tasked with creating a function in Lua that takes in a player's name as an argument and prints out their information if they are an admin. The function should iterate through all players and compare their names with the input name. If there is a match, it should print the player's name, SteamID, money, and bank... | glaive |
You are tasked with creating a VHDL context declaration for a testbench for CTU CAN FD IP Core. The context should include the necessary library and use statements for various agents of the testbench. The agents include can_agent_pkg, clk_gen_agent_pkg, interrupt_agent_pkg, mem_bus_agent_pkg, reset_agent_pkg, timestamp... | glaive |
You are tasked with creating a program in Excel VBA that can determine the application in which an object was created by using the Creator property. Your program should be able to return a 32-bit integer that indicates the application in which the object was created. If the object was created in Microsoft Excel, the pr... | glaive |
You are tasked with creating a message passing system within a simulation framework. The goal is to implement a system where agents can communicate with each other using messages, and ensure that the message variables are correctly defined and accessible. You need to define the message structure, create and access mess... | glaive |
You are tasked with creating a Dockerfile to build an image for a specific application. The Dockerfile should install necessary dependencies and set up the environment to run the application. Your Dockerfile should include the following:
- Update and upgrade the package list using apt-get
- Install the following packag... | glaive |
You are tasked with implementing a benchmarking module for list commands in the context of a key-value store. The module should be able to perform various operations on lists, such as popping, pushing, indexing, range retrieval, removal, setting, and trimming. The module must also be able to initialize and quit the ben... | glaive |
How can I create a SwiftUI application for a basic calculator that supports arithmetic operations and allows swiping between views? | glaive |
I recently responded to a question about developing for the iPhone in non-Objective-C languages, and someone brought up an interesting point. They asked if it's possible to determine the language a program is written in just by looking at its binary. I want to know if there are any methods to do this. Let's assume that... | glaive |
I am trying to understand how the option_map and list_map functions work in Standard ML. Can someone provide a detailed explanation and a practical example of how to use these functions? I am particularly interested in understanding how to use the option_map function to map a function over an option type, and how to us... | glaive |
You are tasked with implementing the Stage D ("decode") module of the "Flute_V3" CPU. This module is responsible for decoding instructions and generating the appropriate output based on the input data. Your task is to create the BSV module `mkCPU_StageD` which includes the interface `CPU_StageD_IFC` and implements the ... | glaive |
I am trying to set up my development environment for a project using Microsoft Visual Studio and Harbour. I need to create a batch file that sets some environment variables and then compiles the code using the specified libraries. However, I am having trouble with setting the environment variables and compiling the cod... | glaive |
What is the difference between the modes 'a', 'a+', 'w', 'w+', and 'r+' in the built-in open function in Python? The documentation implies that all these modes allow writing to the file, and states that it opens the files for "appending", "writing", and "updating" respectively, but does not explicitly define these term... | glaive |
You are tasked with creating a smart contract in Solidity that manages a decentralized platform called PolyAlpha. The contract should handle user registration, profile management, attention bidding, and messaging functionalities. The contract should also allow the owner to update and transfer sub-contracts if needed.
... | glaive |
I am trying to create a simple game using a Ruby gem called DragonRuby. In this game, the player controls a character that needs to avoid obstacles and earn points by passing through them. However, I am facing an issue with the collision detection between the player character and the obstacles. I need to implement a fu... | glaive |
You are tasked with implementing a custom matcher for RSpec that checks if a given object satisfies a certain predicate. The custom matcher should be able to handle composable aliases, gracefully compose with other matchers, and handle scenarios where the predicate returns true, false, or nil. The matcher should also h... | glaive |
You are tasked with creating a function in Clojure that takes in a list of test files and runs the tests for a specific namespace using the doo library. The function should be able to dynamically run tests for any given namespace within the list of test files. | glaive |
You are tasked with creating a program that calculates the probability and visualizes the results for a quantum system with 14 qubits. The program should calculate the probability of measuring the system in a certain state, and then visualize the probability distribution in 3D and as a contour plot.
Your program shoul... | glaive |
I'm trying to send raw post data, such as unparameterized JSON, to one of my controllers for testing purposes. However, when I try to do this in my ActionController::TestCase, I'm getting a "NoMethodError: undefined method `symbolize_keys' for #<String:0x00000102cb6080>" error. Can someone please guide me on the correc... | glaive |
You are tasked with creating a module in Elixir that defines a data structure and methods to work with HTTP request bodies. The module should have the following features:
- Define a struct with fields for content_type, data, and extensions
- Implement a method to decode a binary message into the struct
- Define fields ... | glaive |
I am trying to enable CUDA language in my project and I want to check if a specific compiler flag is supported. I need to verify if the flag "-DFOO" is accepted by the CUDA compiler. If it is not supported, I need to handle the error appropriately. | glaive |
You are tasked with implementing a DRM Activator module in Verilog for simulation. The DRM Activator module has several parameters that need to be set for simulation only. The parameters are as follows:
1. USE_BFM: This parameter should be set to 1 for RTL simulation and 0 for synthesis and co-simulation.
2. DRM_LICENS... | glaive |
You are tasked with creating a schedule module in OCaml that takes a list of assignments and produces a schedule. The schedule should consist of either individual assignments, a sequence of assignments, or parallel assignments. The schedule module should have the following types and functions:
Type:
- schedule: a type... | glaive |
I need to create a function in Common Lisp that rounds a given number to the nearest multiple of a specified divisor. The function should take two parameters - the number to be rounded and the divisor. The output should be the rounded number.
Can someone provide a Common Lisp implementation for this functionality? | glaive |
You are tasked with creating a program that generates various strings used throughout a library. These strings include directory names, file templates, status messages, and error messages. The program needs to be able to handle localization and include mnemonics for monikers. Your task is to write a program that can ge... | glaive |
You are tasked with creating a language module in XML format for a specific language. The module should include models, facets, generators, dependencies, and language versions. The module should also have a unique namespace and UUID. Your task is to write the XML code for the language module according to the given spec... | glaive |
I am trying to fetch an external project using CMake's FetchContent module, but I am encountering some issues. Can someone guide me on how to use FetchContent_Declare to specify the external project and its repository? Additionally, I need to know how to set options to configure the fetched project, such as building ex... | glaive |
You are tasked with creating a router that routes requests based on a configurable `Key`. The router must provide a strategy for routing a Request to a Service. Implementors must provide a `Key` type that identifies each unique route. The `recognize()` method is used to determine the target for a given request. This ta... | glaive |
You are tasked with creating a web application using Haskell and the Wai Raven authentication protocol. Your application should include routes for different endpoints and handle various types of requests. Additionally, you need to implement functionality to send a request to the authentication server and display the re... | glaive |
You are tasked with creating a major mode for editing programs written in the Factor programming language. This major mode should provide support for indenting and font-locking. It should also handle various syntactic constructs that are often split over multiple lines and provide multiline font-locking. The mode shoul... | glaive |
I am trying to implement a function to create a map using the Red-Black tree data structure in Lean. The map should be able to store key-value pairs, where the keys are of type Nat and the values are of type Bool. The map should support operations like insertion, finding a key, checking if a key exists, and iterating t... | glaive |
I am working on a project where I need to create a program that can remove a specific file and all its contents from the file system. I want to be able to do this using a programming language that supports file manipulation. Can someone provide me with a solution to achieve this? | glaive |
You are tasked with creating a pipeline for processing DNA sequence data. The pipeline will take in input parameters and a set of reads in fastq format, along with a reference genome in fasta format, and then produce a result file containing information about the alignments, variations, and consensus sequence.
The pip... | glaive |
You are working with the PoreMatMod package in a Pluto.jl notebook and need to perform a specific set of operations on crystal structures and moieties. Your task is to write a Julia code that accomplishes the following:
1. Define paths for crystals and moieties using the `realpath` function.
2. Create a parent crystal... | glaive |
You are tasked with creating a service in the "go tera" and "java tera" namespaces that allows for getting and putting key-value pairs in a database. The service should include methods for retrieving a value based on a table and key, as well as for inserting or updating a key-value pair in the database. The key-value p... | glaive |
You are tasked with implementing a gRPC service for managing releases of a helm application. Your task is to create a service with the following functionalities:
- ListReleases: Retrieve release history with the ability to filter by release status.
- GetReleaseStatus: Retrieve status information for a specified release... | glaive |
You are required to create a program that generates RISC-V assembly language instructions based on specific constraints and configurations. The program should be able to handle trap handling, stack management, and memory protection. Additionally, it should be able to generate a sequence of random RISC-V instructions, a... | glaive |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.