instruction_seed stringlengths 29 40.5k | source stringclasses 6
values |
|---|---|
You are tasked with creating a makefile for a project called msm8909. The makefile should have the following requirements:
- Set the LOCAL_DIR variable to the result of the GET_LOCAL_DIR function
- Set the TARGET variable to "msm8909"
- Add the "app/aboot" module to the MODULES list
- Set the DEBUG variable to 0 if the... | glaive |
You are tasked with implementing a TabletClientService in Java using Apache Thrift. The TabletClientService extends the client.ClientService and needs to include methods for scanning a range of keys, scanning over a series of ranges, making batch updates to multiple tablets on a tablet server, making a single update to... | glaive |
I am trying to implement a similarity search using manifold learning in Julia. I want to use the SimSearchManifoldLearning package to perform the similarity search, but I am having trouble understanding how to initialize the embedding, compute the membership strengths, and optimize the embedding. Can someone provide a ... | glaive |
You are tasked with creating a Vue component for a design management application. The component, called DesignScaler, is responsible for scaling a design. It should have the following features:
- Three buttons: "plus", "reset", and "minus"
- When the "plus" button is clicked, it should emit a @scale event with a scale ... | glaive |
You are tasked with creating a mock producer for testing code that uses Kafka. The mock producer should allow the user to control the completion of the call and supply an optional error for the producer to throw. The mock producer should be able to add records to the list of sent records and complete each send call suc... | glaive |
You are tasked with creating a Java program that utilizes the DataStax driver to insert entities into a Cassandra database. The program should include the following functionalities:
1. Insert an entity into the database and verify that it has been successfully inserted.
2. Insert an entity into the database and return... | glaive |
I need help creating a Python program that performs merge sort on a list of integers. The catch is that I need to implement the merge step without using any additional lists or data structures, apart from the input list and a single additional integer variable. Can someone provide a detailed solution for this?
```pyth... | glaive |
You are tasked with creating a CMake function to generate a shared library using the given source and header files. The function should also handle precompiled headers if they exist in the source and include directories. Additionally, the function should define compile definitions based on the module name and set the t... | glaive |
You are tasked with implementing a CUDA program that performs matrix multiplication and verification. The program should generate two random matrices A and B, each with dimensions m x n, and then compute their dot product using CUDA. After the dot product is computed, the program should verify the result by performing ... | glaive |
You are tasked with creating a migration file for a "products" table in a Laravel application using the Eloquent ORM. The "products" table should have the following columns:
- id: an auto-incrementing integer that serves as the primary key
- name: a string with a maximum length of 255 characters
- description: a text f... | glaive |
You are tasked with implementing a Prolog predicate that concatenates a list of atoms into a single atom. The predicate should take a list of atoms as input and output the atom obtained by concatenating all the atoms in the list. The predicate should be able to handle both input and output variables.
Write a Prolog pr... | glaive |
I am building a website header using styled-components in React and I want to create a dropdown menu that appears when a user hovers or clicks on a button. The dropdown menu should have a card-like design with some padding, display a list of links, and have a smooth transition when it appears. Additionally, I want to h... | glaive |
I am working on a project where I need to create a database table for storing information about products. Each product should have a unique identifier, a name, a description, and a price. I want to ensure that the product_id is automatically generated and that all fields are required. Can someone provide me with the SQ... | glaive |
You are tasked with implementing a CUDA-based tensor class in C++ to perform various image processing operations. The tensor class should support operations such as convolution, combining images, color mapping, sRGB to YCxCz conversion, and EXR and PNG image loading and saving. Additionally, the tensor class should be ... | glaive |
You have been tasked with implementing a function in Racket that takes a stream as input and groups its elements into equivalence classes based on a given key and same function. The function should preserve the ordering of the original list within each equivalence class and the equivalence classes themselves should be ... | glaive |
What Java function can I use to calculate the quotient of two integers and return it as a double? How can I handle the scenario where the second integer is 0? | glaive |
You need to write a script that prepares the environment variables and executes a series of commands based on certain conditions. You have to create a directory, set environment variables, and then run certain user-defined commands. Finally, you need to copy output files to a specific location. Write a script in csh th... | glaive |
I've been using a DEC PDP-8 Minicomputer and I always start my programs by issuing the instruction "CLA CLL" to clear the accumulator and link bit. However, I'm now working with the 8086 range of processors and I can't seem to find an equivalent instruction. I've seen discussions online suggesting XORing a register wit... | glaive |
You are tasked with implementing a CUDA kernel for the Rectified Random Linear Unit (RReLU) forward pass in a custom layer for the Caffe deep learning framework. The RReLU activation function is defined as follows:
RReLU(x) = x (if x > 0) and RReLU(x) = x / α (if x ≤ 0), where α is a random slope sampled from a unifo... | glaive |
:
I am working with GMScript and I need to create a function that adds all the elements from one ds_list to another ds_list. Can someone provide a solution for this? | glaive |
You are tasked with implementing a function to calculate the factorial of a given number in Lisp. The factorial of a non-negative integer n is the product of all positive integers less than or equal to n. Your function should take a single parameter x and return the factorial of x.
Write a function called "factorial" ... | glaive |
You are tasked with creating a Node.js function that takes in a file and converts it to a specified output format. The function should be able to handle different input file types (e.g., pdf) and output formats (e.g., jpg, png) and also allow for custom conversion settings (e.g., density, quality, etc.).
Create a func... | glaive |
You need to create a Python program that takes a two-digit number as input from the user and performs the following checks:
- If the number is negative, print "num is minus"
- If the number is 0, print "num is 0"
- If the number is between 1 and 50, print "num is greater than 0"
- If the number is between 51 and 99, pr... | glaive |
You are working on a project that requires running a specific Docker image named "xeon-ubuntu1604-graphics-dev" and you need to write a bash script to automate this process. Your script should handle any errors during the execution of the commands and should be able to find the directory of the script being executed. W... | glaive |
You are tasked with implementing a system for transferring items and fluids to and from an Applied Energistics (AE) network using OpenComputers (OC) in Minecraft. The system should be able to interface with AE's storage and wireless access points, as well as interact with robots and drones in the game.
Your task is to... | glaive |
You are tasked with creating an opaque type in Zig that has a field of type i32. However, when attempting to define the opaque type with a field, the following error is encountered:
```
tmp.zig:1:25: error: opaque types cannot have fields
```
Create a solution to define the opaque type with a field of type i32 without ... | glaive |
I need to create a UuidResolverHandle implementation in Rust using the tokio library. This UuidResolverHandle should have methods to get, delete, list, insert, snapshot, get_size, and dump Uuid data. The UuidResolverHandle should use tokio's mpsc and oneshot channels for communication and should also interact with a He... | glaive |
You are tasked with implementing a data loader for a neural network using the CUDA framework in C++. The data loader has two main functions: `load_input` and `load_label`. The `load_input` function takes in a batch of input data and copies it to a specified region in memory. The `load_label` function does the same for ... | glaive |
You are tasked with creating a Go program that will execute Ansible operations asynchronously. The program should be able to handle the execution of Ansible operations on a given node and deployment. The program should also handle monitoring and retrying operations if necessary.
Create a function to execute asynchrono... | glaive |
You are tasked with implementing a channelizer class in C++ using the cusp library. The channelizer class is designed to split a signal into multiple frequency bands (channels) using a set of filter taps. The class should also handle the parallel processing of the input signal using CUDA.
The channelizer class should ... | glaive |
You are tasked with creating a database schema for a job scheduling and execution system using SQL. The system should support the following entities:
1. BATCH_JOB_INSTANCE:
- JOB_INSTANCE_ID (primary key)
- VERSION (optional)
- JOB_NAME (not null)
- JOB_KEY (not null, unique constraint on JOB_NAME, JOB_KEY... | glaive |
You are tasked with implementing a CuratorService that provides various operations for managing nodes in a distributed system using Apache Curator. The service should include methods for acquiring locks, creating and deleting nodes, checking for the existence of nodes, getting children of a node, getting data of a node... | glaive |
You are tasked with creating a program that involves writing large amounts of data to a Redis server. The challenge is to handle situations where the data being written is too large, causing the program to fail. The program must be able to detect and handle these scenarios, ensuring that the server does not crash due t... | glaive |
I am using ActiveRecord in my Ruby application and I noticed that by default, it creates public attributes for all the fields in the corresponding database table. However, I believe that not all attributes should be public and exposing them clutters the model's interface and violates encapsulation. Is there a way to ma... | glaive |
I need to delete all triples where the subject belongs to the types toezicht:DecisionType or toezicht:RegulationType in a specific graph with the URI <http://mu.semte.ch/graphs/organizations/141d9d6b-54af-4d17-b313-8d1c30bc3f5b>. How can I achieve this using SPARQL? | glaive |
You are tasked with creating a struct in Rust for constructing a status with various attributes. The struct, called `StatusBuilder`, should have the following fields:
- status: The text of the status
- in_reply_to_id: Id of status being replied to
- media_ids: Ids of media attachments being attached to the status
- sen... | glaive |
What is the code to generate the Fibonacci sequence? | glaive |
How do I go about parsing a CSV file in C++? Can you provide an example with code? | glaive |
You need to implement a real to complex transformer using the FFTW library in Fortran. The transformer should be able to handle memory allocation for FFTs and should provide functions to initialize the transformer, execute a real to half complex transform, and execute a half complex to real transform. The transformer s... | glaive |
I am trying to create a program that evaluates mathematical expressions involving variables x and y. The expressions can include operations such as sine, cosine, average, times, threshold, and a special function ECosSin. However, there seems to be an issue in the ECosSin function implementation, as it is causing a type... | glaive |
You are tasked with implementing a server-side application using Protocol Buffers and gRPC. The application needs to provide the following functionalities:
1. Health Check: Implement a method to check the health of the server, which should return the server's health status, version, and start time.
2. Server Options:... | glaive |
I am working on a web application layout using CSS flexbox, and I need to create a control panel that can be displayed either horizontally or vertically depending on the screen size. The control panel should have a main area and a set of controls, and the layout should adjust dynamically based on the screen orientation... | glaive |
You are tasked with creating a Gradle plugin that generates Safe Args classes for Android Navigation Component. The plugin should be able to handle incremental changes to the navigation graph XML files and generate the corresponding Safe Args classes.
Your task is to implement the `runGenerateTask()` method in the `Pl... | glaive |
You are tasked with creating a plugin service in Groovy that will handle the loading, configuration, and validation of plugins for a specific framework. Your goal is to implement the following methods:
1. `getPlugin(name, type)`: This method should retrieve a plugin of a given type by its name.
2. `retainPlugin(name,... | glaive |
You are tasked with creating a program to set a tridiagonal matrix with specific values. The matrix should have the following structure with padding zeros for memory alignment:
0 / 1 3 . . . \ -> { 0, 1, 3 }
| 2 1 3 . . | -> { 2, 1, 3 }
| . 2 1 3 . | -> { 2, 1, 3 }
| . . 2 1 3 | -> { 2, 1... | glaive |
You are tasked with writing a shader program in GLSL (OpenGL Shading Language) that takes in a 2D texture and applies a specific color manipulation to it. The program should include a main function that calculates the final color of each fragment based on the input texture and certain manipulation parameters. The manip... | glaive |
I am trying to implement a CUDA function that performs sequence softmax, but I am struggling with the CUDA kernel code. The function takes in input data, sequence offsets, sequence numbers, and outputs the softmax result for each sequence. I need to write a CUDA kernel that correctly computes the softmax for each seque... | glaive |
You are tasked with implementing a user management system using the Apache Accumulo client service in Java. The system should allow for creating, dropping, and changing passwords for local users, as well as authenticating and authorizing users.
Your task is to create a Java program that utilizes the Apache Accumulo cl... | glaive |
I'm looking for an example of how to calculate the sine using a coprocessor. I came across this function:
```
CalcSin
fld long [angle] ; st(0) = angle
fsin ; st(0) = sin(angle) (angle is in radians)
fstp long [SinX] ; SinX = sin(angle)
```
I wa... | glaive |
You are working on a project that involves handling financial data in Emacs using the beancount package. You have noticed that the beancount package does not properly align the amount in the current line to `beancount-number-alignment-column`. This is causing issues with the formatting of the financial data, and you ne... | glaive |
You are tasked with creating a shader program that calculates the ambient color of an object based on its depth in a 3D scene. The program should take into account the maximum depth of the scene and the depth of the current fragment being rendered. The ambient color should be calculated as the product of the ambient co... | glaive |
You are tasked with creating a class called ResultValueString in Python. The class should have the following properties:
- **value**: a string that holds the value itself. This property is optional.
- **result_value_type**: a string that specifies the type of result value. The available values for this property are: R... | glaive |
I'm trying to gain a better understanding of how floating point conversion works at a low level. From my understanding, hardware implementations handle this process. For example, SSE provides the instruction `cvttss2si` which converts a float to an int.
However, I'm curious to know if floating point conversion was alw... | glaive |
You are working with R programming and need to create a custom theme for your ggplot2 plots. The theme should update the background and labels, and set the default plot dimensions to 12 x 6. Additionally, you need to generate a vector of random normal variables and reproduce the same set of random numbers.
Create a cu... | glaive |
You are required to write a program that implements a cross-validation scheme using the rrBLUP library in R. The program should take as input a genetic matrix (e.g., geno.csv), a phenotypic matrix (e.g., pheno.csv), a file containing selected features or "all" for all the markers in the genetic matrix, the column name ... | glaive |
I am trying to get similar results on the same dataset using both Keras and PyTorch. However, my Keras model produces a test Mean Squared Error (MSE) almost 0, while my PyTorch model has an MSE of about 6000, which is significantly different. I have tried a couple of tweaks in the PyTorch code, but none got me anywhere... | glaive |
You are required to write a C++ program using the Thrust library to implement the SAXPY (Single-precision A*X Plus Y) operation, which computes the sum of a scalar multiple of a vector X and a vector Y. The SAXPY operation is defined as Y = A * X + Y, where A is a scalar and X and Y are vectors of the same length.
You... | glaive |
You are tasked with creating a program that can encode and decode a custom data type called Tag9000ExifVersion. The program needs to have the ability to encode the value of Tag9000ExifVersion to a byte array and decode a byte array back to the original Tag9000ExifVersion value. The program should also include a method ... | glaive |
You are tasked with implementing a comparator module in Racket. A comparator is an object that compares two values and determines which (if either) is greater. Your task is to create the following components:
1. Define a predicate function `comparator?` to check if a given value is a comparator.
2. Implement a functio... | glaive |
You are tasked with creating a Gem specification for a new Ruby gem called "data_generator". The gem should include the following information:
- Name: data_generator
- Version: 1.0.0
- Authors: Your name
- Email: Your email
- Summary: A tool for generating test data for development and testing purposes.
- Description: ... | glaive |
You are tasked with creating a parser in Common Lisp that can handle various grammar expressions and produce the expected results. Your task is to define a macro called `defparser` and a macro called `defterm` to define the parser functions. The `defparser` macro should take a name, a list of arguments, and a body of e... | glaive |
I have been hearing a lot about Stackless Python and there are many questions related to it, but I haven't found a comprehensive answer to my specific question. What would I primarily use Stackless Python for and how is it better than CPython? I understand that it has green threads (stackless) that allow for the creati... | glaive |
You are tasked with creating a PowerShell cmdlet that creates an access policy for AWS IoT SiteWise. The access policy should grant a specified identity (AWS SSO user, AWS SSO group, or IAM user) access to a specified AWS IoT SiteWise Monitor portal or project resource. The cmdlet should support should process and have... | glaive |
How can I retrieve the maximum value from a specific column in a SQL table? | glaive |
Is there a way to write a Python program that can generate all possible subset combinations of a given set? I want to be able to input a set and get back a list of all the possible combinations. | glaive |
Can you provide an example of how to write an application in Kotlin that prints the elements in a given list? | glaive |
I want to develop a neural network model in TensorFlow to perform a binary classification task. How can I achieve this? | glaive |
You are tasked with creating a CMake file to set up the build system for a project that involves handling data sources and headers. You need to define the directories for the data sources and headers, as well as specify the source files to be included in the build. Write the CMake code to achieve this, ensuring that th... | glaive |
You are tasked with creating a new implementation of an IAVL store in Go. The IAVL store should have the following functionality:
1. Set: Set a key-value pair in the store.
2. Get: Retrieve the value associated with a given key.
3. Has: Check if a key exists in the store.
4. Delete: Remove a key-value pair from the st... | glaive |
You are tasked with creating a package in VHDL to define ASCII constants for uppercase letters (A-Z) and digits (0-9). The package should include subtypes for ASCII characters and constants for each letter and digit in their respective ASCII representation. | glaive |
How can I write a function in Python that parses a given JSON string, extracts the values of the "name" and "age" fields, and then prints a new JSON string with the name reversed and the age incremented by 1? Additionally, how can I handle input validation for malformed JSON strings?
Here is an example of the desired ... | glaive |
I am working on a web application and I need to create a table to display some contest details. I want the table to have a width of 882px and be centered on the page. Additionally, I want the font size of the table cells to be 14px. Can someone please provide the HTML and CSS code to achieve this? | glaive |
I am trying to implement a rename stage in a processor design, but I am facing some challenges. I need to ensure that the renaming process works correctly and efficiently. I also need to handle deadlock situations and ensure that the performance metrics are properly tracked. Can someone provide a complete implementatio... | glaive |
You are tasked with automating the process of downloading and building a specific branch of a project using Python. You need to create a Python script that can accomplish the following tasks:
1. Set the working directory to "C:\code".
2. Set the GN_DEFINES environment variable to "is_official_build=true use_thin_lto=fa... | glaive |
I am working on a React application that displays transaction data in a table format. I need to create a component that takes in an array of transactions grouped by date and renders each date along with its corresponding transactions in a visually appealing way. The component should display the date as a title and then... | glaive |
I am trying to create a web service that fetches data from Google and Apple using their respective APIs, and then use a scraper to extract the relevant information. I have already implemented the fetch and scraper modules, but I am having trouble with the google and apple functions.
For the google function, I need to... | glaive |
You are tasked with creating a PowerShell script that runs a series of tests for PowerShell modules. The script needs to install Pester and PSFramework if the environment variable BUILD_BUILDURI matches the pattern "vstfs*". It should then import the Daybreak2018Tools module and run tests for both general and individua... | glaive |
You are tasked with creating a service in Kotlin that manages shadowsocks connections. The service will be responsible for handling profile configurations, starting and stopping connections, and monitoring traffic. The service must also be able to register and unregister callbacks, start and stop bandwidth listeners, a... | glaive |
You are tasked with creating a function that loads multiple files in a specific order in Corman Lisp. The function should take a list of file names as input and load each file in the specified order. The function should also display a message when compiling each file if the Corman Lisp client type is 2, or print the me... | glaive |
I have a controller called 'companies' and I want the URLs for each company to use their name instead of an ID. For example, I want the URL to be "url/company/microsoft" instead of "url/company/3".
In my controller, I have the following code:
```ruby
def show
@company = Company.find(params[:name])
end
```
I assum... | glaive |
You are tasked with creating a PowerShell script to test and configure the DCUI timeout value on a VMware host. The script should include the following components:
- Define a test title, such as 'DCUI Timeout'
- Provide a test description that explains the purpose of the value to the user
- Specify the desired value fo... | glaive |
You are tasked with creating a Scala program that includes a function to check if two values are of the same type. The function should take two arguments of any type and return true if they are of the same type, and false otherwise. You should also create a main function to test your type checking function with differe... | glaive |
You are tasked with creating an XSL stylesheet to transform XML data into a formatted document for a university's grading system. The XML data contains information about students, their courses, grades, and other relevant details. Your task is to create an XSL stylesheet that will transform this XML data into a formatt... | glaive |
You are tasked with implementing a function that performs a series of complex operations involving low-level assembly language and SIMD instructions. The function is part of an EhSolver algorithm and is responsible for processing data and making links based on specific patterns. The input includes data stored in an arr... | glaive |
You are tasked with creating an Emacs Lisp function that will determine if the current version of Emacs being used is version 26 or higher. Your function should return a boolean value based on this determination.
Write a function called `is-emacs-26+` that takes no arguments and returns a boolean value of `t` if the c... | glaive |
You are tasked with implementing a class that will test the similarity of different Abstract Syntax Tree (AST) nodes in a programming language. You need to create three distinct methods within the class:
1. testAstArraySimilarility: This method will take in five AST arrays and test their similarity based on their expre... | glaive |
You are tasked with creating a custom button control in a Windows Forms application using VB.NET. The button should have three different states: Normal, Over, and Down. When the mouse enters the button area, the button should change to the "Over" state, and when the mouse leaves the button area, it should return to the... | glaive |
I need to write a CMake script to remove a specific file or directory using the file() command. Can someone provide an example of how to use the file(REMOVE_RECURSE) command to delete a file or directory in a CMake script? | glaive |
You are tasked with creating a database table to store media items in a SQL Server database. The table should have a unique identifier for each media item and a title for the media item. Write the SQL code to create the table with the specified columns. | glaive |
You are tasked with creating a URL shortener API handler using the Cowboy HTTP server and Swagger. The API should be able to handle requests to shorten, retrieve, and delete shortened URLs. The API also needs to support authorization using API keys and error handling for validation errors.
You need to implement the fo... | glaive |
You are tasked with creating a CMake clean rule for a project directory that contains various language files, including CXX files. The clean rule should remove specific files and directories from the project directory. You need to write a CMake clean rule that removes the following files and directories:
- "../../libLL... | glaive |
You are tasked with implementing a CUDA kernel function that performs element-wise multiplication of two arrays on the GPU. The function signature should be:
```cpp
template <typename Dtype>
__global__ void mul_kernel(const int n, const Dtype* a, const Dtype* b, Dtype* y)
```
The function takes in four parameters:
- `n... | glaive |
You are tasked with creating a history tracking feature for the dired mode in Emacs using Ivy. The history tracking feature should allow users to open recent directories in dired mode using the Ivy interface. The feature should update the history whenever a new directory is opened in dired mode and integrate with comma... | glaive |
I need to create a program that will delete a specific file and its associated directory. The file is "Hockey_automoc.cpp" and the directory is "CMakeFiles/Hockey_automoc". I also need to include clean rules for each language used in the dependency scanning process. Can someone help me write a script that will accompli... | glaive |
You are tasked with creating a program that can accept a visitor and then visit a field declaration. Your program should be able to handle different types of field declarations and perform the appropriate actions based on the visitor's behavior. | glaive |
You are tasked with creating a web form to update user details including name, contact, and profile image. The form should have fields for entering the user's name and contact information, as well as an option to upload a profile image. The form should also display any error messages related to the input fields. Once t... | glaive |
You are tasked with implementing a program that solves a system of linear equations AX = B for X. The upper or lower triangular part of the matrix A is read from a data file, along with the matrix B. The program should then use the function zhpsvx to solve the system of equations and print the solution, error bounds, a... | glaive |
I am trying to simulate a network with six nodes using a network simulator tool. I want to create links between the nodes, set up a LAN, and establish TCP and UDP connections between them. Additionally, I need to schedule events for FTP and CBR traffic over these connections. Could someone provide a script in a network... | glaive |
You are tasked with creating a module to work with numbers in a programming language that supports functors. The module should include functions to work with integers, rationals, and real numbers. The module should also include implementations for arithmetic operations, comparisons, and other mathematical functions.
C... | glaive |
Can someone help me optimize this code that uses a specific data structure?
```javascript
let users = ["John", "Jane", "Jack", "Jill"]
users.forEach(user => {
console.log('Hello ' + user);
});
``` | glaive |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.