instruction_seed stringlengths 29 40.5k | source stringclasses 6
values |
|---|---|
I am trying to create a profile section for a website using HTML and CSS. The profile section should have a background gradient, a profile image with information displayed on top of it, and interactive icons. However, I am facing some issues with the layout and styling. Can someone help me create the HTML and CSS code ... | glaive |
You are tasked with creating a Lua program that simulates a card game. The game involves creating a card with three effects: it cannot be destroyed, it has the ability to convert damage, and it can change the attack mode of the player. You need to implement the functions to achieve these effects.
Create a Lua program ... | glaive |
You are tasked with creating a minor mode in Emacs called "hexcolor-mode" that will display hexadecimal color literals with the specified color as the background. The mode should add font-lock keywords to highlight the color literals in the buffer, and allow users to test colors interactively by specifying foreground a... | glaive |
You are tasked with creating an XSLT stylesheet to transform an XML document into a new XML format. The input XML contains product information, and the output XML should group products based on a specific substring of the SKU ID and include various product details such as name, category, price, installment information,... | glaive |
Is there a way to write a JavaScript program that can determine the sorting order of a given array? | glaive |
You are tasked with creating an Atom plugin that processes and formats specific file types on save. The plugin should have the ability to toggle the processing on and off, and it should support the following file types: markdown and Matlab.
Your task is to write the code for the plugin's activation, deactivation, and ... | glaive |
You are tasked with creating a Tcl procedure that will generate an icon window with a specified pixmap and icon name. The procedure should take in two parameters: the pathname of the icon window and the name of the pixmap. The icon window should be created with the pixmap, and the icon name should be set accordingly. A... | glaive |
You are tasked with implementing a padding operation for a deep learning framework using CUDA. The operation involves padding a given input array with a constant value to produce an output array of specified dimensions. The padding is done along the N, C, H, and W dimensions of the input array.
Your task is to impleme... | glaive |
You are tasked with creating a module in Elixir using the Ecto framework to handle user management for a messaging application. The module should include the following functionalities:
1. Search for users based on a search term and the current user. The search should return a maximum of 25 users whose names contain th... | glaive |
You are tasked with creating a function that writes a menu to the console, given an array of menu items, a menu position, current selection, item focus color, and a menu item formatter. The function should display the menu items with the focused item in the specified color and handle multi-select functionality if enabl... | glaive |
I am trying to implement a macro-based pattern matching system in Common Lisp, but I am facing challenges with writing the code to match a specific key structure. I need to generate code to match a single key and its associated structure, which may include optional keys, choices between keys, and ordered keys. The stru... | glaive |
I want to create a Java application that generates random numbers between 1 and 100 using the Math.random() method. Can someone provide an example of how to accomplish this? | glaive |
I am trying to implement implicit kinematic constraints for a 2D picker robot using Maple. However, I am facing difficulties in writing the code for calculating the kinematic constraints in implicit form. Can someone help me with the code to calculate the kinematic constraints in implicit form for a 2D picker robot usi... | glaive |
I need to implement a singleton Python class. How can I achieve this? | glaive |
You are tasked with implementing a flight plan reader and writer for the Garmin FPL format. The FPL format does not support departure/arrival procedures and only uses data for waypoints and route identifiers. Your task is to create a flight plan reader that can parse an XML file in the Garmin FPL format and initialize ... | glaive |
What is the SQL query that can be used to retrieve data from a table and order it by the price in descending order? | glaive |
You are tasked with creating a version control system for a software application. Your task is to define a header file `version.h` that contains version information for the application. The version information should include the Git version and the build number. Your goal is to create a header file that can be auto-gen... | glaive |
How can I create a responsive UI for a shopping cart website using HTML, CSS, and JavaScript? I also need to ensure that the UI has accessibility support and smooth transition animations. Can you provide a detailed solution with code examples? | glaive |
You are tasked with creating a wrapper window with specific styles using the RadSpell framework. The window should have a header, body, and footer, each with their own distinct styles. The header should have a left, center, and right section, while the body should have a left, center, and right section as well. The foo... | glaive |
What is the SQL query to search for a specific phone number in a database table and retrieve matching records? | glaive |
You are tasked with creating a simple 2D game using the Elm programming language and the Game.TwoD library. The game will involve simulating the motion of a bouncing ball.
Your task is to implement the following:
- Define a Model type that includes the position and velocity of the ball.
- Implement the init function t... | glaive |
How can I create a PHP script that retrieves a random quote from an online API? | glaive |
How can I remove a key from a RethinkDB document? I've tried two approaches, but neither of them worked. The first one was using the replace function to delete the key and return the row:
```javascript
r.db('db').table('user').replace(function(row){
delete row["key"]; return row})
```
My second approach was to updat... | glaive |
You are tasked with creating a login view for a web application using React and styled-components. The login view should include the following features:
- A login form with fields for username and password
- A registration form with fields for username, email, and password
- A forgot password form with a field for emai... | glaive |
How can I use JavaScript to build a webpage that dynamically displays data over time? | glaive |
You are tasked with creating a new message type in a protobuf file for a Go package called "physical". The message type should be named "SealWrapEntry" and should contain the following fields:
- A field named "ciphertext" of type bytes with a field number of 1
- A field named "iv" of type bytes with a field number of 2... | glaive |
I am working on a web application using PHP and I need to create a ProductRepository class to handle database operations for the Product model. I want to be able to retrieve all products, save a new product, find a product by its ID, and delete a product. Can someone provide a complete implementation for the ProductRep... | glaive |
I need to query a database to retrieve distinct pairs of subject and object where the subject has a specific property called "pages". The property "pages" is represented by the URI http://swrc.ontoware.org/ontology#pages. Can someone help me write a query to achieve this in a database using SPARQL? | glaive |
You are tasked with creating a bash script that will execute a Java program and pass in certain parameters. The Java program is represented by the ZimCLI.jar file, and it requires the following parameters to be passed in:
- v: the version of the program (e.g., PaxProto/35)
- I: the input file (e.g., FiveRooms.v01.zim)
... | glaive |
I am trying to create a responsive web layout using HTML and CSS. I want to have a header, a main section with an aside, and a footer. The main section should have a section and an aside, and the footer should have a paragraph. The layout should also have a navigation bar and some boxes with buttons. Can someone guide ... | glaive |
Can you provide a code solution to generate the first 20 prime numbers using a loop? | glaive |
You are tasked with writing a CMake script to find the cppcheck executable on the system and set it as a required dependency for a project. Your script should search for the cppcheck executable in the specified directories and handle the case where it is not found. Once found, the script should mark the cppcheck execut... | glaive |
You are tasked with setting up a C++ project using CMake and need to specify the compiler and its properties in the CMakeLists.txt file.
Write a CMakeLists.txt file that sets the C++ compiler to "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe" and specifies its version as "19.0.24213.1". Additionall... | glaive |
You are tasked with implementing a program that converts a given number into its binary representation. The program should take an integer input and output its binary equivalent.
For example, if the input is 13, the output should be 1101.
Write a Pascal program that accomplishes this task. | glaive |
You are tasked with developing a program that automates the installation of required packages for different types of nodes in a cloud infrastructure. The program should be able to handle common dependencies for launcher nodes, network nodes, and compute nodes, and also account for the specific needs of different operat... | glaive |
How can I generate an array of size 10 filled with random numbers between 0 to 100 in Python? | glaive |
You are tasked with implementing a function to convert an Ethereum address to its EIP55 checksum format. The EIP55 checksum format is a case-insensitive checksum on top of the hexadecimal representation of the address. It helps prevent users from mistyping addresses and sending funds to incorrect destinations. Your tas... | glaive |
You are tasked with implementing a perfect Gibbs sampler for the Ising model using the given code snippet as a reference. The Ising model is a mathematical model in statistical mechanics used to simulate the behavior of magnetic materials. The perfect Gibbs sampler is a specific algorithm used to generate an exact real... | glaive |
How can I build a Node.js application using Express and MongoDB that allows users to register, login, and create polls? | glaive |
I am trying to initialize a Tezos environment and create a list of identities with public and secret keys. I want to ensure that the Tezos context is set up properly with a gas limit of 350,000 and that each identity has an associated implicit contract. Can someone provide a function that initializes the Tezos environm... | glaive |
I am trying to download and extract a source archive from a specific URL using vcpkg in CMake. However, I am encountering issues with the download and extraction process. Can someone provide a solution to successfully download and extract the source archive using vcpkg in CMake? | glaive |
You are tasked with creating a function to retrieve a list of phone number orders. The function should take in two parameters: MaxResults, which specifies the maximum number of results to return in a single call, and NextToken, which is the token to use to retrieve the next page of results. If MaxResults is not provide... | glaive |
You are tasked with creating a Dockerfile that installs necessary packages and prepares a Multi Theft Auto (MTA) server for deployment. The Dockerfile should include the following steps:
1. Update the package index and install the required packages: make, gcc, g++, zlib1g-dev, liblua5.1-dev, libcurl4-openssl-dev, and l... | glaive |
I have a query that inserts data into a table and then tries to retrieve the ID of the inserted row. Here is the code:
```
cmd.CommandText = @"INSERT INTO [dbo].[bill](bruto, waiterid, reversalid, number, ddate, tableid, total, printed, posplace, guestid, numberofguests, closedtime, methodofpaymentid, realdate) " +
... | glaive |
You are tasked with creating a model editor using the Glamour framework in Pharo Smalltalk. The model editor should be able to present a Geranium DSL playground and save the content with a specific title. Your task is to implement the necessary code to achieve this functionality. | glaive |
You are tasked with creating an R package that implements a resampling method for network metrics/indices. The package should be able to sample interactions without replacement from a network and compute network indices/metrics based on the sampled interactions. The resampling procedure should start with a small sample... | glaive |
I'm using MySQL v5.0.45 and I want to delete a specific row in a table, regardless of its ID number. I have a prototype set up in PHP and I created the following table in my database:
```sql
CREATE TABLE prototype_1 (id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), name varchar(30));
INSERT INTO prototype_1 (name) VA... | glaive |
How can I develop an online shopping website using Django? | glaive |
I need to create a function in JavaScript that listens for a window focus event and then focuses on a specific element within the document. I want to ensure that when the window gains focus, the specified element immediately receives focus without any delay. Can someone provide a solution for this? | glaive |
How can I write a regular expression to find all email addresses with the domain ending in ".com"? | glaive |
You are tasked with creating a plugin for a location-based service using the Qt5 framework. The plugin should be able to import the GeoServiceProviderFactoryEsri module and populate its properties for both release and debug modes. Additionally, you need to append the GeoServiceProviderFactoryEsri plugin to the Qt5Locat... | glaive |
You are tasked with implementing a method to determine whether a given method is more specific than another method with respect to a list of classes of required arguments. The method should also be able to determine whether a class is a subclass of another class, and whether a method is applicable to a sequence of argu... | glaive |
Can you help me generate a natural language description by summarizing given information about a person named Mary? | glaive |
I need to write a script that will encode a file in base64, decode it, and then execute the decoded file using PowerShell. I want the PowerShell window to be hidden and the execution policy to be bypassed. | glaive |
I am developing a small utility in Go that needs to be able to update itself by replacing its own binary. I have found that the best way to do this on Windows is to follow these steps:
1. Download the new version of the binary as "my.exe.new"
2. Execute "my.exe.new" and exit the current process
3. Wait for "my.exe" t... | glaive |
I am trying to create a virtual environment for my Python project, but I am having trouble activating it properly. I want to set up an alias to activate the virtual environment and also define an alias for the pydoc command. Additionally, I want to unset irrelevant variables and modify the prompt to display the name of... | glaive |
Can you please help me modify this code to print "Goodbye World" instead of "Hello World"? | glaive |
I have a simple 64-bit assembly program that is intended to print an 'O' and 'K' followed by a newline. However, the 'K' is never printed. One of the goals of the program is to print the value in the lower bits of the rax register as an ASCII letter. The program is specifically for 64-bit Linux and written for educatio... | glaive |
How can I write a Python code to detect palindrome words within a given sentence? | glaive |
You are tasked with creating an Azure Logic App that automates event-based tasks and workflows using HTTP webhooks. The Logic App should be able to trigger, suspend, and resume tasks, processes, and other automated workflows based on specific events occurring at an HTTP or HTTPS endpoint. Your task is to create a Logic... | glaive |
How can I apply a CSS rule to assign a line height of 1.5 and letter spacing of 2px to all elements within a specific class on a webpage? I want to make sure that this rule does not affect elements outside of the class. Additionally, I need to write a separate rule to handle exceptions for any <p> HTML tags within the ... | glaive |
You are tasked with creating a Matrix class in C++ that can perform various operations on matrices. Implement the following functionalities:
1. A constructor that takes in the number of rows, columns, a flag, and a supply value. It should allocate memory for the matrix and initialize all elements to 0.0.
2. A copy cons... | glaive |
You have been tasked with implementing a custom filter function in a Grails application using the GormUtils class. The function should take in a Criteria object, a FilterOperatorsEnum operator, a property name, and a value, and apply the specified filter to the criteria. The filter should be created using a closure bas... | glaive |
You are tasked with creating an install script for a specific directory in a CMake project. The script should set the install prefix, install configuration name, component getting installed, and check if the installation is the result of a cross-compile. You are to implement the install script for the given directory a... | glaive |
How can I create a basic Node.js application for searching a list of books? | glaive |
How can I create a React Native application for scheduling meetings with user authentication, a list of available dates and times, and the ability to select a date and time for the meeting? | glaive |
You are tasked with creating a function in Python that will take a file name as input and correctly determine the appropriate mode for the file based on its name. The function should add the file name and its corresponding mode to the 'auto-mode-alist' list. The mode for the file should be set to 'python-mode' if the f... | glaive |
You are tasked with creating a web page that displays small boxes with different statistics, such as new games, memory increase rate, user ranking, and unique visitors. Each small box should have an inner section displaying the statistic and a corresponding icon. Additionally, there should be a "More info" link at the ... | glaive |
####
I'm a beginner in SQL and I'm confused about the usage of the `FROM` keyword in a `JOIN` statement. I noticed that I can use dot notation to select the specific `tables.columns` that I want, so why do I need to include the `FROM` keyword? Is it important which table I choose as the `FROM` table? I couldn't find ... | glaive |
You are tasked with implementing a shader function that takes in various input parameters and calculates the final color of a pixel. The function should include calculations for diffuse lighting, ambient lighting, specular lighting, and occlusion, based on the input parameters. Additionally, the function should apply a... | glaive |
You are required to implement a function that can perform image tracking using the pyramidal Lucas-Kanade algorithm on a GPU. The function should take in two images (I and J), a vector of points to track (ptsI), the number of pyramid levels (levels), and the size of the patch (patchSize). The function should use CUDA t... | glaive |
You are tasked with creating a CMake script to remove a specific library file from a directory. Write a CMake script that removes the file "libtest_based.a" from the directory "../../lib/". | glaive |
I need to create a TBuffer object in Delphi with the following features:
- The TBuffer should have a fixed size upon creation, and an option to automatically extend the buffer size if needed.
- It should have a method to write data into the buffer, with support for different data types (e.g., integers, strings, arrays)... | glaive |
Can you provide a code example using R language to sort an array in ascending order? | glaive |
You are tasked with implementing a genetic algorithm in Perl to solve an optimization problem. The genetic algorithm will involve creating a population of potential solutions, evaluating their fitness based on a given objective function, and using selection, crossover, and mutation to evolve the population over a certa... | glaive |
Is it possible to retrieve the current value of the EIP register using assembly language? | glaive |
You are tasked with creating a CMake build system that should remove specific files and directories as part of the clean process. You need to write a custom clean rule for the C++ language to remove the object file, debug file, and executable file generated during the build process. The clean rule should be implemented... | glaive |
You are tasked with creating a custom vector data structure in Rust that has the ability to dynamically resize as elements are added or removed. Your custom vector must have the following functionalities:
- A method to add elements to the end of the vector.
- A method to remove elements from the end of the vector.
- A ... | glaive |
You are tasked with creating a web page to manage the properties of a User Service plugin in a Java web application. The page should include a form with fields to enable or disable the User Service, configure a secret key, and specify a list of allowed IP addresses. Upon submission of the form, the properties should be... | glaive |
How can I create an API using Node.js and Express that displays the most recent posts from several different blog sites? | glaive |
I am trying to create a custom hook in my React application to access the session data from the SessionContext. However, when I use the useContext hook and pass in the SessionContext, I am not getting the expected session data. Can someone help me create a custom hook called useSession that properly retrieves the sessi... | glaive |
You are tasked with creating a PlanType class in R6 that includes methods for initializing, converting to JSON, converting from JSON, converting to JSON string, and converting from JSON string. The class should be able to handle PlanType objects and perform the necessary conversions as specified. | glaive |
What is an example of a Python program that can encrypt a given string using ROT13 string encoding? | glaive |
I am trying to test and validate the initialization, setting, reduction, interpolation, and regridding of fields in a Julia package. I want to ensure that the fields are correctly initialized, can be set with specific values, and that operations like reduction and interpolation produce accurate results. Additionally, I... | glaive |
You are tasked with implementing a parser for keys as part of a Key/Value Pair or a table header in a configuration file format. The keys can be of 3 types:
1. Bare keys (e.g. `version` and `dependencies`)
2. Basic quoted keys (e.g. `"basic string key"` and `"nom"`)
3. Literal quoted keys (e.g. `'literal key'`)
Your t... | glaive |
I have installed pycuda and it was working fine but suddenly it stopped working. When I tried to install it again using 'python configure.py --cuda-root=/usr/local/cuda/bin', I received an error saying 'CUDA_ROOT not set, and nvcc not in path'. The 'nvcc' file is in the above directory. Can you help me to solve this pr... | glaive |
How can I write an algorithm in Java to reverse a linked list? | glaive |
I am trying to create a test module that accepts a pre-selected system role 'Transactional Server' and navigates to the next screen in SLES (SUSE Linux Enterprise Server) and openSUSE. I need to write a script in Perl using the Test::Assert module to ensure that the correct system role is pre-selected and then accept t... | glaive |
I am trying to implement a function in Rust that takes a one-dimensional array of floating-point numbers as input and returns a two-dimensional array that is double the width of the input array. The function should first add 1 to each element of the input array, and then tile the input array and the modified array side... | glaive |
How can I build an AI chatbot to answer customer's frequently asked questions about a product? | glaive |
You are tasked with creating a parallelized simulation in R using the `devtools` and `parallel` libraries. The goal is to generate a set of simulated data using the `mclapply` function and save the results to a file.
Your task is to create a function that takes a seed, `s_seed`, and uses it to perform a simulation. Th... | glaive |
What is the most efficient way to rewrite this code in order to reduce the time complexity? | glaive |
You are tasked with creating a protocol for validating and executing transactions within a blockchain network. The protocol needs to include several message types and data structures, such as PreconditionBuf, ExecutionAssertionStubBuf, ChainParamsBuf, TokenTypeBuf, MessageBuf, VMProtoDataBuf, AssertionParamsBuf, Assert... | glaive |
I am trying to create a function in OCaml that takes in a resolution, initial accumulator, a function, and a type 't' and returns an accumulator. The function should iterate through the resolution and apply the given function to each element. The elements can be of type Signature, Attribute, NotCallable, or Value. The ... | glaive |
I am trying to clone some structs in my program, but I am facing an issue. I have defined two structs, `NodeMap` and `Node`, and I want to make them clonable. However, when I try to derive the `Copy` trait for these structs, I get an error stating that `Vec<usize>` and `HashMap<usize, Node>` do not implement `Copy`. I ... | glaive |
How can I create a Java program to calculate the result of the expression 7 + 5 * 2? | glaive |
I am trying to create a virtual environment for my Python project but I am encountering some issues. I need to write a script that sets up a virtual environment and activates it. The virtual environment should be created in a specific directory and the script should also handle deactivating the virtual environment. Can... | glaive |
You are tasked with creating a Clojure program that manages lexical scoping, symbol resolution, and namespace management. The program should allow for the creation of contexts, the addition of bindings and aliases, and the resolution of fully qualified names.
You need to implement the following functionalities:
1. Cre... | glaive |
How can I design an algorithm to format the output of a given string? | glaive |
You are tasked with implementing a service in the java lizard.api.TLZ namespace using the BinaryRDF.thrift library. The service, TLZ_Index, is responsible for managing various indexing operations. Specifically, you need to implement the following methods:
1. idxAdd: Adds a single tuple to the specified shard index.
2. ... | glaive |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.