instruction_seed stringlengths 29 40.5k | source stringclasses 6
values |
|---|---|
I am trying to create a job scheduling program that will execute a specific executable file with certain arguments multiple times. I need to set up the configuration for this job in such a way that it will output the results of each execution to a separate file, handle any errors that may occur, and keep a log of the e... | glaive |
You are tasked with extending the functionality of the dired-tar package in Emacs. The current package allows users to create and unpack tar files in dired-mode. Your task is to add support for bzip2 tar files in addition to the existing support for gzipped tar files. You need to modify the dired-tar.el file to include... | glaive |
You are tasked with writing a query to retrieve all the names and email addresses of people from a dataset. The dataset contains information about individuals and their personal details. You need to use a query language to extract the required information from the dataset and display it in the result. | glaive |
You are tasked with creating a shader for the HDRenderPipeline that includes various properties and passes for different rendering modes. The shader needs to handle features like base color, metallic, smoothness, normal maps, height maps, detail maps, subsurface profiles, specular color, wind effects, distortion, and m... | glaive |
You are tasked with implementing a function that handles memory allocation and exception handling in C++. The function should allocate memory using `malloc` and perform an operation, and then free the memory using `free` in a safe and efficient manner. The function should also handle any potential exceptions that may o... | glaive |
How can I find the maximum sum contiguous subarray in an array of integers using Python? | glaive |
You are tasked with creating a program that generates a stack bar graph by two variables for drug use by referral decisions for two standardized patient cases. The graph should be based on the replication file for the study "Use of standardised patients to assess antibiotic dispensing for tuberculosis by pharmacies in ... | glaive |
You are tasked with creating a smart contract called "ProfitSharing" that will deposit dividends to token holders and allow them to claim their share of the dividends. The smart contract should have the following functionalities:
1. The smart contract should be able to accept Ether deposits from the owner.
2. The depos... | glaive |
You are tasked with creating a program in Go that involves managing workspaces in a grid based on certain environmental factors. You need to write a function that calculates the position of a given workspace in a grid where each number increments by one, from the top left to the bottom right. The function should take t... | glaive |
You are tasked with implementing a Vector data type in Haskell, with abstract refinements for its domain and range.
Your task is to define a Vector of `a`s, implemented as a function from `Int` to `a`s. This Vector is parameterized with two abstract refinements:
- `dom`: describes the domain of the Vector
- `rng`: des... | glaive |
You are tasked with creating a script that will parse a set of files and generate an HTML table based on the data found in those files. The script should read through the files, extract specific information, and then use that information to populate the table. The table should display the data in a specific format, wit... | glaive |
How can the code be modified to find the largest number in a given array of integers? | glaive |
:
You are tasked with creating a Solidity smart contract that includes two functions for mathematical computations: roundToNearestPowerOfTwo and ceilLog10. The roundToNearestPowerOfTwo function should take an input unsigned integer and return the nearest power of two. The ceilLog10 function should take an input unsigne... | glaive |
```cpp
typedef struct _dmk {
unsigned short int m : 5; // 0 - 31
unsigned short int d : 5; // 0 - 31
unsigned short int c : 1; // 0 - 1
unsigned short int i : 5; /* 0 - 31 */
unsigned short int ip : 10; /* 0 - 1024 */
unsigned short int mj : 1; // 0 - 1
... | glaive |
I am working on a computer graphics project and I need to implement a vertex shader in OpenGL/GLSL. I need to create a shader that takes in the position and UV coordinates of each vertex, applies a world matrix transformation to the position, and outputs the transformed position as well as the UV coordinates for fragme... | glaive |
You are tasked with creating a PowerShell script to deploy resources defined for a service directory to Azure. The script should deploy any ARM templates named test-resources.json found in the specified service directory to Azure.
The script should support the following parameters:
- BaseName: A name to use in the res... | glaive |
I am getting the following exception whenever I try to submit data through a form to a database:
Exception: Cannot insert explicit value for identity column in table 'ClientDetails' when IDENTITY_INSERT is set to OFF.
However, the form does not have a field to enter data into the identity column (PK), so I'm not sure... | glaive |
I need to create a Node.js server that acts as a SSL proxy, with the ability to process and redirect HTTP requests. The server should be able to handle GET requests and respond with proper security headers. It should also be able to handle redirects and manage connections. Additionally, the server needs to be able to d... | glaive |
You are tasked with setting up a Flask web application using tcsh shell scripting. Your goal is to create a script that sets the necessary environment variables and runs the Flask app on a specified port. You need to ensure that the Flask app is running in development mode and using a specific configuration file.
Writ... | glaive |
You are tasked with creating a Ruby on Rails application that utilizes the ActiveRecord framework. You need to implement a module called JobDevice within the Job class. This module should define three methods: device_type, device_name, and device_details. The device_type method should return the brand and model of a de... | glaive |
You are tasked with creating a program to calculate the probability amplitudes and visualize the probability distribution for a quantum system with a given number of qubits, states, and name.
Your program should:
- Define the number of qubits (nqubits), name of the system (name), and number of states (nstates).
- Impl... | glaive |
You are tasked with creating a module in Bluespec SystemVerilog to implement a Co-processor Floating Point unit. The module should include features such as fetching instructions from a FIFO, deciding access based on availability of operands and register states, determining the execution unit to use, performing writebac... | glaive |
You are tasked with creating a Blazor WebAssembly application that includes lazy loading of assemblies. The goal is to ensure that certain assemblies are only loaded when they are actually required, rather than being loaded immediately upon application startup. Your task is to implement the necessary logic to achieve t... | glaive |
You are tasked with implementing a function to perform a partial data copy from a source array to a destination array. The function should be able to handle both row-major and column-major order of the source array. The function signature is as follows:
```cpp
void copy_data(int index, char order, thrust::device_vector... | glaive |
You are tasked with implementing a base checkpointer class in a fabric network. The class should have the following functionalities:
1. A constructor that takes in options to configure the checkpointer.
2. A method to save the transaction ID, block number, and the expected number of events in the block.
3. A method to... | glaive |
You are tasked with creating a module in F# that can handle database schema differences between two Firebird databases. The module should be able to compare the tables and fields in the two databases and identify any missing tables or fields, as well as any differing fields. You need to define the types and functions n... | glaive |
What are some keywords that can be used for a blog post about Artificial Intelligence? | glaive |
You are tasked with creating a web application using Ext JS Library 3.3.1. The application needs to display a set of portlets with a specific styling. The portlets should have a margin-bottom of 10px, and the look of the portlets should be cleaned up by applying padding and background color. Additionally, the portlet f... | glaive |
I have a list of numbers in Python, and I want to sort them in ascending order. How can I modify my program to achieve this? | glaive |
You are tasked with creating a ColdLanguage class in CoffeeScript that will handle the conversion of object references and lookup by name in a specific way. The ColdLanguage class should have a compiler method that takes in code as input and performs the following conversions:
- Convert '#123' object references into Co... | glaive |
You are tasked with creating a custom Unity shader that simulates a rock surface with a realistic appearance. The shader should incorporate features such as color, smoothness, metallic properties, texture details, animation speed, noise power, ambient boost, and emission mux. Additionally, the shader should support ins... | glaive |
You are tasked with creating a service for managing a user's shopping cart. The service should allow the user to add and remove items from their cart, as well as retrieve the current state of the cart. The cart should keep track of the items added, the quantity of each item, and the total amount of the cart. The servic... | glaive |
You are required to create a lazy sequence generator in JavaScript that can generate a Fibonacci sequence and a sequence of even numbers. The lazy sequence should be able to handle large numbers and support various operations like checking if a specific index exists, retrieving a value at a specific index, converting t... | glaive |
You are tasked with creating a Node.js module that handles the deployment of teams' applications. The module should include a schema with the following fields: teamId (required and indexed), hostname, os, remoteAddress, and platform. It should also have associations with the Team model and validations for the remoteAdd... | glaive |
I am trying to create a new project in Active-HDL and add some specific IP cores and simulation models to it using the VLSI compiler tool. Can someone guide me on how to properly set up the project and add these components using the vlib, vmap, vlog, and vcom commands? | glaive |
You are tasked with creating a class for managing different types of nodes in an XML document. The class should be able to determine if a node is a text node and retrieve the name of the text node. You need to implement a method that checks if a node is a text node and another method that retrieves the name of the text... | glaive |
You are tasked with creating a SAS program to load an ASCII inpatient stay AHAL file into SAS. The program should include the creation of SAS informats for missing values and a data step to input the variables from the ASCII file. The variables to be included are:
- HOSPSTCO: Hospital modified FIPS state/county code
- ... | glaive |
You are tasked with creating a Kotlin data class that represents the daily weather response from an API. The data class should have the following structure:
- It should have a status string field and a result field of type Result.
- The Result class should have a field of type Daily.
- The Daily class should have tempe... | glaive |
I need to write a Prolog predicate that takes a conjunction of literals and generates a list from it. The predicate should handle cases where the conjunction is in a module and where it is not. The generated list should include the module and the literal for each element in the conjunction. | glaive |
You are tasked with creating a function in Clojure that generates a random UUID string. The function should not take any arguments and should return a string representing a random UUID. The UUID should be in the standard 8-4-4-4-12 format, with each segment being a hexadecimal number.
Your task is to implement the ra... | glaive |
You are tasked with creating a new Android app feature that displays a list of articles with the ability to open each article in a custom tab. The app should have a refresh functionality to update the article list. You need to implement a fragment that contains a RecyclerView to display the articles, a pull-to-refresh ... | glaive |
I need to perform a rotate operation on the entirety of a YMM register in my code. The amount of rotation needed is only known at runtime. What is the most efficient way to achieve this? I also know that the rotation will always be a multiple of 64 bits. | glaive |
How can I loop through a 2D numpy array using x and y coordinates without encountering an out of bounds error? I have attempted to solve this problem using the code below but it only prints numbers 1 - 6. If I only subtract 1 from either rows or cols in the range, it leads to an out of bounds error or not all numbers a... | glaive |
Faced with the challenge of a new application where I have the freedom to design and assemble a team, I need to choose the best language/platform. The desktop application will control a hardware device and perform computations, analyze, and display the data returned by it. I have a list of requirements and assumptions.... | glaive |
I am working on a project that requires compiling C++ code on a Linux platform using the PGI compiler. However, I am encountering an issue with the compilation process. Can someone provide a solution for compiling C++ code on a Linux platform using the PGI compiler? | glaive |
Can you provide a JavaScript function that can be used to convert an array into a string? | glaive |
You are tasked with implementing a new feature for a Kafka producer in Scala, using the fs2-kafka library. The feature involves adding a new configuration setting for the producer, which determines the acknowledgement behavior when producing records. The available options for this setting are:
- Zero: Do not wait for a... | glaive |
You are tasked with implementing a trait for serializing different types into a byte stream. The trait `Serialize` should be implemented for various types such as `Vec<T>`, `String`, `Vec<u8>`, `AttrMap`, `BoxPath`, `Inode`, `FileRecord`, `DirectoryRecord`, `LinkRecord`, `Record`, `BoxHeader`, `BoxMetadata`, and `Compr... | glaive |
You are tasked with creating a Perl script that uses the SiLKTest module to perform a scan on a specified file system. The script should use the rwscan command with the --scan-mode=2 option to scan the /dev/null file. Your task is to write a Perl script that accomplishes this task and exits with a status of 0 if the sc... | glaive |
You are tasked with creating a LOINC browser server that exposes snomed and loinc browsers. The server needs to handle requests for LOINC documentation and support different languages. You need to implement the TLoincWebServer class to handle plain and secure requests, as well as the TLoincWebEndPoint class to manage t... | glaive |
You are tasked with implementing a Bayesian truncated negative binomial regression model in a programming language that supports Bayesian statistics. The model is used to fit a regression to a positive count outcome with all values above a specified truncation point. Your task is to write the code to fit the model and ... | glaive |
You are tasked with creating a CMake file for testing a source directory. Your CMake file should include relevant testing commands required for testing the directory and list subdirectories to be tested as well. You need to ensure that the testing commands are properly configured and that the subdirectories are include... | glaive |
You are tasked with implementing a JSON Pointer in Scheme. JSON Pointer is a string syntax for identifying a specific value within a JSON document. It can be used to reference individual elements within a JSON document. Your task is to create a function that takes a JSON document and a JSON Pointer as input and returns... | glaive |
You are tasked with creating a program to handle sprite animations in a game development environment. Your program should be able to parse and utilize the given JSON data to render and manage sprite animations. The program should be capable of handling sprite dimensions, texture groups, frames, sequences, layers, and o... | glaive |
You are tasked with creating a SPARQL query to find all instances of a dcat:Distribution where the value of the dct:language property is not a dct:LinguisticSystem. The query should retrieve the Class_Name, Rule_ID, Rule_Severity, Rule_Description, Message, s, p, and o for each instance that violates this rule. The Rul... | glaive |
You are tasked with creating a Python class that represents the result of a bandwidth test. The class should have an attribute "bandwidth" that represents the average bandwidth of the test in Mb/s. Your task is to implement the class and ensure that it inherits from the appropriate parent class. | glaive |
You are working on a project where you need to create a program that can parse and process LaTeX log files. You need to write a function that can extract and display the section, subsection, figure, and table information from the log file.
Write a function that takes the LaTeX log file as input and returns a data stru... | glaive |
I have an existing PHP web application and I want to implement user authentication. How can I update my application to include user authentication? | glaive |
You are tasked with implementing a two-dimensional cellular automaton defined by "Rule 261" based on the 5-celled von Neumann neighborhood. The goal is to calculate the number of active (ON, black) cells in the n-th stage of growth. You are given the initial stage as the input, and you need to write a program that can ... | glaive |
You are tasked with implementing a neural network for image classification using the ITKNeuralNetworks module. Your goal is to create a program that can take in an image and accurately classify it into predefined categories. The neural network should be trained using a dataset of labeled images, and the program should ... | glaive |
You are tasked with creating a test case in Ruby on Rails using the ActiveSupport testing framework. The test case should validate the truthfulness of a specific condition within your application. Your task is to write a test case that checks for the truthfulness of a specific condition and ensure that it passes the te... | glaive |
You are tasked with creating a program that modifies the behavior of breakable walls in a game. Currently, the breakable walls do not have a visual glow effect, and your goal is to make the glow visual always appear when a breakable wall is encountered. You need to write code that will ensure the glow visual is consist... | glaive |
Can you provide a JavaScript function that can be used to check if a given URL string contains a protocol? | glaive |
You are tasked with creating a function that will generate a raw string for each of the given input files in C++11. The function should take a list of input files and output the corresponding raw string for each file.
Your function should:
- Generate a unique variable name for each input file
- Set the input and outpu... | glaive |
You are tasked with implementing a color space conversion function using 64-bit SSE2. The specific conversion being performed is from RGB to YCC (luminance and chrominance components). You will need to use the provided constants and SIMD instructions to perform the conversion.
Your task is to write a function that tak... | glaive |
I have an array of integers in JavaScript, and I need to convert it into a string where the numbers are separated by commas. How can I achieve this?
Here is an example of my array:
```javascript
var arr = [12, 13, 17, 25, 99, 168];
```
Can someone provide me with an algorithm to solve this problem? | glaive |
How can I print multiple lines of text in Python without having to type `print('')` for every line? I am using Python 3.5.1 and intend to use this for ASCII art. | glaive |
You are tasked with creating a package that provides a standardized interface to public variables, such as operation counters in servers. These variables should be exposed via HTTP at /debug/vars in JSON format. The package should allow for atomic operations to set or modify these public variables.
The package should ... | glaive |
You are tasked with creating a Puzzle object to display questions, answers, and pictures as a game state in a game development project. The Puzzle object should have the following functionalities:
1. The ability to create a Puzzle object with an ID, puzzle, answer, and value.
2. A method to check if a key has been pre... | glaive |
What is the difference between \v, \x0b, and \x0c in Python? When I type string.whitespace, Python's string module provides a string containing all whitespace characters:
'\t\n\x0b\x0c\r '
Both \x0b and \x0c seem to produce a vertical tab as evidenced by:
print 'first\x0bsecond'
first
second
Similarly \v also ... | glaive |
You are tasked with writing a shell script to remove a directory and its contents, while avoiding extra slashes in the verbose output. The script should remove the specified directory and display the files and directories being removed in the verbose output. If the directory does not exist, the script should not throw ... | glaive |
You are tasked with creating a Struts application that includes a header and footer wrapper for hard-coded content in an XSLT template. The application should be able to branch to an arbitrary page (an XSLT template) using the "appvar" application variable on a link in the format URL/showPage.do?setappvar=page(mypage).... | glaive |
I am trying to make a GET request to a specific URL using XMLHTTP in WSH (Windows Script Host) and then print the response text to the console. However, I am having trouble implementing the `onreadystatechange` method to handle the state change of the request and print the response text when the request is completed. C... | glaive |
I need to create a program that tests the SizeOf in the base type of an instance, not just its provisos, and then expands it. The program should include a module, typeclass, typedef, and an instance to test the SizeOf in the base type of an instance. The program should be able to handle the expansion of the base type a... | glaive |
What is the code to create a Python function that returns the longest prefix that is a palindrome given a string? | glaive |
You have been tasked with creating a batch script that sets up a virtual environment for a Python project. The virtual environment should be located at "C:\Users\wolfg\Documents\GitHub\tableau_webdataconnector\webdata_venv". The script needs to update the code page to 65001 to ensure compatibility with UTF-8 encoding. ... | glaive |
What is a greedy algorithm and how does it optimize the decision-making process for a specific set of problems in the field of computer science? | glaive |
We are a group of students starting a C++ project. We have experience in Java and some of us have knowledge in C. We are looking for recommendations on which editing tool would be a good choice for our project. We have access to all the products of MSDNAA, so options like Microsoft Visual Studio are available. However,... | glaive |
You are tasked with creating a parameterized class in SystemVerilog for a pattgen agent in a verification environment. The class should include a sequencer, item, configuration, coverage, monitor, and driver. The sequencer should be a modified version of dv_base_sequencer, with the appropriate parameter set. The item, ... | glaive |
I need to create a class that implements the functionality of returning an entity type. The entity type is an enumeration defined in the EntityTypeModels file. Can someone help me create a class that fulfills this requirement? | glaive |
How can I create a function or a short program in Python that takes a string input (up to 10 letters) and returns a shuffled version of that string? | glaive |
You are tasked with creating a program that calculates the probability amplitude and probability of a quantum state for a given number of qubits and states. The program should include functions to calculate the probability amplitude, probability, and use the NMaximize function to find the maximum probability. Additiona... | glaive |
You are tasked with creating a protocol buffer message in proto3 to handle the issuance of local scanner certificates. The message should include a request ID and be able to handle both successful responses containing a set of certificates and error responses in case of an issue with issuing the certificates. You need ... | glaive |
You are tasked with creating a C++ project for a new library called "UserInterface". The project should be a static library and should be able to run on both Windows and Linux systems. The library should contain the following files:
- imconfig.h
- imgui.h
- imgui.cpp
- imgui_draw.cpp
- imgui_internal.h
- imgui_widgets... | glaive |
You are tasked with creating a History struct in Rust using the gtk library. The struct should have the following functionalities:
1. A new method that takes in a TextView and a ScrolledWindow and returns a new History instance with the given text view and scrolled window.
2. An add method that takes in a string and ad... | glaive |
You are tasked with creating an enum type in a Go package for a new set of values. The enum type will represent different types of data attributes, and it should include the following values:
- STRING_VALUE
- STRING_LIST_VALUE
- LONG_VALUE
- DATE_VALUE
Your task is to create the enum type and its associated Values met... | glaive |
I am trying to create a web application that allows users to view PDF files and navigate through the pages. I need to write a JavaScript function that initializes a PDF viewer and provides methods to load a PDF file, navigate to the next page, and navigate to the previous page. The viewer should also handle rendering t... | glaive |
How can I create a layout in HTML and CSS that displays the top 5 most liked photos from a social media site? | glaive |
I have a contact form on my website and whenever I submit it, I'm getting a Net::SMTPAuthenticationError with the error message "535-5.7.8 Username and Password not accepted". The error is pointing to the create action in the contacts controller where I have the line "ContactMailer.new_contact(@contact).deliver". I've ... | glaive |
Is there a way to write an SQL query that selects customers who have placed orders within a specific date range? | glaive |
You are tasked with creating a PowerShell script to automate the setup of a starter project using Jest and ES6 for JavaScript development on a Windows machine. The script should be able to download the necessary files and dependencies from a specific GitHub repository and set up the project for development.
Your task ... | glaive |
How can I create a Python script that outputs the string "My favorite color is blue"? | glaive |
I'm trying to write a query in Go using the `pq` driver for Postgres. I want to pass a list of values as a single parameter to the query. I found a solution on Stack Overflow (link provided) that suggests using a list parameter. Here's the code I tried:
```go
rows, err := db.Query("SELECT * FROM table WHERE id in $1",... | glaive |
I need to create a class for a matrix with a variety of operations. The matrix class should be able to perform operations such as addition, subtraction, multiplication, and division. It should also be able to calculate the determinant, the trace, and the rank of the matrix. Additionally, I need to be able to decompose ... | glaive |
You are tasked with creating a size definition properties form in Delphi using the given framework and technology. The form should include labels for "Name" and "Control Name Map", as well as corresponding input fields for users to enter the name of the size definition and specify control names for later use in control... | glaive |
I'm trying to write a recursive method that adds an item to a tree and returns the tree node corresponding to that item. However, I'm encountering an error that says "cannot move out of `self` because it is borrowed". What does "moving out of something" mean in this context? How can I fix this error?
```rust
enum BstN... | glaive |
How can I write a Python program that creates a dictionary from a given list of integers, where the dictionary contains elements ranging from 1 to the specified number? | glaive |
You are tasked with creating a Java program that filters out specified abusive words from an input stream and writes the filtered output to an output stream. The program should create a class called FilterOfWords that acts as a decorator for the BufferedReader class. The class should have a method called dropAbuses tha... | glaive |
Can someone provide me with a Python script that calculates the sum of all the even numbers between 1 and 1000? | glaive |
You are tasked with creating a simple game view using the Elm language and the given code snippet as a reference. The game view should consist of a well, controls, panel, info, and winner section. The well should display a grid of colored boxes, the controls should consist of buttons for rotating, moving left, moving r... | glaive |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.