instruction_seed stringlengths 29 40.5k | source stringclasses 6
values |
|---|---|
You are tasked with creating a function that takes in a name, base CSS function, and mappings, and returns a Builder function. The Builder function takes in palettes, version, author, license, and repository, and generates CSS files based on the input data. The generated CSS files should include theme-specific styles a... | glaive |
You are tasked with creating a server in OCaml that listens for incoming messages and handles them appropriately. The server should be able to receive messages of type Toto or Tata, and then send a response with the same type but with the value incremented by 1. You need to implement the functions handle_msg and handle... | glaive |
You are tasked with creating a CMake module to find the SoundIO library and include directory. The module should be able to locate the soundio.h header file and the soundio library. You need to write a CMake script that can find these files and handle them properly. | glaive |
You are tasked with creating a function that can perform various selections from a sequence, such as arrays and lists, based on specific criteria. Your function should be able to handle singleton selections, selecting a range of values, and different representations including vector and list sources with vector and lis... | glaive |
You are tasked with creating a PHP class that represents a specific element used by the Gdata Exif extensions. The class should be named `Zend_Gdata_Exif_Extension_ImageUniqueId` and should have the following characteristics:
- It should extend the `Zend_Gdata_Extension` class.
- It should have a protected property `_r... | glaive |
You are tasked with writing a Tcl script to perform hardware testing on an AXI interface. The script should create write and read transactions at a specific address, initiate the transactions, compare the read data with the expected data, and check for any errors. If the data comparison test passes for the S_AXI interf... | glaive |
I need to create a Clojure function that takes a full DCSS version string as input and extracts the major version from it. The major version is defined as the first two numbers separated by a period (e.g., 0.12 from 0.12.1-omgwtf). Additionally, I need another function to check if the given DCSS version is a trunk vers... | glaive |
:
You are tasked with creating a web page that allows users to modify a designation from a dropdown list and enter a new designation in a text field. Upon submission, the selected designation should be updated to the new one in the database. If the user does not select a designation or does not enter a new one, an aler... | glaive |
You are tasked with creating a PHP script to generate an HTML document for a sales invoice. The script should pull data from a `$document` object and include information about the company, customer, items sold, payments, and total amounts. The script should also handle cases where the customer's address is not availabl... | glaive |
You are tasked with creating a function in CMake that will generate a version string at compile time. This function should take in a source file, a destination file, a list of version sources, and a git directory as inputs. The function should also allow for additional CMake defines to be added as an optional argument.... | glaive |
You are tasked with creating a program using the Lazarus Component Library (LCL) and Free Pascal (FPC) to display an image and play a video. The program should have a form with an image component (Image1) and a media player component (MPlayerControl1), which is used to play the video. Additionally, the program should a... | glaive |
You are tasked with creating a QueueEntity class in C# that implements the Queue and QueueHandle interfaces. The class should have the following properties:
- QueueName: a string representing the name of the queue
- Durable: a boolean indicating if the queue is durable
- AutoDelete: a boolean indicating if the queue sh... | glaive |
You are tasked with creating a basic microservice using Clojure. The microservice should have the following specifications:
1. It should use the Apache License 2.0.
2. It should have a git repository hosted at "https://github.com/otto-de/tesla-microservice".
3. It should have the following dependencies:
- org.clojur... | glaive |
I am trying to create a new module for my flow-based programming application. I need to add a new type of module called "app" and I want to include a file called "app.json" and another file called "app.o" in this module. Additionally, I need to specify the type of this module as "flow". Can someone help me write the co... | glaive |
You are tasked with creating a CMake script to find and include the GMP (GNU Multiple Precision Arithmetic Library) in a C++ project. The GMP library provides support for arbitrary precision arithmetic, and the task is to write a CMake script that searches for the GMP libraries and includes them in the project.
You ne... | glaive |
I am working on a web application that requires different types of loaders and error components to handle the loading and error states. I need to create a module that exports three different components: Spinner, BarLoader, and Error. The Spinner component should display a spinning animation to indicate loading, the Bar... | glaive |
You are tasked with implementing a QoS (Quality of Service) profile in a proto2 protocol. The QoS profile should have the following properties:
- History Policy: This can be one of the following options: HISTORY_SYSTEM_DEFAULT, HISTORY_KEEP_LAST, HISTORY_KEEP_ALL.
- Depth: This is an optional field that specifies the c... | glaive |
You are tasked with implementing a pattern matching macro in Scheme. The macro should take a pattern and a list of conditions and corresponding actions. The pattern should be matched against the input using the conditions, and if a match is found, the corresponding action should be executed. If no match is found, a def... | glaive |
I am working on a project using the Qt4 framework and I need to create a C++ program that includes UI files, header files, and source files. I also need to link the program with the Qt libraries and create a static library. Can someone provide a comprehensive solution for this? | glaive |
You are tasked with creating a Verilog module that acts as a router for a system interconnect. The module needs to handle incoming command data and control the routing of the data based on certain conditions. The module should have the following input and output ports:
Inputs:
- clk: clock signal
- reset: reset signal... | glaive |
You are tasked with creating a CMake rule to clean specific files and directories in a project. The clean rule should remove all the files and subdirectories within a specified directory. You must ensure that the clean rule is implemented for all supported languages in the project. | glaive |
You are tasked with writing a program that can perform vector algebra operations. Specifically, you need to implement a function that can calculate the magnitude and length of vectors, as well as perform vector addition, subtraction, and multiplication. Your program should also be able to find the component form and ma... | glaive |
You are tasked with creating a module that implements a comparable interface for different types such as floats, strings, time spans, time of day, dates, times, and various integer types. The module should provide functions for comparing and ordering the values of these types, as well as testing the lexicographic order... | glaive |
You are tasked with implementing a CUDA kernel that performs histogram calculations for a given dataset. The goal is to create a parallelized implementation that can efficiently process large amounts of data. The CUDA kernel is expected to utilize the provided template and helper functions to manage memory and coordina... | glaive |
You are tasked with creating a program that will manipulate and render a sprite image. The sprite is defined with the following properties:
- "bboxMode": 0,
- "collisionKind": 1,
- "type": 0,
- "origin": 4,
- "preMultiplyAlpha": false,
- "edgeFiltering": false,
- "collisionTolerance": 0,
- "swfPrecision": 2.525,
- "bbo... | glaive |
You are tasked with creating a new Perl package that will handle the response for a Google Ads service. The package should be named Google::Ads::GoogleAds::V5::Services::GoogleAdsService::MutateOperationResponse and should include a constructor method that initializes the package with the following attributes: adGroupA... | glaive |
On Windows 7, I am using the command line `python -m SimpleHTTPServer 8888` to initiate a simple web server to serve files from a directory for development purposes. However, I am encountering a problem where the server seems to cache the files. As a result, old versions of files are served despite newer ones being ava... | glaive |
I am having trouble parsing JSON files that contain a TAB character. I have tried parsing it with `json` and `simplejson` but to no avail. When I validate my JSON using http://jsonlint.com/, I get a parsing error. This is the JSON text that's causing the problem:
```json
{
"My_String": "Foo bar. Bar foo."
}
```
... | glaive |
You are tasked with writing a function to flip and invert a given image represented as a 2D array of 0s and 1s. The flipping operation involves reversing each row of the image, while the inverting operation involves changing 0s to 1s and 1s to 0s. You need to implement a function with the following signature:
```rust
... | glaive |
You are working with a dataset of world protests and need to analyze the events related to women's and girls' rights, as well as feminist themes. Specifically, you are tasked with identifying the other themes that emerge from events related to women's and girls' rights. Additionally, you need to analyze group associati... | glaive |
You are tasked with creating a simple web application that allows users to log out. You need to write the code for the logout page using Java and JSP (JavaServer Pages). The page should display a heading "どこつぶログアウト" (which means "Dokotsubu Logout" in Japanese), a message "ログアウトしました" (which means "Logged out" in Japanes... | glaive |
You are tasked with creating a parallel processing solution in R to calculate the stephanie_type2 function for a set of given parameters. The function takes in a seed, a k value, an n value, an m value, a type, a grid, L, error, i_face, approx, and truncate.tn as parameters. The goal is to use the mclapply function fro... | glaive |
:
You are tasked with creating a web application that handles user login and logout functionality using Java servlets and JSP. The application should allow users to log in with their username and password, and upon successful login, display a personalized welcome message with the user's name. Additionally, users should... | glaive |
You are tasked with setting up an external project and consuming it within a CMake project. The external project, named "fizz_project", is hosted on GitHub at the following URL: https://github.com/facebookincubator/fizz. Your goal is to configure the CMake arguments and set up the necessary properties to successfully c... | glaive |
I have been assigned the task of creating an interactive 2D map application for multiple interlinked buildings with multiple floors for Android and iOS devices. The application should have features like a Google Street View interface and possibly 3D modeled viewing options. I have two years to complete this task and I'... | glaive |
You are required to create a Python class that represents a data split and can be used to describe the existing partitioning of incoming data to the `ingest` call. The class should have two derived classes: CustomSplit and TiledSplit. The CustomSplit class should describe an arbitrary partitioning of incoming data, whi... | glaive |
You are tasked with implementing a smart contract for a token on the Ethereum blockchain. The contract should adhere to the ERC 20 Token standard (https://github.com/ethereum/EIPs/issues/20) and include ownership, a lock, issuing, and incentive distribution functionalities.
Your task is to create a smart contract call... | glaive |
Can you provide a code that sorts a given list of integers in ascending order? | glaive |
Can you provide a JavaScript function that checks if a given number is a factor of another number? | glaive |
You are tasked with developing a C++ program that manages a library system. The program should include the following features:
- Ability to add, delete, and update books in the library
- Ability to search for books by title, author, or category
- Ability to display a list of all books in the library
- Ability to check ... | glaive |
You are tasked with creating a Makefile for generating documentation using Sphinx. Your Makefile should include targets for generating different types of documentation, such as HTML, single HTML, pickle, JSON, HTML help, Qt help, Devhelp, EPUB, LaTeX, PDF, text, man pages, Texinfo, gettext, and others. Each target shou... | glaive |
Can you provide a Python code snippet that generates random passwords containing letters, numbers, and special characters, with a minimum length of 8 characters? | glaive |
Which is a better approach for a compiler - compiling code to assembly language or outputting binary machine code directly? I am aware of some advantages of assembly language, such as avoiding the need to learn the object file format and ease of debugging the backend. On the other hand, binary code offers faster compil... | glaive |
I am working on a code for adding n hexadecimal numbers. This is the part of the code I am not understanding:
```assembly
packnum:
xor bl,bl
mov ecx,02 ; For two-digit numbers
mov esi,numascii
up1:
rol bl,04 ; Multiply by 10
mov al,[esi]
cmp al,39h
jbe skip
sub al,07h
skip:
sub al,30h
add bl,al
inc e... | glaive |
You are tasked with implementing a program that involves symbolic computation using the `SymbolicUtils` package in Julia. Your goal is to create a high-quality programming problem related to symbolic computation.
The problem is to create a function that takes a mathematical expression as input and performs a series of... | glaive |
You are tasked with creating a custom adapter for a list view in an Android application. The adapter should display a list of chapters for a specific course, along with the number of videos in each chapter. The adapter should also provide the functionality to download videos for each chapter.
Your task is to create a ... | glaive |
I am working on a project that involves creating a macro to add a universal ID to a table. The macro should take two parameters: ref_tracks_table and tracks_table_schema. The macro needs to create a universal_user_id by merging user_id and anonymous_id from the identifies table in the tracks_table_schema. It should the... | glaive |
You are tasked with creating a program that tests for running processes in a Julia environment and provides insights into their execution times. Your program should include tests that start new processes and tests that do not start new processes. You are also required to test PlutoRunner functions such as "from_this_no... | glaive |
How can I determine if a given point is between two other points on a line segment? I have a two-dimensional plane with two points, a and b, each represented by an x-integer and a y-integer. I would like to determine if another point c exists on the line segment defined by a and b. I primarily use Python, but examples ... | glaive |
You are tasked with creating a class in TypeScript to handle the process of putting a new document into a RavenDB database. The class should be named PutDocumentCommand and should have the following functionality:
1. Accept three parameters in its constructor: id (string), changeVector (string), and document (object).... | glaive |
How do I determine which of my two Keras models performs better? I'm confused about whether to use the "acc" (from the training data) or the "val acc" (from the validation data) to make this comparison. Given that there are different accuracies for each epoch, how do I find the overall accuracy for my model? Should I a... | glaive |
You are tasked with creating a new class that represents a table in a database and implementing the properties and methods for it. The class should have properties representing columns in the table, such as CustomerID, CompanyName, ContactName, ContactTitle, Address, City, Region, PostalCode, Country, Phone, and Fax. Y... | glaive |
You are working on a registration system and need to implement a method to handle registering users in progress. You are tasked with creating a function that will either create a new entry or update an existing entry in the database for a user currently registering. The function should take an object representing the i... | glaive |
You are tasked with creating a CloudflareAPI function to create a new zone in the Cloudflare account. The function should take the domain name as input and return the ID of the newly created zone.
The CloudflareAPI struct has the following fields:
- ApiToken string
- ApiKey string
- ApiUser string
- AccountID string
-... | glaive |
You have been tasked with creating a program that automates the setup of a project on Read the Docs. The program should be able to access Read the Docs, create an account if one does not already exist, connect to a GitHub account, import a project, and set up automatic building of the document whenever a commit is made... | glaive |
You are tasked with creating a program that simulates a company's Control Center for managing company members, apps, security, and cloud resources. The program should have the following features:
- Dashboard: Display an overview of various company activities on the Mendix Platform, such as apps created, Mendix versions... | glaive |
You are tasked with creating a GMScript function in version 1.0 that will move a marker to the left when a specific key is pressed. The function should not be compatible with any other versions and should not be implemented using Drag and Drop (DnD). Write a complete GMScript function to fulfill these requirements. | glaive |
I am trying to create a VHDL architecture for a simulation called "transLogUlog". Within this architecture, I need to convert a standard logic signal "in1" to a standard logic vector signal "out1" after a certain delay. I am having trouble implementing this conversion and would appreciate some guidance on how to proper... | glaive |
You are tasked with implementing a custom error handling mechanism in Rust. You need to create a `CoreError` struct that contains a `text` field of type `String`. The struct should have a method `what` that returns a reference to the `text` field. Additionally, the `CoreError` struct should have a method `throw` that t... | glaive |
You are tasked with creating a compatibility layer for a messaging protocol in Rust. The goal is to provide a way to use the new protocol while still being able to support the old protocol, ensuring compatibility with existing code and systems. Your task is to define a new message type, CompatMessage, and a new protoco... | glaive |
You are tasked with creating a PowerShell module manifest for a new module called 'PSGet_AzureRM.KeyVault'. The module should include specific details such as the module version, author, company name, minimum required versions for PowerShell and .NET Framework, required modules and assemblies, nested modules, functions... | glaive |
You are tasked with creating a web form for editing data dictionary information using Java Server Pages (JSP). The form should allow the user to input and update various data dictionary fields such as type, key, value, sort order, and additional descriptive fields. Additionally, the form should include radio buttons fo... | glaive |
You are tasked with creating a program for a game with the following requirements:
1. The program should check the game difficulty and state to determine the color and position of tears and shirts.
2. Based on the game difficulty and state, the program should move the character in the game in a specific way to avoid o... | glaive |
I need to create a program called "mylabels" in Stata that takes in a variable called "values" and additional optional input parameters. The program should clean and format the values based on the input parameters and then output the cleaned and formatted values as labels. Additionally, if the "format" parameter is pro... | glaive |
You are tasked with writing a shell script that will start a Bamboo server with the correct user permissions. The script should check if the current user is root, and if so, change the directory ownership to a specified user and group, and then downgrade permissions to that user. If the permissions for the specified di... | glaive |
I need to create a program that takes a number as input and returns its exponential power as a double. Can anyone help me with this? | glaive |
You are tasked with writing a batch script that will search for all the .jpg files in a directory and its subdirectories, and then write the full path of each .jpg file into a text file called path.txt. The batch script should be able to handle spaces in file names and should not overwrite the content of the path.txt f... | glaive |
You are tasked with creating a resource management system using Python's Twisted framework. The resource management system should include a manager for resource providers and a base implementation for resource providers. The manager should be able to register and retrieve resource providers based on resource paths, and... | glaive |
You are tasked with creating a form in Delphi using the given code snippet as a reference. The form should have the following components and properties:
- A memo component (memOrder) with a cream background, read-only, and vertical scroll bars
- Two buttons (cmdAccept and cmdQuit) with specified captions and click eve... | glaive |
I need to implement an object-oriented design pattern to track and sort words in a text string using C++. Can someone suggest a suitable design pattern for this problem? | glaive |
I am trying to find the executable for a specific tool called "ragel" in my system, and I want to set up custom build rules using macros. How can I achieve this using CMake? | glaive |
You are tasked with creating a smart contract in Solidity that allows the owner to set key-value pairs in a dynamic array. However, there is a vulnerability in the `set` function that allows anyone to overwrite the owner's address, potentially gaining unauthorized access to the contract's funds.
Your task is to implem... | glaive |
I'm following the instructions on the website (http://mikeos.sourceforge.net/write-your-own-os.html) to build a simple OS kernel. However, I want to create a grub-based ISO image instead of booting from a floppy. I added some code to the source for the multiboot header, but when I try to boot the multiboot CD in the em... | glaive |
I am trying to create a view for a Council Tax Business Enquiry form using Scala and Play framework. The view should include a form with options for different property types such as "all property", "large property", and "small property". Additionally, the view should have a backlink that redirects to the Council Tax Su... | glaive |
You are tasked with creating a CMake script to remove specific files and directories from a project. Your task is to write a CMake function or macro that takes in a list of file and directory paths and removes them from the project using the file(REMOVE_RECURSE) command. The function or macro should be able to handle m... | glaive |
You are tasked with creating a Dockerfile to install specific versions of Python, pip, and setuptools on an Alpine Linux system. The Dockerfile should also set up the necessary symlinks for the installed binaries and ensure that the system-provided certificate database is pointed to by Python. Additionally, the Dockerf... | glaive |
How can I generate a unique ID for each element in an array using AI?
Code:
import uuid
def generate_unique_ids(array):
ids = []
for item in array:
ids.append(uuid.uuid4())
return ids
array = ['apple', 'banana', 'orange']
unique_ids = generate_unique_ids(array)
print(unique_ids) | glaive |
In my .NET program, I can create a generic type using the System::Type::MakeGenericType(...) method. However, I am hosting my own CLR instance in native C++ and not using C++/CLI. I want to know if there is a way to create a generic type for a .NET type with _TypePtr in native C++. I have looked for a method like MakeG... | glaive |
You are tasked with implementing a simulated annealing script for a molecular dynamics simulation. The goal is to gradually increase the temperature from 0K to 400K over 100 ps, maintain the temperature at 400K for 100 ps, decrease the temperature from 400K to 310K over 0.2 ns, and finally maintain the temperature at 3... | glaive |
You are tasked with creating an install script for a directory. The install prefix and configuration name are to be set, and the component getting installed needs to be defined. Additionally, shared libraries should be installed without execute permission, and it needs to be determined whether the installation is the r... | glaive |
You are tasked with creating a Lua module for a mobile game development project. The module should provide various native functionalities for the Android platform, such as retrieving the assets path, obtaining the package name, vibrating the device, opening a URL, getting the device's DPI, retrieving the SDCard path, d... | glaive |
You are tasked with implementing a program that models the growth of a population based on different mathematical models. The program should be able to handle multiple models and predict the population size based on the specified model. The models include archibold, hillslope, hillslope_log, expo, koblog, logistic3, mo... | glaive |
You are tasked with implementing a module in Elchemy, a functional programming language that compiles to Elm. The module is for managing contexts and contains various functions and type definitions. Your task is to create the `Elchemy.Context` module with the following functionalities:
- Add an alias definition to the ... | glaive |
I am trying to implement a ShiftLayer in a project using Caffe framework. The ShiftLayer is supposed to shift the input data by a specified amount. However, when I try to run the code, I get a "NOT_IMPLEMENTED" error in the Forward_gpu and Backward_gpu functions. Can someone provide guidance on how to properly implemen... | glaive |
Is there an algorithm to detect a cycle in a linked list? | glaive |
You are tasked with creating a Verilog test bench for a given design. The test bench needs to compile Verilog and System Verilog sources, simulate logging to a log file, allow read access to signals, use a specific library, and run until no more events to simulate.
Create a Verilog test bench that includes the followi... | glaive |
How can I write an SQL query to count the total number of blog posts? | glaive |
You are tasked with creating a Python program to manage software repositories, releases, and branches. The program should be able to clone a repository from a given URL, build and store distribution files, and manage different versions of the software. The program should also be able to read a configuration file (in YA... | glaive |
You are tasked with implementing a parallel execution model for a group of work items in a kernel to improve performance. The goal is to discuss how to group work items into work groups, synchronize them, and support communication among them. Specifically, you need to address how to use barriers for synchronization, ho... | glaive |
You are tasked with implementing a function to floor a 2D vector in a shader program using GLSL. The function should take a 2D vector as input and return the floored values as output. The input vector should be checked for its components, and if the component is greater than or equal to 0, it should be floored to the n... | glaive |
You are tasked with implementing the `sha512_mb_mgr_submit_avx512` function in assembly language, based on the provided code snippet and guidelines. The function takes two arguments: `state` and `job`, and is expected to perform specific operations on them. There are specific register definitions provided based on the ... | glaive |
You are tasked with implementing a function that takes in a key-value pair and uses a write batch to perform the following operations on a RocksDB database:
1. Put the key-value pair into the database
2. Delete the key from the database
3. Get the value associated with a specific key from the database
Your function sh... | glaive |
I am a mathematician and an editor for a well-known magazine. I often need to create high-quality, press-ready figures related to 2D and occasionally 3D Euclidean geometry for puzzles and problem solutions. I am looking for a Python library that allows me to create these figures with ease, preferably one that handles n... | glaive |
You are working on a web application that needs to store sensitive information securely. One of the requirements is to use Azure Key Vault to store and manage these secrets. Your task is to create a Key Vault instance from the Azure portal and configure the web application to use it.
Guidelines:
- Create a Key Vault i... | glaive |
You are tasked with creating a shader program in GLSL (OpenGL Shader Language) that applies a specific texture to a 3D model. The texture should include a texture LOD (Level of Detail) to enhance the rendering quality. Your shader program should be able to handle the texture mapping and LOD calculations efficiently.
W... | glaive |
I have this code snippet in Visual Studios:
```assembly
.data
val1 DWORD -1
```
When I build the project, it successfully compiles without any errors. However, I noticed that `DWORD` is an unsigned data type. Shouldn't inputting a negative value like `-1` result in an error? | glaive |
I'm building an inventory management system in Rails and I want to allow users to register products. I have a User model with a has_many association to the Product model. However, I'm encountering an issue where products can be created without being associated with a user. How can I allow products to be created without... | glaive |
You are tasked with implementing a settings screen in a Flutter app. The settings screen should include switches for the following options:
- "Sem Glúten" (Gluten-free): Toggles the display of meals without gluten.
- "Sem Lactose" (Lactose-free): Toggles the display of meals without lactose.
- "Veganas" (Vegan): Toggle... | glaive |
You are tasked with creating a password recovery feature for a user management system using PHP and Symfony framework. You need to implement two controller actions and the necessary form handling logic. The first action should handle the process of initiating a password recovery request, while the second action should ... | glaive |
How can I create a CSS layout for a homepage that includes a navigation bar, header, footer, main content area, and sidebar? | glaive |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.