instruction_seed stringlengths 29 40.5k | source stringclasses 6
values |
|---|---|
I need to create a progress bar in my Rust program that displays the progress of a loop. However, I also need to include an option to break out of the loop based on user input. Specifically, when the loop counter reaches 5, I want to prompt the user with the message "Break Loop [y/n]:" and if they enter "y", the loop s... | glaive |
You are tasked with creating a Python script to parse and generate documentation from a given directory structure. The script should be able to read the contents of the directory and generate a table of contents that includes the files and subdirectories within the given directory. Additionally, the script should be ab... | glaive |
You are tasked with creating a class that can handle the multiplication of two 3D cubes. The class should use CUDA to handle the multiplication on the GPU, and it should be able to upload and download data to and from the GPU.
You need to implement the following functionalities:
- A class called Function3DMultiplier t... | glaive |
You are tasked with implementing a program that can run a list of tasks in parallel. The program should take a source list of integers and a parallelism value as input, and then execute a given task on each integer in the list concurrently, up to the specified parallelism level. The tasks should return the result of mu... | glaive |
You are tasked with creating a Kubernetes resource for managing SQL database container triggers in Azure. The resource should include the ability to set conditions, handle status, and define the Azure name for the resource. Additionally, the resource should have the capability to convert specifications and statuses fro... | glaive |
You are tasked with creating a SAS program to process an ASCII inpatient stay charges file and load it into SAS. The file contains various revenue codes and detailed charges for each revenue code, as well as units of service for each revenue code.
Your task is to create a SAS program that reads the ASCII file, define... | glaive |
How can I create a web page template with a navigation bar and a two-column layout using HTML and Bootstrap? | glaive |
You are tasked with implementing a TCP socket manager actor that allows other systems to request TCP connections. The socket manager will manage listeners for different ports, accept connections, unwrap SSL sessions (if requested), and pass networked data to requesters.
Your task is to create a struct TcpSocketManager... | glaive |
I am trying to set up a Node.js application using Docker. I want to create a Dockerfile that installs the necessary dependencies and sets up the application to run on port 1337. Can someone provide a Dockerfile that accomplishes this task? | glaive |
You are tasked with implementing a RevokeTokenByQuery feature in a Node.js application using the async, lodash, and ioredis libraries. The feature should allow the user to revoke a token by providing a query, which can include a tag and/or a UUID. When the feature is called, it should create a request with the specifie... | glaive |
You are tasked with creating a CMake script to search for specific Trilinos packages and their corresponding include and library paths. The required packages are Epetra and Teuchos.
Write a CMake script that uses the FIND_PATH and FIND_LIBRARY commands to search for the required packages in the specified search paths.... | glaive |
You are tasked with implementing a service that interacts with a JDBC database. The service needs to be able to create, delete, and retrieve database information, as well as list database names with various options such as prefix, sorting, and pagination.
Your task is to create a class that fulfills the following requ... | glaive |
Is it possible to create a shell script that receives multiple numbers as arguments and calculates their sum? I would like to know if there is a solution to this problem. | glaive |
You are tasked with creating a TView to show the current graphics state in a Turbo Vision application in Pascal. The TView should display various attributes of the graphics state, such as loop, auto_flip, dual, projection, freedom, gep0, gep1, gep2, ins_control, rounding, min_distance, rp0, rp1, rp2, ctrl_val_cutin, sn... | glaive |
I am trying to create a function that can set and get values in a matrix using row and column indices. I want to ensure that the set and get operations work correctly by testing them with random input values.
Can someone help me create a test case for this functionality using Elm programming language and the Chroma.Li... | glaive |
You are tasked with creating a makefile rule to build object files from C source files in a specific directory. The makefile should have a rule that compiles each C file into an object file and also generates a dependency file for each source file. The build command should use the arm-none-eabi-gcc compiler with specif... | glaive |
You are tasked with setting up the build configuration for a C++ project using CMake. The project has several dependencies, preprocessor definitions, include file search paths, and linked info files that need to be properly configured in the CMakeLists.txt file.
You need to define the set of languages for which implic... | glaive |
I need to find the length of a string in Python, but I want to achieve this without using any built-in functions. Can someone provide me with a valid Python code that can accomplish this? | glaive |
You are tasked with implementing a first-in/first-out (FIFO) memory queue generator using Verilog. The FIFO Generator is a parameterizable core that can be used to generate resource and performance optimized FIFOs with common or independent read/write clock domains, and optional fixed or programmable full and empty fla... | glaive |
I have a set of elements {11, 18, 14, 6, 7} and I need to construct a Binary Search Tree (BST) in a way that the order of insertion affects the structure of the tree. I found some code online, but it seems to have some errors. Can you help me debug the code and implement a correct BST construction with order-sensitive ... | glaive |
You are tasked with creating a series of SQL queries to parse the TPC-H dataset, with the following changes to the official syntax:
1. Replace the "set rowcount" with the ANSI standard "fetch first n rows only"
2. Replace the "create view, query, drop view sequence" with a query using a common table expression.
Your t... | glaive |
You are tasked with creating a Kotlin Multiplatform project that requires the use of coroutines for handling asynchronous tasks. You need to define two coroutine dispatchers: Main and Background. The Main dispatcher is used for handling UI-related tasks, while the Background dispatcher is used for performing background... | glaive |
:
You are tasked with creating a web page that includes a form with a dropdown menu, an input field, and a table. The dropdown menu should have a width of 120px, the input field should have a width of 300px and be displayed inline, and the table should occupy the entire width of the page with a font size of 14px. Addit... | glaive |
I am trying to create a class for loading and manipulating character fonts in my program. I want to be able to load a font from a file, destroy a font, and potentially load a font from memory or a stream in the future. Can someone help me create a Font class in Zig that achieves this functionality? | glaive |
You have been tasked with creating a program that will analyze a set of data related to sentient beings. The data is stored in a file and needs to be processed and analyzed to extract meaningful insights. Your task is to write a program that will read the data from the file, perform the necessary analysis, and output t... | glaive |
I need to create a program in Stata that will generate a two-way graph based on the input data. The graph should display the relationship between two variables in the dataset. I need to be able to specify the variables to be plotted on the x and y axes, and I also want to be able to customize the appearance of the grap... | glaive |
I am working on a project that requires handling large files efficiently using Git LFS (Large File Storage). Can someone provide me with a code snippet that demonstrates how to upload a large file to a Git LFS repository using the git-lfs command line tool in a specific version-controlled directory? | glaive |
You are tasked with creating a Dockerfile to build an image that installs the necessary dependencies and tools for setting up an Elixir development environment. The Dockerfile should include the following steps:
1. Update the system and install wget.
2. Download the Erlang OTP source code and install the required depen... | glaive |
You are tasked with creating a new Elixir project that will serve as a web application using the Plug framework. The project should ensure that all requests are served by a single canonical host. You need to define the project configuration, including the app name, version, Elixir version, dependencies, package details... | glaive |
You are tasked with creating a shell script that automates the process of tagging and updating a GitHub repository. The script should take two parameters: the build number and the commit message. It should then create a tag with the format "v0.13.0.build" and update the GitHub repository with the changes.
Write a shel... | glaive |
I need to create a C++ program that uses the type_traits library to define a type that represents a constant integer value. The program should then return the value of this constant integer. | glaive |
I understand that the instructions RCR and ROR are used to rotate bits in different directions, but I'm confused about the difference between them. I know that RCR rotates the bit from the right to the left, taking the bit from the carry, while ROR rotates the bit from the right to the left, taking the bit from the rig... | glaive |
You are tasked with creating a Ruby on Rails application for an e-commerce platform. One of the requirements is to add a new attribute called "google_product_category" to the Product model in the Spree framework. This attribute will be used to store the Google product category for each product. Additionally, you need t... | glaive |
You are tasked with creating a PowerShell function that sends an email using the `Send-MailMessage` cmdlet. The function should take in the following parameters:
- To (required): The email address of the recipient
- CC: The email address of the CC recipient
- BCC: The email address of the BCC recipient
- Subject (requi... | glaive |
I need to create a function that prepares buffers and handles a faulty load in assembly language using the x86 architecture. The function should first prepare the buffers and then perform a faulty load operation. The faulty load operation should load data from a specific memory address and apply some operations to it. ... | glaive |
Can you provide a CSS rule that can be used to achieve the following output for a `<p>` element: white background color, a black border with a width of 3px, text color #444, and a border radius of 10px? | glaive |
You are tasked with creating a companion code for the 'hours' Haskell utility. This code will provide a UI display and call out to the 'hours' utility. The code should include a function that reads time clock data from an Org-file, with the 'org2tc' utility on the PATH. The function should display the logged-in status,... | glaive |
I am trying to create a custom command in my CMake project to add a new target for wrapping a Lua file using Torch. However, I am encountering some difficulties in setting up the command and defining the dependencies. Can someone provide a solution to create a custom command in CMake to wrap a Lua file using Torch and ... | glaive |
You are tasked with creating a program that utilizes the elastic4s library to perform a rank feature query on an index in Elasticsearch. The program should include the following functionality:
- Deleting an existing index named "rankfeaturetest" if it exists
- Creating a new index named "rankfeaturetest" with specific ... | glaive |
I'm working on a project where I need to calculate the expected number of cases of a disease by age and location, as well as the expected number of deaths by age and location. I have several functions in the code base that handle these calculations, but I need to integrate them into a single function that can generate ... | glaive |
Is there a way in Rails to validate that a record is unique based on more than just one column? For instance, in a friendship model or table, I want to make sure that there are no duplicate records with the same user_id and friend_id values. How can I achieve this? | glaive |
I am trying to test the inversion algorithm for multiple scattering codes for the solution of the equation tau = (1 - tG)^-1 t, where t is a block diagonal matrix and the diagonal blocks G_ii == 0. I need to allocate memory on the GPU, perform matrix operations, and solve the equation using different methods such as LU... | glaive |
You are tasked with creating a multi-language support feature for a web application using PHP. You need to implement a function that takes a language key and returns the corresponding translation value. The translation should be stored in an associative array where the keys are the language keys and the values are the ... | glaive |
I am trying to create a Perl program that calls a procedure multiple times without passing any arguments. However, I am encountering some issues in implementing this. Can someone please provide a solution to call a procedure multiple times without passing any arguments in Perl? | glaive |
You are tasked with creating a Verilog module that checks whether a given 32-bit hexadecimal value matches a specific pattern. The pattern is defined by the function `matchHex(Bit#(32) b)`, which returns True if the input value matches the pattern and False otherwise. You are provided with an array `tests[10]` containi... | glaive |
I need assistance in implementing a TypeScript function that can reverse an array consisting of individual characters. Can you provide guidance on how to achieve this? For example, I want to reverse the string "abcd". | glaive |
I am using Struts2 & Hibernate and getting an error when I search for data using a string value, but it works when I search using a numeric value. The value I am searching for is coming from a bean class and I have defined the property as a string type in the bean class. Can anyone help me understand why I am getting t... | glaive |
You are tasked with implementing a function that copies data from one field to another, with the added complexity of applying an offset to the data. The function should support different types of fields such as ColorSpinorField, CloverField, and GaugeField, and should be able to handle both 4D and 5D even-odd precondit... | glaive |
I've installed SlimDX but the assembly reference does not come up as a choice in Visual Studio, and I cannot for the life of me find out where SlimDX has installed itself! Any help would be greatly appreciated!
Thank,
Mikey | glaive |
I am currently working on a procedural macro that is functioning correctly. However, I am facing difficulties in reporting errors in a user-friendly manner. I am currently using panic! to report errors, but I find this approach inelegant and the error messages are not presented nicely to the user.
I am aware that I ca... | glaive |
How can I create a Java program that uses the Apache Felix framework to start an OSGi runtime? I want to be able to specify the classpath for the program and run it using the Main class from the org.apache.felix.main package. Can someone provide a complete example of how to achieve this? | glaive |
You have been tasked with implementing a class for 3D mathematical operations in a C# program. Your task is to create a Math3D class with the following methods:
1. Calculate the distance between two 3D points.
2. Calculate the dot product of two 3D vectors.
3. Calculate the cross product of two 3D vectors.
4. Calculate... | glaive |
You are tasked with creating a ROS (Robot Operating System) package that includes a custom message type. The message type should be named "sensor_data" and should include the following fields:
- float32 temperature
- float32 humidity
- string sensor_name
Your task is to create the necessary files and code to define th... | glaive |
You are tasked with creating a scheduler call API using the standard protocol buffer "union" trick. The API should support various call types, including subscribing the scheduler with the master to receive events, accepting an offer, declining an offer, killing a specific task, shutting down a custom executor, acknowle... | glaive |
You are tasked with creating a procedure that takes in a subject string and a list of candidates, and returns all the anagrams of the subject string that can be formed using the letters from each candidate string.
For example, given the subject string "listen" and the candidates ["enlist", "inlets", "silent", "tinsel"... | glaive |
I want to create a Python package for a robot teleoperation system using the ROS (Robot Operating System) framework. The package should be able to receive keyboard input to control the robot's movement. The package should depend on the "geometry_msgs" and "rospy" packages for building and execution. Additionally, it sh... | glaive |
You are tasked with creating a draft schematic for a bio component in a crafting tool using the Core3 framework. The bio component, in this case, is "Mimetic Circuitry" and it has specific crafting requirements and customization options. Your task is to write the code for the object draft schematic for this bio compone... | glaive |
How can I create a MongoDB database for a blog application with collections for Posts and Comments? | glaive |
You are tasked with implementing a NinePatch class using the given code snippet as a reference. The NinePatch class represents a 3x3 grid of texture regions and is used to create a resizable image with fixed corners and stretchable sides. Your task is to create a new NinePatch class in Kotlin and implement the followin... | glaive |
You are tasked with creating a program that exports data to the filesystem and/or stdout based on certain conditions. The program should be able to handle concurrency and export the data accordingly. The program should use the Foreman gem and be able to load a Procfile and export the data to the specified location.
Cr... | glaive |
Can you provide a Prolog program that solves the 8-puzzle game? | glaive |
You are tasked with creating a Node.js CRUD application for managing program providers. The application should include the following functionalities:
1. Ability to save a program provider if the user is logged in
2. Inability to save a program provider if the user is not logged in
3. Inability to save a program provide... | glaive |
You are tasked with creating a web page that displays a list of organizations and allows users to perform various actions such as editing, deleting, and viewing details of each organization. You need to implement the functionality to display the list of organizations in a table format and provide options to edit, delet... | glaive |
You are tasked with creating a Kotlin function that generates an image vector for a new icon in a Compose UI application. The function should take into account the name, default width, default height, viewport width, viewport height, fill color, stroke color, stroke line width, stroke line cap, stroke line join, and st... | glaive |
You are tasked with implementing a C++ program that calculates the sum of the power of a set of input numbers. The program should take in a list of numbers and calculate the sum of their powers, where the power is a predefined constant. The program should be able to handle input of any size and produce the correct sum ... | glaive |
You are tasked with creating a program that will take a string of words and scramble each word in the string. For example, given the input "letter alphabetical missing lack release penchant slack acryllic laundry cease", the program should output a string with the words scrambled, such as "etlert liahepalbcat imsgsni a... | glaive |
I am trying to implement a program that needs to build a linearized system matrix and perform a scan on scan elements using CUDA. The program should be able to process input data, perform a linearized system computation, and then carry out a scan on scan elements, outputting the result in a specified format.
The speci... | glaive |
I am trying to implement a program that reads data from a JSON file and uses it to create objects in my application. However, I am encountering issues with parsing the JSON data and creating the objects. Can someone help me write a function in Python that can read a JSON file and create objects based on the data? | glaive |
I managed to use gRPC bindings from the `https://github.com/gkkachi/firestore-grpc` repository to create a request. However, although it seems to be working, I'm not receiving any content. Here is the code I used to create and send the request:
Creating the request:
```rust
let req = ListenRequest {
database: form... | glaive |
You are tasked with creating a program for a catering website that allows users to place orders for food and beverages for events. The program should have the following features:
- Users should be able to browse a menu of food and beverages, with prices and descriptions.
- Users should be able to add items to their car... | glaive |
I need help with writing a MySQL query that can find all records from multiple tables where the name starts with 'A'. Additionally, I want to order the result by another field, for example, the date of creation in descending order. I also want to make sure that I avoid any duplications in the output. Can you show me an... | glaive |
I'm trying to devise a regular expression pattern that matches a specific string pattern. The string should start with a unary number, followed by an hexadecimal quantity and a lowercase English vowel. Finally, it should end with a binary number. Can someone help me with this? | glaive |
What is the algorithm to calculate the sum of all numbers between two given numbers? | glaive |
You are tasked with creating a Clojure program that interacts with a Waiter server to perform various tests on a new application. The program should include tests for new application creation, garbage collection, default grace period, and custom grace period. Additionally, the program should handle service cleanup afte... | glaive |
I am trying to implement a trait handler for the `core::cmp::PartialOrd` trait in Rust. The goal is to generate an implementation for the `partial_cmp` method based on the fields of a struct. The `PartialOrdStructHandler` struct will handle the trait meta and generate the implementation for the `partial_cmp` method. Th... | glaive |
How can I design a PHP application to retrieve all entries from a database with a specific email address? | glaive |
How can I download a zip file from a URL in Python, which when entered in a web browser, prompts a dialog box for saving the file? | glaive |
I have a string and I want to count the frequency of each word in the string. Can you provide a solution in Python? | glaive |
You are required to create a Thrift server in Delphi that listens on a specified port and executes certain methods when called. The server should support different types of server configurations and transport protocols.
Your task is to write the code for the server setup and configuration. You need to handle command-l... | glaive |
Does the Python Enhancement Proposal (PEP) 8 style guide require whitespace around operators such as +, -, *, /, etc., in a function's arguments? For example, I have the following code:
```python
some_list = range(a, b+1)
```
When I checked my coding style using the PEP8 plugin for vim, I received a warning that ther... | glaive |
You are tasked with creating a Python package called "weatherapi" that fetches weather data from a public API and provides a simple interface for accessing this data. The package should have the following features:
- The package should be named "weatherapi" and contain a module with the same name.
- The version number ... | glaive |
You are tasked with creating a JSP page that constructs a pager for clicking through a set of search results. The page is meant to be included inside the search results portion of an encompassing JSP. The parameters that are passed on through paging need to be set up as a list. The HTML for the pager needs to be create... | glaive |
You are tasked with creating a class that represents data for a cell in a spreadsheet. The class should have the following functionalities:
1. Create a cell with a given sheet name, row, and column.
2. Check if two cell data objects are equal.
3. Create a cell with a given sheet name, row, column, type, and value.
4. C... | glaive |
You are tasked with creating a Makefile for building the OpenSSH package with specific configuration options. The Makefile should include the necessary environment variables, configuration options, and dependencies. Additionally, it should handle the installation of client and server programs based on the configuration... | glaive |
You are tasked with creating a program that parses and processes XML data. The given XML snippet contains information about a dataset transaction, including various attributes and their corresponding values. Your task is to write a program that can extract specific information from the XML and perform data processing o... | glaive |
I am working on a project that requires using FreeRTOS and I need to check whether certain types are available or not. Specifically, I need to check for the availability of tick types, queue handles, semaphore handles, timer handles, and task handles. I need to perform these checks in my CMakeLists file as part of my b... | glaive |
I'm working on implementing my own versions of Histogram of Oriented Gradients (HoG) and its variant to work with depth images. I've managed to create image pyramids out of the original image and run a 64x128 sliding window from the top left corner to the bottom right. However, I'm having trouble with testing my traine... | glaive |
You are tasked with creating a SAS program that will load the ASCII outpatient SEDD DX_PR_GRPS file into SAS and define SAS informats for missing values. The program should also include a data step to input the variables from the ASCII file into a SAS dataset.
Your task is to write a SAS program that accomplishes the ... | glaive |
You are tasked with setting up a Dockerfile for a Node.js application that requires the installation of various dependencies and environment variables. Your Dockerfile should include the installation of graphicsmagick, curl, wget, and jq, setting up several environment variables such as NPM_CONFIG_LOGLEVEL, SAUCE, XUNI... | glaive |
You are tasked with creating a class to handle grouping and organizing data in a WPF application. The class should have the following functionalities:
- It should be able to create a new group data based on a given key value.
- It should be able to update the group data with new values.
- It should be able to add child... | glaive |
Can you provide a Rust script that sorts an array of integers? | glaive |
You are tasked with creating a strongly-typed resource class in Visual Studio using the StronglyTypedResourceBuilder class. The class should be able to look up localized strings and other resources. Your task is to create a module with a ResourceManager instance and a CultureInfo property to handle resource lookups and... | glaive |
I am trying to implement a simple environment for storing procedures and their types in a functional programming language. I have defined a few helper functions, one for building a procedure tag, one for putting a procedure into the environment, and one for getting a procedure from the environment. However, I am having... | glaive |
You are tasked with creating a script to build TiddlyWiki5 for tiddlywiki.com. The script should perform the following tasks:
1. Set up the build output directory using the TW5_BUILD_OUTPUT environment variable. If the variable is not set, a default directory should be used.
2. Create a CNAME file with the content "tid... | glaive |
You are tasked with implementing a CUDA kernel function for temporal max pooling in a neural network. The function should take in an input tensor, perform max pooling along the temporal dimension, and return the output tensor and indices of the maximum values. The input tensor can be either 2D or 3D, representing a sin... | glaive |
You are working on a C++ project and need to implement compiler detection and build specific flags based on the detected compiler. You need to handle different compilers such as Ninja, Visual Studio, MSVC, Clang, and GNU, and set appropriate compile options, definitions, and linker flags based on the detected compiler.... | glaive |
What is the code to generate a TensorFlow model for predicting the number of sales for a given product? | glaive |
You are tasked with creating a register file module in Verilog. The module should have inputs for clock signal, reset signal, load signal, input data, source A, source B, and destination. It should also have outputs for register A and register B.
The register file should have 32 32-bit data registers. The module shoul... | glaive |
You are tasked with implementing a C++ program that involves conditional inclusion of source files based on a variable. Your task is to create a program that includes different source files depending on the value of the variable CONNECTED. If CONNECTED is true, you should include the file arena_system_test_connected.cp... | glaive |
How can I write a Java program to generate the Fibonacci sequence up to a given limit? | glaive |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.