instruction_seed
stringlengths
29
40.5k
source
stringclasses
6 values
I am working on a project that involves creating a new test hierarchy, moving test code, adding a new executable to run the tests, and disabling failing tests. Additionally, I need to get the website generating again and start new test pages and a renderer. I also need to implement tests for extensions, local bindings,...
glaive
You are working on a CMake project and need to find the MIPP library to include in your build. The MIPP library provides SIMD (Single Instruction, Multiple Data) support for C++. You need to write a CMake script that searches for the MIPP library and sets the necessary variables if it is found. Write a CMake script th...
glaive
You are tasked with creating a registration form for a web application using Elm. The form should include fields for email, registration type, school name, teacher name, password, and confirm password. The registration type can be either "NewSchool" or "WithCode". If the registration type is "WithCode", the user should...
glaive
: You have been tasked with creating a web application for managing products. Your task is to write a Java server page (JSP) that takes input from a form and adds a new product to the database. The form input includes the product ID, name, category, and price. You need to write the JSP code to handle the form submissio...
glaive
You are tasked with creating a ROS package called "my_robot_control" that will contain controllers for a robot arm. The package should have a version number of "1.0.0" and be maintained by "John Doe <johndoe@email.com>". It should have build, build export, exec, run, test, and doc dependencies on the following ROS pack...
glaive
What are some popular message queues that are commonly used for Ruby on Rails applications? I am working on a small application and need to integrate a message queue to handle background tasks. I have heard about Starling and Workling, but I'm wondering if there are better options available. I'm also curious to know if...
glaive
You are tasked with creating a program that generates a sprite using the following specifications: - The sprite should have a width of 16 and a height of 16. - The sprite should be part of the "Default" texture group, located at "texturegroups/Default". - The sprite should have a composite image with a FrameId and Lay...
glaive
You are tasked with creating a configuration file for a text editor. The configuration file should enable and order various modules, each of which provides a specific functionality. The configuration file should also include specific flags for each module to customize its behavior. Your task is to create the configurat...
glaive
I am working on a project with a User model in TypeScript and I need to create a set of functions to retrieve specific user information. I need to create functions to get the user's first name, last name, full name, and email address from the User object. Can someone help me create these functions in TypeScript?
glaive
How can I execute a command in the background in Python, similar to the way it's done in Bash by appending '&'? I am trying to send a POST request using the 'requests' module in Python and I don't want to wait for it to finish. I want to print a message immediately after sending the request. Here's the code I have: ``...
glaive
I am tasked with designing a VHDL entity for a shift register with the following specifications: - It should have a generic parameter called MEM_STYLE with the default value "shiftreg" - It should have generic parameters DATA_WIDTH, ADDR_WIDTH, and DEPTH with default values of 1, 1, and 2 respectively - It should have ...
glaive
You are tasked with creating a script in csh that processes input files and performs specific operations based on the given command-line arguments. The script should be able to read in training labels and images from gzip files, and then apply various parameters and flags to perform operations such as pseudo labeling, ...
glaive
Can you provide an example of how to implement a Python class called Contact with three public properties - name, email, and phone?
glaive
Is there a way to rewrite the given program in an iterative manner?
glaive
You are tasked with implementing a class for NCCLContext, which is used for managing NCCL operations in a distributed computing environment. The NCCLContext class should be responsible for initializing communications and synchronizing operations across multiple devices. The class should also handle the allocation and c...
glaive
I'm new to Go and try to understand the language in order to write efficient code. In the following code, sizes of the two arrays differ by 140%, can someone explain this? ```go package main import ( "fmt" "unsafe" ) func main() { ind1 := make([]bool, 10) var ind2 [10]bool fmt.Println(unsafe.Size...
glaive
You are tasked with creating a program that handles CSS position types. You need to define a class that represents CSS positions and provides methods for creating, finding, and checking the existence of position values. The class should also provide a method to return a set of all available position values and a toStri...
glaive
You are tasked with creating a Scala project that includes dependencies for date/time, testing, JSON processing, HTTP client and server, and SFTP client. Your project also needs to include build information and a reference to another project. Write the build.sbt file and necessary code to fulfill these requirements.
glaive
You are tasked with implementing a NativeCompiler class in Java, using the given code snippet as a reference. The NativeCompiler class should have the following functionalities: 1. Able to obtain the compiler with the given invocation context, object file extension, and a boolean flag indicating whether to use a comma...
glaive
You are tasked with writing a program to calculate the probability of a quantum state given the amplitudes of the state for a given set of qubits. The program should also find the maximum probability within a specified range and plot the probability distribution in 3D and 2D. Write a program that: - Defines the number...
glaive
You are tasked with creating a program that handles public keys and their associated functionality. Your program should be able to: - Create a PublicKey object from a ByteStr or an Array of Bytes - Convert a public key to a corresponding Address - Convert a public key to an Address with a specified chain ID - Create a ...
glaive
I am working on a project using the Laravel framework and I need to create a new table called "product_photos" in the database. This table should have the following columns: - id: an auto-incrementing integer - path: a string with a maximum length of 50 characters - timestamps: to track the creation and update times of...
glaive
You are tasked with writing a script to automate the testing of multiple implementations of a system. The script needs to run tests for different implementations, wait for all tests to finish, clean up unneeded directories, create a new index file, create a history directory, copy index file there, copy history files, ...
glaive
I'm trying to figure out the correct way to walk a Python traceback using the C API for an application I'm developing that embeds the Python interpreter. I want to execute arbitrary Python code and if an exception gets raised, I want to convert it into my own application-specific C++ exception. For now, I need to extra...
glaive
I am trying to create a simple ray tracing program that generates spheres and draws them in random colors based on where the ray hits them. I have already defined a struct for the Sphere and a function to determine if a ray hits the sphere. I need to create a GPU kernel function that loops through each pixel in the ima...
glaive
You are tasked with creating a Python program that interacts with a SQLite database to manage a library catalog. The program should have the following functionalities: 1. Add a new book to the catalog, including the title, author, and genre. 2. Update the details of a book in the catalog. 3. Delete a book from the cata...
glaive
You are tasked with implementing a Storage interface for a RESTful storage service. The interface is expected to have the following capabilities: - Create a new instance of a resource - Update an existing resource - Delete a resource - Get a named resource - List resources based on field and label criteria - Watch for ...
glaive
You are tasked with implementing a program that processes traffic light data from an on-board unit (OBU) in a vehicle. The input data includes information about the traffic lights on different lanes and roads, as well as their colors and remaining times. The data is structured using the proto2 syntax and includes the f...
glaive
You are tasked with creating a program that involves setting up a database connection, parsing environmental configurations, and running a process queue to process and post messages to a Slack channel. Your program should involve handling signals to gracefully shutdown the process and logging any errors to a specified ...
glaive
I am using Python 3.6.1 and I've come across a strange behavior in my code. I had a typo in my dictionary assignment which took me a while to find. Here's the code: ```python context = {} context["a"]: 2 print(context) ``` The output I get is an empty dictionary `{}`. I'm confused as to what the line `context["a"]: 2...
glaive
I am trying to create a module in a hardware description language using the Clocks library, but I am encountering some issues. I want to create a module called "sysModulePort_ParentUse_NoReset_RightReset" with a submodule "mkModulePort_ParentUse_NoReset_RightReset_Sub" that takes a 32-bit input and has a rule to assign...
glaive
You are tasked with implementing a function to calculate the distance between a point and a line in a 2D plane. The function should take in the coordinates of the point and two points on the line, and return the distance between the point and the line. Implement a function with the following signature: ```rust pub fn ...
glaive
You are tasked with implementing a function that packs a sequence of alphabet codes into a more compact format. The function signature is as follows: ```cpp int PackAlphabetCodeSequence(const AlphabetCoder::Code *code_sequence, const size_t code_sequence_length, PackedAlphabetCode* packed_code_sequence); ``` Where:...
glaive
You are working on a mobile app development project using the Kotlin Multiplatform framework. You need to create a sealed class called Args that can hold different types of arguments for passing between screens. The Args class should have two subclasses: Parcel and Empty. The Parcel subclass should be able to hold any ...
glaive
You are tasked with creating a Font class in C++ for a graphics library. The Font class should have a constructor that takes a font name and point size as parameters. Additionally, the class should have a copy constructor and copy assignment operator, both of which are explicitly deleted. The Font class should also hav...
glaive
Can you help me design an algorithm to determine if a given set of words are anagrams?
glaive
You are tasked with implementing a Monte Carlo simulation in Scheme. The Monte Carlo simulation estimates the probability of an event occurring by running a large number of random trials and counting the number of successful outcomes. Your task is to write a function called monte-carlo that takes in two parameters: the...
glaive
I have an array of bytes in Golang: ```go obj_data, _ := json.Marshal(obj) ``` And I want to set this array of bytes into a `json.RawMessage`. I thought that the following code would work: ```go data := json.RawMessage{obj_data} ``` However, I am getting the following error: ``` cannot use obj_data (type []byte) a...
glaive
You are working on a project that requires you to generate a build and distribution directory for different configurations (Debug and Release) on a GNU-Linux-x86 platform. You need to create the necessary variables for each configuration and ensure that the artifact and package directories and paths are correctly defin...
glaive
You are tasked with implementing a statistical model known as the Linear Ballistic Accumulator (LBA) model for analyzing response time and accuracy data. The LBA model is commonly used in cognitive psychology and neuroscience to understand decision-making processes. The given code snippet contains functions for calcula...
glaive
Can you provide a function that takes a list of strings and returns a new list with the strings sorted in alphabetical order?
glaive
I have many constant arrays defined in multiple functions. They look like this: ```cpp const float values[4] = {-4312.435f, -432.44333f, 4.798, 7898.89}; ``` I noticed that every time the functions are run, these constants are regenerated. I suspect this is because the C/C++ spec states that even if the data is `co...
glaive
Is there a way to create a dataframe in R using a list of vectors?
glaive
I'm trying to analyze a compiled file for cybersecurity learning purposes and I want to use a specific function. I've obtained the output of `nm --defined-only ./compiled_file` which lists the defined functions in the file. However, when I try to access these functions using the ctypes library in Python, I can't find t...
glaive
I have an image with multiple characters and I want to extract each of the independent letters into individual images. I have managed to recover the contours and draw a bounding box around the characters. Now, I would like to extract each of these bounding boxes and save them as separate image files. Here's the code I'...
glaive
You are tasked with creating an XSLT stylesheet to transform XML into FO (Formatting Objects) for rendering by an XSL-FO processor. The objective is to write a template that will convert specific XML elements into the corresponding FO elements, such as creating basic links, inline formatting for text, handling special ...
glaive
You are tasked with creating a custom widget for directional arrows in a graphical user interface using the Tcl programming language. This custom widget should allow the user to choose from eight directional arrows: up, down, left, right, up-left, up-right, down-left, and down-right. Each arrow should be represented by...
glaive
You are tasked with creating a Python class that describes the operational information of a storage element. The class should have attributes for the property of interest and its corresponding value. Write a Python class `StorageElement` with the following attributes: - `property`: a string representing the property o...
glaive
You are tasked with creating a module in Erlang that handles memcached permissions. The module should be able to start a link, synchronize, initialize, filter events, handle events, generate JSON, and refresh. The module should also be able to handle bucket permissions, global permissions, and user permissions based on...
glaive
You are tasked with writing a C program that organizes a list of files, represented as strings, into different categories based on their file extensions. The program should be able to identify and categorize files based on the file extension and store them in separate arrays or data structures. For example, given the ...
glaive
I am trying to configure and install the OGRE library for my project, but I am encountering some issues. Can someone provide me with the necessary CMake configuration to build and install OGRE with the following options: - OGRE_BUILD_DEPENDENCIES set to OFF - OGRE_BUILD_SAMPLES2 set to ON - OGRE_BUILD_TESTS set to OFF ...
glaive
You are tasked with implementing a Rocket server in Rust that gracefully shuts down when a specific endpoint is hit. You need to define the necessary code to create the server, handle the shutdown endpoint, and implement the functionality to gracefully shut down the server when the endpoint is called. Your server shou...
glaive
I need to generate a MySQL query to calculate the total number of unique customers. Can anyone help me with that?
glaive
I am trying to create a module in Scheme that can fork a subprocess with input and output. I want to be able to import certain libraries and modules, and then export the functionality to run a subprocess with input and output. Can someone provide a complete implementation of the "port->run->port" function and any other...
glaive
You are tasked with writing a program that takes in a user's name as input and prints a personalized greeting message. The program should take the user's name as input and then output a message that says "Hello, [name]!" where [name] is the input provided by the user.
glaive
You are tasked with creating a program that will calculate the probability of a quantum state in a specified range. The program should take into account the amplitude and the number of qubits to provide an accurate result. Additionally, the program should be able to plot the probability in a 3D and 2D graph for visuali...
glaive
I encountered an issue while working on my Rails 4 app (using Ruby 2.0.0-p0) that involves authenticity token problems. Specifically, when I was writing a controller that responds to JSON using the `respond_to` class method, I faced `ActionController::InvalidAuthenticityToken` exceptions when attempting to create a rec...
glaive
I am working on a project and need to write a script to recursively remove specific files in a directory using CMake. I want to remove all files with the extension ".c.o", ".pdb", and ".a" in a specific directory. How can I achieve this using CMake?
glaive
I am working on a game development project and I need to implement a feature that applies a specific effect to clear all small monsters from the game board. The effect should be triggered when a certain condition is met and should last for a specific duration. I need to create a function or method that will handle the ...
glaive
You are tasked with implementing a statistical model in Stan for analyzing educational data. The data consists of the number of students in different tracts, grades, years, and cohorts. The model aims to estimate the effect of different factors on the number of students in each tract. You need to write the Stan code to...
glaive
You are tasked with creating a WordPress theme boilerplate from scratch. The theme should be a stripped-down version suitable for further development. Your task is to create a basic theme structure, including necessary files, folders, and functions. Additionally, you need to ensure that the theme is ready for customiza...
glaive
You are tasked with creating a CMake script to remove specific files and directories from the project build. Your task is to write a CMake file that removes the following files and directories: - "CMakeFiles/eosio.token.wasm.dir/src/eosio.token.cpp.o" - "eosio.token.wasm.pdb" - "eosio.token.wasm"
glaive
You are tasked with writing a program to determine if the value of variable x is equal to the value of variable y. You must use Lisp as the programming language.
glaive
You are tasked with creating a messaging system where a message can either contain a string or another sub-message. The message can only have one of these two types at a time. You need to define a protocol buffer message structure to represent this messaging system.
glaive
I am trying to create a module that will build a library using OCaml, but I am encountering some issues. I need to define the rules and setup the file dependencies for the library. However, I am not sure how to properly set up the file dependencies and build the library rules. Can someone provide a comprehensive soluti...
glaive
You are tasked with creating a SAS program that can run multiple SAS programs asynchronously and multi-threaded, while honoring any job dependencies. The program should be portable to both Windows and Unix, and should be able to handle any dependencies specified in the list of programs. It should also be able to limit ...
glaive
You are tasked with implementing a program that needs to encrypt and decrypt sensitive data using the AES-128-CBC encryption method. The program should be able to handle both encryption and decryption, and the key for encryption and decryption should be encoded using base64 with a line length of 64 and 128 bytes. The p...
glaive
You are tasked with creating a program that generates a hierarchical structure of joints for a 3D character model. The program must be able to create nodes for each joint, set their respective positions, and assign unique identifiers to each joint. The program should be able to create the root joint, as well as joints ...
glaive
You are tasked with creating a formal power series library in Common Lisp. A formal power series is a series of the form f(x) = a0 + a1*x + a2*x^2 + a3*x^3 + ..., where ai are coefficients and x is the variable. Your library should provide functions for adding, subtracting, and multiplying formal power series, as well ...
glaive
I need to implement a program that takes input parameters K, N_1, N_2, d_vec_1, and d_rvec_1. The program should then perform a transformation on the input data and calculate the covariance using the cov_exp_quad function. Finally, the program should utilize the transformed parameters to model a normal distribution and...
glaive
You are working on a project that requires interacting with the Windows kernel32 library in your Rust programming language. You need to implement the functionality to create a new directory using the CreateDirectoryW function provided by the kernel32 library. The function signature is as follows: ```rust pub extern "k...
glaive
I want to create a program in which I have two custom data types, t1 and t2, and I want to define a new data type T which is a pair of t1 and t2. Also, I want to ensure that there are instances of t1 and t2 that are inhabited (i.e., they have a value). Can someone help me write the code to achieve this using the tactic...
glaive
You are tasked with creating a program for a cake shop that includes a login form. The program should allow employees to log in using their username and password, and upon successful login, they should be directed to the main dashboard. If the login credentials are incorrect, an error message should be displayed. You a...
glaive
You are tasked with creating a program that uses a list of symbols and handles the creation of a symbols_list file for the darwin linker on Apple systems, and a version script for GNU ld on non-Apple systems. The program should also set the target properties with the appropriate link flags.
glaive
You are tasked with creating a program that simulates a task scheduler for a worker system. The program needs to submit tasks to workers, start the workers, and then monitor the status of the tasks as they run. Your task is to create a function or method that takes in a set of tasks and worker configurations, submits ...
glaive
You are tasked with writing a CMake script to remove specific files and directories from a specified location. Your script should be able to remove files and directories regardless of whether they exist or not. Additionally, the script should be able to handle multiple file and directory removals in a single command.
glaive
I need to create a Makefile to compile and build a program with multiple source files. The program consists of three source files: memvirt.c, aluno.c, and test.c. The memvirt.c file contains functions related to memory virtualization, aluno.c contains functions related to student information, and test.c contains functi...
glaive
You are tasked with implementing a function that translates the characters in a given string using a provided translation table. The function must replace the characters in the original string based on the mappings in the table. You are to write the function in a language that supports low-level memory manipulation and...
glaive
You are tasked with automating the compilation process for an Android project. Your goal is to create a script that sets up the necessary environment variables and compiles the project for multiple API levels. The script should check for the existence of environment variables such as %ANT_HOME%, %ANDROID_HOME%, %JAVA_H...
glaive
You are tasked with creating a Portfolio class in a Node.js environment. The class should have a constructor that takes an 'app' parameter and initializes a 'detail' element using the app. It should also add thumbnails to the DOM and initialize them when the app is ready. Additionally, the class should have methods to ...
glaive
I need to write a SPARQL query to retrieve the names of all people and their publications. Each person is of type foaf:Person and has a name specified with the foaf:name property. Some people may have publications associated with them through the ns4:hasAuthor property. I want to include these publications in the query...
glaive
You are tasked with creating a FileByteChunkProvider class in a Java project using the SMBJ library. This class should be able to write chunks of bytes from a file to an output stream. The class should have the following functionality: - Write a chunk of bytes from a file to an output stream. - Keep track of the offset...
glaive
You are tasked with creating a PowerShell script that can retrieve the latest version and download link for a specific software release from a given website. The script should be able to parse the HTML content of the website, extract the necessary information, and then use it to update a related PowerShell script file....
glaive
You have been tasked with creating a C++ program that uses the Qt framework to support Qt WebKit. The program should include the necessary libraries, include directories, and runtime library directories for the Qt WebKit support. Additionally, the program should be able to find the Qt5 package and its components, speci...
glaive
I am trying to create a directory and copy some files from one location to another using Windows command line. Can someone provide me with the correct commands to achieve this?
glaive
I am currently using Python 2.6 on my Linux rhel-5 system and have installed pip along with the required CFFI packages. However, when I attempt to run a sample CFFI program with the code `ffi = FFI()`, it results in an error. The error message I receive is: ``` File "/usr/lib/python2.6/site-packages/cffi/api.py", lin...
glaive
You are tasked with creating a program that retrieves the attributes of a topic from an AWS Simple Notification Service (SNS) using the Paws library. The program should be able to fetch and display the attributes of a specific topic, including the delivery policy, display name, owner, policy, number of confirmed and de...
glaive
You are tasked with implementing a Verilog module that instantiates a CORDIC IP core provided by Xilinx. The CORDIC IP core performs coordinate rotation digital computer (CORDIC) algorithm for calculating hyperbolic and trigonometric functions. Your task is to create a Verilog module that instantiates the CORDIC IP cor...
glaive
You are tasked with creating a PowerShell script that utilizes the Join-Path, Test-Path, Get-ChildItem, and Select-Object commands to locate and load specific scripts and files. The script should first attempt to load a script named 'loadEnv.ps1' from the current directory, and if it does not exist, it should attempt t...
glaive
You are tasked with implementing a utility function to extract specific external claim sources and claim names from a JSON object. The function should be able to: - Extract the `_claim_sources` JSON objects from the specified claims set JSON object and return them, keyed by source ID. - Return the external claim names ...
glaive
You are tasked with creating a new function in the scatter_client module called `get_version` that will make a GET request to the scatter server to retrieve its API version. Your function should adhere to the following specifications: - The function should be named `get_version` and should take no arguments. - It shou...
glaive
I am trying to create a web preview form in my application using the TWebPreviewForm class. I want to include a TWebBrowser object within the form to display web content. Additionally, I need to add a TBXDock and a TBXToolbar to provide navigation and control functionalities to the web browser. However, I am not sure h...
glaive
I need to create a function in F# that takes two types as input and checks if the first type is a generic type definition and if the second type is a generic type that matches the definition of the first type. If they match, the function should return the generic arguments of the second type; otherwise, it should retur...
glaive
I am trying to create a deep link to a website using JavaScript. Can someone provide me with a function that can accomplish this task?
glaive
I am trying to create a function in Clojure that takes in a file name as input and reads the contents of the file. However, I want to remove any Lua comments from the file before returning the content. Lua comments can be either single-line comments starting with "--" or multi-line comments enclosed within "--[[...]]"....
glaive
Can the AI provide a SQL query to fetch the latest product reviews?
glaive
You are tasked with creating a function that closes over a local constant and returns a struct with a method that accesses this constant. The function should return the value of the local constant when the method is called. Write a function called `fnThatClosesOverLocalConst` that creates a local constant `c` with a v...
glaive
I am trying to build a class in Dart using the built_value package, and I need to define a class with properties that are maps. The maps have specific types for keys and values, and I also need to include an enum as the value type for one of the maps. Can someone provide a complete implementation of the MapTest class w...
glaive
Is there a way to convert an array of integers into an array of strings using a Python function?
glaive
I am trying to create a function in Lua that will allow me to pull an image from a Docker registry and return the image ID. The function should also handle any errors that may occur during the process and display the status of the image pull operation. Can someone help me create a Lua function that accomplishes this? ...
glaive