instruction_seed
stringlengths
29
40.5k
source
stringclasses
6 values
You are tasked with implementing an authentication provider class in Dart using the cloudbase_core_nullsafety library. Your task is to create a class called AnonymousAuthProvider that extends the AuthProvider class. This class should have the following methods: 1. signInAnonymously: This method should handle the proce...
glaive
I'm working on a RESTful resource and I want to make sure that certain conditions are met before allowing a destroy operation to proceed. How can I validate whether a destroy operation should be accepted, especially if there are no validation callbacks available?
glaive
How can I retrieve the size of an image using Python and OpenCV, similar to how I do it in C++? C++ code: ```c++ int w = src->width; printf("%d", 'w'); ```
glaive
How can an AI generate an optimal solution for the given Knapsack problem using Dynamic Programming?
glaive
You are tasked with implementing a Binary2JUnitXmlReportGeneratorSpec class in Groovy that will generate JUnit XML reports from binary test results. The class will need to have the following features: - Generate JUnit XML reports from binary test results. - Write results in parallel using a specified number of threads....
glaive
You are tasked with creating a lazy loading functionality for Vimeo videos on a website using JavaScript. The lazy loading functionality should use the Intersection Observer API to only load the video when it comes into view in the viewport. Additionally, the lazy loaded video should have a thumbnail, a play button, an...
glaive
You are tasked with implementing a solution for a program that reads a list of strings and determines the most common character at each position in the strings. The program should then output the most common character at each position to form a final decoded message. For example, given the input: "eedadn", "drvtee", "...
glaive
I am trying to create a maintenance order system in my application using Groovy and I am facing an issue with the `getUsedSpareParts` method in the `MaintenanceOrder` class. The method always returns 0 when I try to use it, but when it is in the `WorkOrder` class, it works fine. I need to discuss this with Jean Kahigis...
glaive
You are tasked with creating a Python program that manages a list of profile types and their respective operations. The program should allow for listing all profile types, retrieving details of a specific profile type, and listing the operations available for a specific profile type. Additionally, the program should ha...
glaive
You are tasked with implementing a ROB (Reorder Buffer) module that returns data FIFO (First In, First Out) by sorting out of order arrival of the payload. The ROB combines two pieces of data with each entry: meta-data that is supplied at the time an index is allocated and the late-arriving data. Both are returned toge...
glaive
I am working on a project using the Apache Deltaspike Data module and I need to create a repository interface for the AccAccount entity. The AccAccount entity has a primary key of type String. I want to be able to perform CRUD operations on the AccAccount entity using this repository interface. Can someone help me crea...
glaive
You are tasked with implementing the architecture for a tdc_output entity in VHDL. The entity has several generic parameters including depth_g, count_g, and width_g, as well as input and output ports such as clock_i, sel_i, state_i, weight_o, weights_o, and state_o. The architecture includes the instantiation of a tdc_...
glaive
You are tasked with creating a Makefile to build a Go program for different platforms. The Makefile should support building the program for the linux platform with a specific architecture (amd64). The Makefile should also include a target to download the dependencies using the `GO_GET` command. Additionally, the Makefi...
glaive
You are tasked with implementing a function in the C programming language that determines whether one double-precision floating-point number is greater than another. The function should return an integer value representing the comparison result. Your function should have the following signature: ```c int isgreater(dou...
glaive
You are tasked with creating a custom exception in a Perl package using Moose. The exception should be named "OverloadRequiresNamesForCoderef" and should extend the "Moose::Exception" class. The custom exception should have a version number of '2.1803'. Additionally, you need to define a method called "_build_message" ...
glaive
You are tasked with creating a new example macro for the `syntax-parse-example` package. Your macro should accept two arguments and return the first argument. The macro should be defined using `syntax-parse` instead of the low-level `syntax-e` and `cadr` functions. Additionally, you need to provide clear documentation ...
glaive
I am trying to set up compile flags for my C and C++ projects using CMake. I want to define different compile flags for different build types, such as debug, release, and release with debug info. Additionally, I need to configure the BLAS and LAPACK libraries, as well as the BLACS and ScaLAPACK libraries for parallel c...
glaive
How can I create a function in Node.js and MongoDB that fetches and displays all documents in a paginated form where the field 'category' is 'electronics' and 'availability' is 'out of stock'? Additionally, how can I sort the results in descending order based on a 'price' field, assuming all prices are in numeric forma...
glaive
You are tasked with creating a program that reads a configuration file and sets various options based on the values provided in the file. The configuration file is in the format of key-value pairs, where the key represents a specific configuration option and the value represents the setting for that option. Your progra...
glaive
You are tasked with creating a Common Lisp program that generates an SVG file. The SVG image should have the following elements: 1. A rectangle with a stroke of "none" and a fill of "white" covering the entire canvas. 2. Three lines with different stroke widths and positions. 3. A polyline with a stroke width of 14, a ...
glaive
You are tasked with creating a module for a search feature in a web application. The module should include functions for making requests to an API, decoding JSON responses, and manipulating search filters. The module should also define data types for search terms, filters, and search results. Your task is to implement ...
glaive
You are tasked with implementing a register that allows for clearing of interrupt bits in a microcontroller system. The register has several fields, each of which corresponds to a specific interrupt source. Your task is to implement the necessary code to clear the interrupt bits for various interrupt sources. You are ...
glaive
You are tasked with creating a package management system in a programming language that utilizes a specific code snippet framework. The system should allow for the creation, destruction, and addition of packages, while also managing file operations and metadata. Your task is to implement the `create`, `destroy`, and `a...
glaive
I am trying to create a Tizen calendar event using JavaScript in a Tizen application. I need to create a function that allows users to input the summary, description, location, and time for the event, and then adds the event to the default calendar. The function should handle user input validation and error handling wh...
glaive
How can I create a JavaScript helper function that takes an array as an argument and returns an array with only the unique elements?
glaive
I am trying to create an application using the given framework and technology, but I am having trouble implementing the connection to another app. I need to establish a connection to another app and obtain services from it. Can someone please provide a solution for how to connect to another application and obtain servi...
glaive
I'm working on a Python project and I need to find the most frequent element in an array. Can anyone provide me with a function that can accomplish this?
glaive
: You are tasked with running the Empirical Data Curation portion of the PCORnet Data Curation Query Package v5.12. The purpose is to process PCORnet CDM v5.1 SAS data stores using SAS programs and files. The inputs consist of datasets or views, along with specific SAS programs and files. The outputs include normalized...
glaive
You are required to create a simple functional reactive calculator using Reflex-Dom framework in Haskell. The calculator should have the following features: - Number pad with digits 0-9, and a decimal point - Buttons for addition, subtraction, multiplication, and division - An equals button to perform the computation -...
glaive
I am working on a project that requires me to install a specific version of the "wt" library from Github using vcpkg. I need to apply a patch to the source code before configuring and installing it. However, I am encountering issues with the installation process. Can someone provide me with a step-by-step solution to i...
glaive
I have a specific string in Python that contains dictionary elements. How can I extract the dictionary elements from the string? Specific string: "{'test1':1, 'test2':2}"
glaive
You are tasked with creating a program that utilizes the Azure::Network module to troubleshoot network watchers and retrieve the result. Your program should include a method to handle any errors that may occur during the troubleshooting process and provide detailed error details. Create a Perl program that defines a p...
glaive
You are tasked with creating a game object in GameMaker Studio that represents a dead knight character. The object should have the following properties: - Name: objknightdead - Path to sprite: sprites/sprknightdead/sprknightdead.yy - Solid: false - Visible: true - Physics Object: false - Physics Sensor: false - Physics...
glaive
You are tasked with implementing a WebSocket server in Lua that can handle incoming connections and process messages from clients. Your task is to create a class `WebSocketInstanceBase` that will handle the WebSocket server logic. The class should have the following functionalities: - Authenticate the client connection...
glaive
You are tasked with creating a Lua script for an Nginx server that restricts access based on certain conditions. The script should check if the client's IP address is in a blacklist, and if the request body contains any prohibited words. If these conditions are met, the script should redirect the client to a specific p...
glaive
You are tasked with implementing a function to compute the logarithm to a given base for a series of data. The function should take a series of data as input and return a new series where each element has been transformed by taking the logarithm to the specified base. The series can contain various numeric data types i...
glaive
You are tasked with implementing a function in Elm that takes a list of integers as input and returns the sum of all the integers in the list. The function should be named "sumList" and should be defined within the Elm.Parser.Declarations module.
glaive
How can I design a data structure to store student information and quickly retrieve it based on their name, phone number, and email address?
glaive
I want to create a GraphQL API to manage a list of products. The API should have functionalities to query all products, get a single product by ID, create a product, update an existing product, and delete a product. Can you provide an example of how to implement this using Apollo Server and GraphQL?
glaive
What is the code for generating a solution that uses the linear regression method to fit the given data?
glaive
You have been tasked with analyzing a dataset of real estate transactions recorded from 1964 to 2016. The dataset can be found in a file named "week-6-housing.xlsx". Your goal is to use statistical correlation, multiple regression, and R programming to analyze the dataset and make predictions about real estate sale pri...
glaive
You are tasked with implementing a router tree in the Horse framework for handling HTTP requests. The router tree should be able to register routes for different HTTP methods and execute the appropriate callbacks based on the HTTP method and request path. Your task is to create a class `THorseRouterTree` with the foll...
glaive
You are tasked with creating a Bash script to automate the configuration of a vCenter Event Broker Appliance. The script should perform the following tasks: 1. Disable IPv6 by adding "net.ipv6.conf.all.disable_ipv6 = 1" to /etc/sysctl.conf 2. Apply the latest updates using tdnf 3. Install additional packages including ...
glaive
You are tasked with implementing a module for manipulating coercions in Haskell. The module needs to provide functionality for adding and displaying coercions. The module should also handle checking the coherence of coercions and trying compositions of coercions. The code snippet given includes a rough outline of the m...
glaive
You are tasked with creating a Dockerfile to build a custom image for a Python application. The Dockerfile should include the necessary commands to install Python 3, pip, and virtualenv. Additionally, the image should display a message about the deprecation of Python 2 and provide information about the image's details....
glaive
You are tasked with creating a simple customer management service using proto file for the Google Ads API. Your task is to define the proto file for the Customer service, which includes defining the service itself along with request and response messages for various operations such as fetching a customer, updating a cu...
glaive
You are tasked with creating a Tcl script that will search for a specific file path and then run a command based on the result. Your script should include a function called findRtfPath that takes a relative path as input and returns the full path if it exists. You will then need to source a specific Tcl script using th...
glaive
You are tasked with defining a new type `MyType` and equipping it with the structure of a semi-normed group. A semi-normed group is a mathematical object that combines the properties of a group and a semi-normed space. You need to define the operations and properties required for `MyType` to be considered a semi-normed...
glaive
How can I create a React application that displays a list of users from a database and allows me to add, edit, and remove users from the list?
glaive
I need to implement a function in Maple that computes the double Schubert polynomial for a given Weyl group element. The function should take the Weyl group element as input and return the corresponding double Schubert polynomial.
glaive
You are tasked with creating a CUDA program that adds two arrays and stores the result in a third array. The program should take two input arrays, add the corresponding elements together, and store the result in a third array. You need to define a function that performs the addition and a main function that initializes...
glaive
You are tasked with implementing a module in SystemVerilog to perform assertion checks for a SECDED (Single Error Correction, Double Error Detection) code. The module should take into account error injection, syndrome output, and data input to ensure the correctness of the implemented checks. Specifically, the module s...
glaive
You are tasked with creating a program that finds the shortest path between two points in a network of connected nodes. The network is represented by a collection of weighted nodes, with each node having links to other nodes. Your program should be able to handle scenarios where the provided start or goal nodes do not ...
glaive
You are tasked with writing a shader function that manipulates the depth coordinate of vertices based on certain conditions. Given the following code snippet as a reference, create a shader function that applies the following logic: - Calculate the normalized vector N using the provided uniform matrix and vertex normal...
glaive
You are tasked with implementing a TestAPI service using the proto3 syntax. The service will include four methods: ForwardMethod, BackwardMethod, BidirectionalMethod, and EmptyMethod. Each method will have specific requirements for request and response messages. The TestAPI service should also include a package and go_...
glaive
What is a possible solution to generate a boolean expression that tests if the string 'hello' is contained in a given array of strings?
glaive
You are tasked with creating a new endpoint that handles the `GET /summary` route in a web application. This endpoint is responsible for providing metadata about a crate, including the number of crates, number of downloads, new crates, most downloaded crates, most recently downloaded crates, just updated crates, popula...
glaive
You are tasked with creating a module in a programming language that supports interfaces and modules. The module should have a reset port and implement an interface. The reset port should be named "RST_N_r" and the interface should be named "Ifc". Your task is to write the code for the module that fulfills these requir...
glaive
I am working on a project using Go and need to create a script that will build, test, and deploy the code. Can someone help me write a script that will automate these tasks for me? I need the script to be able to build the code, run tests, deploy to Heroku, and perform other necessary tasks for the project. It should b...
glaive
I am trying to implement local regression using LOESS in R, but I am having trouble finding the optimal smoothing span for my data. I want to minimize the error and find the value of span that minimizes the Sum of Squared Errors (SSE). I have tried graphically inspecting the results, but I am looking for a more systema...
glaive
How can I use Python to send an HTTP request to an API endpoint and retrieve the response?
glaive
You are tasked with implementing a parallel reduction kernel in CUDA that computes the minimum value of an array and measures the performance of each block accurately using the clock function. The kernel should take in an input array, compute the reduction, and store the minimum value in an output array. Additionally, ...
glaive
I am using the IAR IDE to build ARM executables from C source code. I can see the disassembly, including labels, addresses, opcode, and instructions in the relevant window. However, I am trying to dump the contents of a range of addresses to a text file, but I can't find a way to do that. The window text is not selecta...
glaive
You are tasked with creating a custom reporting system for a task management application in Python. The custom report should be able to filter, sort, and display specific fields from the task data. The report should also be able to display custom labels for the fields and apply alternate color formatting. Your task is ...
glaive
You are tasked with creating a program to manage IP addresses in a Linux environment. The program should be able to perform the following tasks: 1. Display network interfaces with their addresses. 2. Show only the active network interfaces. 3. Show information about a specific interface. 4. Add an address to an interf...
glaive
You are tasked with creating an XML language file using the MPS (Meta Programming System) tool. The XML language file should contain a namespace, a unique identifier (UUID), a version, models, generators, dependencies, used languages, used devkits, language versions, runtime, and extended languages. The XML language fi...
glaive
You are tasked with implementing a custom search strategy for the auto function in a programming language. The auto function takes in a search strategy, a depth, a hint database, and two AgTerm parameters. The search strategy is represented by a Strategy type, which is a function that searches a SearchTree up to a spec...
glaive
You are tasked with implementing a multi-threaded application in Rust that requires synchronization between threads. You need to create a solution that utilizes mutex and condition variables to ensure proper synchronization and communication between multiple threads. Your task is to create a program that simulates a p...
glaive
I am trying to find the OpenGL Core Profile (CP) header file in my project. I want to locate the glcorearb.h file, and I need to define the following: - GLCORE_FOUND: Set to TRUE if glcorearb.h is found - GLCORE_INCLUDE_DIR: The parent directory of the directory (gl, GL3, or OpenGL) containing the CP header - GLCORE_GL...
glaive
You are tasked with creating a Turing.jl model for the fairness_income_model, which involves modeling probabilities based on gender, capital gain, age, and relationship status. The original model has some issues with the range of age and the scale parameter of the Normal distribution. Your task is to create a Turing.jl...
glaive
What is the SQL code to create a table with columns for Name, Email, and Age?
glaive
You need to implement the ISAI (Incomplete Sparse Approximate Inverse) preconditioner for a given sparse matrix. The ISAI preconditioner is a way to approximate the inverse of a sparse matrix, which is useful for iterative methods to solve linear systems. The specific task is to implement the CUDA kernel for the ISAI p...
glaive
: You are tasked with creating a dynamic web page using JSP (JavaServer Pages) and JSTL (JavaServer Pages Standard Tag Library) to display a list of goods for an e-commerce website. The page should include the following features: 1. Display a navigation bar with a link to the homepage and the name of the current produc...
glaive
How can I write a JavaScript program to classify a list of words as nouns, verbs, or adjectives?
glaive
I need to write a function to count the number of rectangles in a given grid of strings. A rectangle is formed by the intersection of vertical and horizontal lines, represented by specific characters. The function should take a list of strings as input, where each string represents a row in the grid, and return the tot...
glaive
You are tasked with creating a function that implements the falling factorial operation on arrays of various dimensions. The falling factorial of a number n by k (n_k) is defined as the product of k consecutive terms, starting from n and decreasing by 1 each time. Your function should be able to handle arrays of intege...
glaive
<p>How can I make an interpreted language (specifically LuaJIT) call a Rust function that returns a string? The code I have crashes before I even dereference the pointer. I've read that Rust strings are not null-terminated, so I tried using the <code>to_c_str()</code> function to create a null-terminated string. Howeve...
glaive
: You are tasked with creating a class in Node.js to represent information about books. The class should have properties for the title, ISBN, and author. The title should be a string, the ISBN should be a model of type 'isbn', and the author should be a model of type 'member'. Create a class that satisfies these requir...
glaive
You are tasked with implementing a CUDA program for LDPC decoding. The program should perform the following tasks: 1. Read in a given matrix, h_base, which represents the parity check matrix for LDPC coding. 2. Generate compact forms of the parity check matrix, h_compact1 and h_compact2, based on the given matrix. 3. P...
glaive
Is there any recent work being done on optical character recognition for Indian scripts like Hindi, Marathi, and Sanskrit using modern Machine Learning techniques? I am aware of some research being done at ISI, Calcutta, but as far as I know, nothing new has been released in the last 3-4 years. Currently, OCR for Devan...
glaive
I am trying to write a Java program that takes a word input from the user and displays the number of vowels within the word. Can someone help me with this?
glaive
You are tasked with implementing a VHDL entity for a reset module for a Xilinx Zynq design. The entity should have the following input and output ports: Inputs: - slowest_sync_clk: a standard logic signal for the slowest synchronous clock - ext_reset_in: a standard logic signal for the external reset - aux_reset_in: a...
glaive
You need to write a module to find the CTL library in specified directories. The module should look into the directories defined by the variables CTL_PATH, CTL_INCLUDE_PATH, and CTL_LIBRARY_PATH. It should define the following variables: - CTL_FOUND: True if CTL was found. - CTL_INCLUDES: where to find CTL.h - CTL_LIBR...
glaive
You are tasked with creating a PowerShell Desired State Configuration (DSC) script that will enable and disable software iSCSI for a VMHost. The script should include the following parameters: - Server: The name of the vCenter Server - User: The username for authentication - Password: The password for authentication -...
glaive
You are tasked with implementing a function to save and retrieve place data using shared preferences in an Android application. The function should be able to save a Place object with a unique key and retrieve the saved Place using the same key. Additionally, you need to implement a function to check if a Place is alre...
glaive
How can I create a new GMScript resource in my GameMaker Studio project and define its properties such as name, tags, resource version, etc.?
glaive
You are working with a database that contains a table named sales. This table contains the following columns: seller_id (integer) and price (integer). You need to write a T-SQL query to find the seller_id with the highest total sum of prices. Write a T-SQL query to achieve this using the common table expression (CTE)...
glaive
You are tasked with creating a CUDA kernel for a radix sort algorithm. The kernel should take in an input array of unsigned integers, along with an array for reordering indices. The goal is to implement a parallel radix sort algorithm using warp-level primitives and shared memory (LDS). The code should account for the ...
glaive
You are tasked with creating a Python program that takes in a list of integers and returns the maximum and minimum values in the list. Ensure that your program can handle both positive and negative integers, as well as duplicate values in the list.
glaive
You are tasked with creating a form in HTML/CSS with specific styling requirements. The form should have the following elements: - A heading with padding of 10px top and bottom, and 12px left and right - An input field for exporting data with a width of 60% - A sub input field for filtering data with a width of 159px -...
glaive
: You are tasked with writing a program that reads a file of integers and calculates the number of increases in the sequence of integers. An increase is defined as a number that is greater than the previous number. Write a function that takes a file path as input and returns the number of increases in the sequence of ...
glaive
You are tasked with creating a messaging system that allows users to send messages and execute transactions. You need to define a protocol buffer message type for the body of the transaction, including the messages to be executed, a memo, and a timeout height. Additionally, you need to create a message type for the aut...
glaive
You are tasked with implementing a data serialization and deserialization system in Java using Apache Thrift. The system involves defining data structures and their layouts, as well as serializing and deserializing data for efficient storage and retrieval. The system should support various types of data structures, inc...
glaive
You have been tasked with writing a CMake script to locate and set up the Python interpreter, libraries, debug libraries, and includes. Your script should first check if the Python interpreter is found, and if not, it should test the PYTHON_EXECUTABLE from the environment and set it as the Python interpreter if it exis...
glaive
You are tasked with implementing a parametric register file design that supports a single write port and dual read ports. The register file should have the following features: 1. Resetless registers 2. Forwarding when reading and writing to the same address The module should include the following parameters and ports:...
glaive
You are tasked with defining the features in the simulation/fpga/asic for a chip configuration. The chip configuration should indicate whether the code is for simulation, FPGA implementation, or ASIC implementation. Additionally, for FPGA implementation, the code should also define specific configurations for different...
glaive
You are tasked with writing a Lua program that reads and processes data from a map file. The map file contains various pieces of information such as map dimensions, tile data, spawn points, and more. Your goal is to parse the map file and extract relevant information for further processing. Write a Lua function that c...
glaive
Can you help me construct a regex expression to validate a password that meets certain criteria?
glaive
You are tasked with creating a Hubot script that responds to two different commands related to otters. The first command, "hubot otter fact", should display a random otter fact from a predefined list. The second command, "hubot otter me", should display a random image of an otter from a predefined list of image URLs. Y...
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 variables from the ASCII file. The variables to be included in the program are: - AHAID: AHA hospital identifier with the l...
glaive