instruction_seed stringlengths 29 40.5k | source stringclasses 6
values |
|---|---|
I am currently working on an iOS project using the Unity framework. When I export an Xcode project from Unity, there are a whole bunch of files exported. Besides some source files, there are also .dll files for the Mono project. But there are also .dll.s files. For troubleshooting, it would be great to know what they a... | glaive |
Can someone please help me modify the provided HTML structure to include a footer? | glaive |
What is the Python code to generate the Fibonacci sequence up to the nth term specified by the user?
Code:
```python
def fibonacci(n):
a = 0
b = 1
if n < 0:
print("Incorrect input")
elif n == 0:
return a
elif n == 1:
return b
else:
for i in range(2,n):
... | glaive |
You are tasked with creating a Mempool API service using the proto3 syntax. The service should have three RPC methods:
1. GetMementry: This method should take a TxidParam as input and return a JsonResp.
2. GetMementryTime: This method should take a TxidParam as input and return a TimeResp.
3. FindMempoolhist: This meth... | glaive |
I need to create a MySQL stored procedure that will delete records from the s_resp table in a database. The procedure should delete records in batches, with a delay of 20 seconds between each batch. The ROW_ID of the records to be deleted follows a specific pattern: it consists of a number followed by '-4ZJ7T'. The num... | glaive |
Can you provide a code snippet that can classify whether a given sentence is positive, negative, or neutral? | glaive |
You are tasked with implementing a REST-based controller for a pricing service in a Java application using the Spring framework. The controller should have a method to get the price for a requested vehicle. The method should take the ID number of the vehicle as a request parameter and return the price of the vehicle, o... | glaive |
I need to create a bash script that scans a directory for Debian package files (with a .deb extension) and creates a Packages file listing all the packages along with their metadata. Then, I need to compress the Packages file using bzip2 and update the Packages file with the compressed version. The script must be able ... | glaive |
You are tasked with creating a CMake script that sets the target include file search paths and defines the implicit dependencies for a project. You need to define the set of languages for which implicit dependencies are needed, the set of files for implicit dependencies of each language, the compiler ID, the include fi... | glaive |
You are tasked with implementing a data structure for streams in Agda. Streams are defined as an infinite list of elements. You will need to create a record `Stream` with a coinductive field that represents the head and tail of the stream. Additionally, you are required to define a constructor for streams using co-patt... | glaive |
You are tasked with creating a web page that includes various CSS and JavaScript files for styling and functionality. The page should include an HTML template with the necessary meta tags, links to CSS files, and script tags for JavaScript files. Additionally, the page should contain a title and links to external libra... | glaive |
You are tasked with creating a script in the SPK package for a new software called "backupnow". The script should include the following information:
- Name of the software: backupnow
- Version: 2.0.1
- Revision: 1
- Icon file location: src/backupnow.png
- Dependencies: None
- Maintainer: johndoe
- Description: Backupno... | glaive |
I have this code that uses a union and two nested structs in C. When I compile and run the code, I get the output "a = 0x2 b = 0x2 c = 0x3". However, I came across a comment saying that this code may not be well-defined in the C11 standard. Can someone confirm whether this code is well-defined or not?
```c
#include <s... | glaive |
You need to create a program that can find the nearest location of a certain thing based on latitude and longitude coordinates. The program should take in the latitude and longitude of a certain location and return the nearest thing to that location.
Write a function or method that takes in the latitude and longitude ... | glaive |
You are tasked with creating a class in Common Lisp that represents a "repeater-day" for a date and time library. The class should have methods for generating the next occurrence, the current occurrence, offsetting an occurrence, and determining the width of an occurrence.
Your task is to implement the following metho... | glaive |
I am trying to create a test suite for a project using the ASDF system definition in Common Lisp. I want to ensure that my test suite covers all the necessary components and runs successfully. Can someone provide guidance on how to set up the ASDF system definition for a test suite in Common Lisp? | glaive |
I am working on a project where I need to define message and service files for a ROS (Robot Operating System) package. However, I am not sure how to properly set the paths for these files in the CMakeLists.txt file. Can someone provide a clear example of how to set the paths for message and service files in the CMakeLi... | glaive |
You are working on a project that involves connecting to a wet lab database using pyBCKG, a Python library. You need to create a high-level function that takes experiment data from the wet lab and returns a data frame with characterization results. The function should be able to handle different types of experiments an... | glaive |
I am trying to write a C program that generates a random number within a specific range. Can someone help me with this? | glaive |
You are tasked with implementing a function called addVocabulary that takes in three parameters: ⍵, ⍺, and axes. The function should perform the following operations based on the given conditions:
- If ⍺ is equal to '⊂', the function should return ⍵ if it is a simple array. If ⍵ is not a simple array, the function shou... | glaive |
You are required to create a Zig program that builds a parser grammar for a specific format using the provided grammar rules, tokens, and directives. The program should be able to parse the grammar format and generate the necessary parser grammars at runtime. Your task is to write a Zig program that initializes the par... | glaive |
You are tasked with creating a simple web application using the Laravel framework. The application should have a navigation bar with a branding image and links to various pages. It should also have a footer with copyright information and a reference to the application name. Additionally, the application should include ... | glaive |
You are tasked with creating an Ansible Playbook to automate the setup of Red Hat Ansible Tower. The playbook should perform the following tasks:
1. Log in to the Tower using the provided credentials.
2. Set up an inventory in Tower using an Ansible Playbook.
3. Create a project in Tower by importing a GitHub repositor... | glaive |
You are tasked with implementing a function called "extF" in the programming language Julia. The function takes in a time parameter "t" of type T, where T is a subtype of Real, and a vector of "Joint" objects. The function should return a vector of "extForces" objects. The "extForces" and "Joint" types are defined else... | glaive |
You are tasked with creating a macro in SAS that updates the source code of a type 2 STP (Stored Process) by uploading the contents of a text file or fileref to the existing STP. A type 2 STP has its source code saved in metadata. The macro should take the following parameters:
- stp: the BIP Tree folder path plus Stor... | glaive |
I am trying to create a Types game using React and Gatsby, and I want to display different types of content based on the path. For example, if the path is "/types/numbers", I want to display content related to numbers, and if the path is "/types/letters", I want to display content related to letters. I need to create a... | glaive |
You are working on a server-side application and need to set the character encoding for your system. You want to ensure that the character encoding is set to "en_US.UTF-8" to handle international characters properly. Write a script to modify the /etc/profile file and append the line "LC_CTYPE="en_US.UTF-8"" to it. | glaive |
I'm in the process of migrating my Rails 5.2 app to Rails 6.0 and I want to use Sprockets instead of Webpack. However, the default Rails setup includes Webpack files and I'm not familiar with Webpack. Can someone explain how I can remove Webpack from Rails 6 and install Sprockets instead? I've heard that Rails follows ... | glaive |
Is it possible to write a TypeScript function that takes two numbers as input and returns the smaller number? I want to implement this in my project. | glaive |
How can I print several statements in Python that give standard output without seeing newlines between statements? Specifically, I have a loop that iterates over the range from 1 to 100 and prints each item. However, this results in each number being printed on a new line. How can I modify my code to print the numbers ... | glaive |
You are tasked with creating a program that calculates the probability of a quantum system being in a certain state. The system is defined by a number of qubits (nqubits) and a set of amplitudes. The amplitudes are calculated using the amplitude function, which takes two input variables (x and y) and returns a complex ... | glaive |
I am trying to implement a function in my Haskell program that converts a list to a vector. However, I am struggling to understand the implementation of the `vecFromList` function provided in the code snippet. Can someone please help me understand how to convert a list to a vector and provide a clear implementation of ... | glaive |
You are tasked with implementing a program that manages a list of items. The program should include a set of header files that define the data structures and functions needed for the program, as well as a set of source files that contain the actual implementation of these functions. Your task is to create the necessary... | glaive |
I am trying to find the curses include file and library in my CMake project. I want to set the following variables:
- CURSES_FOUND: to check if the system has Curses
- CURSES_INCLUDE_DIR: to store the Curses include directory
- CURSES_LIBRARIES: to store the libraries needed to use Curses
- CURSES_HAVE_CURSES_H: to che... | glaive |
You are tasked with implementing a CUDA kernel function for the Adadelta update algorithm. The Adadelta algorithm is an extension of the Adagrad algorithm which dynamically adapts the learning rate over time without the need for a manually selected learning rate. The CUDA kernel function must perform the following oper... | glaive |
You are tasked with creating a program that can process and manipulate data related to objects in a given environment. The environment contains various objects, each defined by a set of properties such as position, dimensions, and color information. Your task is to write a program that can read and interpret this data,... | glaive |
What is the code to optimize the arriving times of different buses in a city? | glaive |
I am working on creating a rate limiting service in Golang using the `ratelimit` package. I need to implement the `shouldRateLimitWorker` and `ShouldRateLimit` functions for the rate limiting service. The `shouldRateLimitWorker` function should take in a context and a `pb.RateLimitRequest` and return a `pb.RateLimitRes... | glaive |
You are tasked with creating a ForecastDefinition class in the intersight package. The ForecastDefinition class should have the following properties:
- ClassId: a string representing the fully-qualified name of the instantiated, concrete type
- ObjectType: a string representing the fully-qualified name of the instantia... | glaive |
You are tasked with creating a Dockerfile to build an image that includes the .NET Core Runtime and sets up a web server to bind to port 80. The Dockerfile should retrieve the .NET Core Runtime, verify its checksum, and then copy it into the final image. Additionally, it should configure the web server to bind to port ... | glaive |
I need to create a function in AngularJS that will send a password reset link to a user's email. The function should take the user's email as input and handle the response and error messages appropriately. The function should also use a progress bar to indicate the sending process. Can someone please provide a code exa... | glaive |
How can I create a program in Python to solve the traveling salesman problem? | glaive |
You are tasked with implementing a Bayesian model using Stan, a probabilistic programming language. The model uses transformed data, parameters, and a normal distribution for the likelihood function. Your task is to write the Stan code for the given model, including the data, transformed data, parameters, transformed p... | glaive |
You are tasked with creating a Makefile to compile and run a series of test cases for a C program. The Makefile should include rules to compile each test case and compare the output with an expected result. The test cases are listed in the TESTS variable and each test case has an associated .c file and a .expect file. ... | glaive |
I need to write a CMake script to remove specific files and directories from my project. The files and directories to be removed are "matrix_expressions_ex.dir/matrix_expressions_ex.cpp.o", "matrix_expressions_ex.pdb", and "matrix_expressions_ex". Can someone please provide a CMake script to achieve this? | glaive |
You are tasked with creating a Clojure program that implements the functionality of a lein-cucumber project. Your program should be able to perform the following actions:
- Create a new lein-cucumber project with or without special configurations
- Add features and step definitions to the project
- Run lein-cucumber wi... | glaive |
I need to design a class in Python that can store and manage a collection of data points. How can I accomplish this using object-oriented programming principles? | glaive |
You are tasked with implementing a text field component in Elm using the given module and code snippet as a reference. The text field component should have the following features:
- It should support a label, which can float above the input when it is focused or has a value.
- It should be able to display an icon, eith... | glaive |
I am trying to implement a self join in Apache Spark SQL with the following scenario: I have a table named "areas" with columns "aid", "title", and "pid", and I want to create a materialized view for a specific query. The query is to select the "title" of the child areas for a given parent area "hebei" using a self joi... | glaive |
You are tasked with implementing a module for a Pulse analysis system. The module should include the following components:
- AbstractValue
- Attribute
- Attributes
- CallEvent
- Diagnostic
- Invalidation
- Trace
- ValueHistory
Create a new module that incorporates these components and ensures that they are safe to use... | glaive |
I need to create a service in my web application using the autox-phoenix framework to manage user presence sessions. The service should handle the logic for tracking user activity and managing their presence status. Can someone provide a complete implementation for this service using the autox-phoenix framework? | glaive |
I am working on a project using PHP and Symfony, and I need to create a class that implements a specific interface to resolve the path of a fixture file. The class needs to take in a parameter of type BundleConfig in its constructor and implement the resolve method, which takes in a string parameter representing the en... | glaive |
You are tasked with implementing a function called `sum` that takes two integer inputs and returns their sum. The function should pass the following tests:
- When given 3 and 7 as inputs, the function should return 10.
- When given 3 and 7 as inputs, the function should not return 11.
Write the `sum` function in Emacs... | glaive |
You are tasked with creating a function in the recipe module that takes a partition as input and outputs a series of objects. The function should iterate through each object in the partition and generate a series of objects using the @series macro.
Your task is to implement the function "f" in the recipe module, follo... | glaive |
You are tasked with implementing a statistical model in the Stan programming language to analyze the relationship between the number of deaths and various predictor variables. The model is a beta-binomial hierarchical model, and you are required to define the necessary data, parameters, transformed parameters, model, a... | glaive |
You are tasked with implementing a social login feature in a web application using PHP and the Laravel framework. The feature should allow users to log in using their Google or other social media accounts, and if the user does not exist in the database, they should be created and stored.
Your task is to create a new c... | glaive |
You are tasked with creating a Dockerized Flask application that runs on a server with Python 3.7. The application should have a single endpoint that returns a greeting message. You need to set up the environment, install the required dependencies, and configure the application to run on port 5000. Additionally, you ne... | glaive |
I am trying to create custom constraints for my unit tests in C#. Specifically, I want to create a constraint that checks if a certain exception type is thrown. Can someone guide me on how to create custom constraints for different types of exceptions in C# using the NUnit framework? | glaive |
You are tasked with creating a program to manage DNS records for a cloud-based service. Your program should be able to perform the following operations:
1. Add new ResourceRecordSets to the collection.
2. Remove existing ResourceRecordSets from the collection.
3. Update the DNS queries for the zone.
Write a program th... | glaive |
You are working on a project where you need to create a LaTeX document using the report class. Your document will include a cover page, table of contents, list of figures, list of tables, several chapters, appendices, glossary, and bibliography. You also need to include a watermark for draft versions, set metadata for ... | glaive |
You are tasked with creating a Dockerfile for a Node.js application using TypeScript and OpenTelemetry. Your Dockerfile should include two stages: BUILDER and PRODUCTION. The BUILDER stage should install dependencies, copy configuration files, source code, and tests, and then build the application. The PRODUCTION stage... | glaive |
You are tasked with implementing a JTAG chain configuration in Quartus II 64-Bit Version 15.0.0. The goal is to define a JedecChain and specify the devices and actions within the chain. Specifically, you need to set the Device PartName, Path, and File for the ActionCode(Cfg) and ensure the ChainType is set to JTAG. You... | glaive |
In Python, I know that classes are traditionally named using camelCase. Is it also the standard convention to name the file containing the class in camelCase, particularly if the file only holds the class? For instance, should a class named 'className' be stored in a file named 'className.py' instead of 'class_name.py'... | glaive |
I am trying to embed types in my Visual Basic project, but I am having trouble with the `EmbeddedTypesManager` class. I need to create a new `EmbeddedTypesManager` instance and implement the `GetSystemStringType` and `GetWellKnownMethod` functions. The `GetSystemStringType` function should return a `NamedTypeSymbol`, w... | glaive |
You are tasked with creating a simple webpage layout using HTML and CSS. The layout should include a header, a section, and a footer. The header should have white text aligned in the center, the section should have a white background, rounded corners, padding, a specific width, and a box shadow, and the footer should h... | glaive |
You are tasked with creating a program to match a user's query string to geographic coordinates. The program should be designed to be used in location input with type-ahead support, taking into account that the user is typing and the query may not be complete. The program should have the following functionality:
- Acce... | glaive |
I am trying to create a template parsing and generation system in Ponyo programming language. The system should be able to parse a template string and generate a result based on the provided context. The template string can contain control structures like loops and variables, enclosed in double curly braces (e.g. {{var... | glaive |
You are tasked with implementing a CUDA kernel function that performs reduction operations on a given input tensor. The reduction operation should compute the sum of all elements in the tensor and store the result in a separate output tensor. You should also ensure that the reduction operation is performed in parallel ... | glaive |
You are tasked with creating a VirtualClient class for an audio application using Discord.Net. The VirtualClient should have the following properties and methods:
- Properties:
- Server: representing the server the client is connected to
- Id: representing the client's ID
- SessionId: representing the client's se... | glaive |
You are tasked with creating a PowerShell function that generates mock data for VMware vSAN network configuration properties. The function should be able to handle different scenarios based on the presence or absence of the vSAN network configuration IP interface and the desired state (present or absent). The function ... | glaive |
You are tasked with implementing a command-line interface (CLI) tool for managing a DNS server. The CLI tool should be able to add, delete, list, update, reset, get, and delete domain records. The tool should also be able to initialize and start the DNS server API.
Your task is to create the necessary functions and c... | glaive |
You are tasked with creating a PowerShell function that will search and replace a specific pattern in a given file. The function should take a file path and a hashtable of search and replace patterns, and then update the file with the new values. The search and replace patterns should be provided in the format of a has... | glaive |
I am trying to create a PowerShell bot using PoshBot module, and I want to handle any errors that may occur during the bot execution. I have a configuration file located at C:\poshbot\config.psd1, and I want to continuously run the bot using this configuration. However, I need to ensure that any errors that occur are c... | glaive |
You are tasked with creating a Lua function that generates crafting recipes for a variety of building blocks, including stairs, slabs, panels, and slopes. The function should take in parameters for category, alternate, modname, subname, and recipeitem, and based on these parameters, it should generate the appropriate c... | glaive |
You are tasked with writing a script to clean up specific files and directories in a CMake project. The script should remove the following:
- "CMakeFiles/gflags_nothreads_static.dir/src/gflags.cc.o"
- "CMakeFiles/gflags_nothreads_static.dir/src/gflags_completions.cc.o"
- "CMakeFiles/gflags_nothreads_static.dir/src/gfl... | glaive |
I'm using Selenium and running a function that uses the `find_element_by_class_name` command on a webpage. However, I'm encountering an error that says "find_element_by_* commands are deprecated." I'm also getting a DeprecationWarning saying that the `executable_path` has been deprecated, and I should pass in a Service... | glaive |
You are tasked with implementing a new ERC-223 compatible token contract called "CNEXToken". This token contract should be an extension of the "StandardToken" contract and should have additional functionalities for allocating funds to specific purposes.
The contract should have the following features:
1. Allocation o... | glaive |
You are tasked with implementing a module for an emulator using the RISC-V architecture. Your task is to create a new instruction for the emulator that performs a specific operation. Your new instruction should be able to execute on the CPU and convert to raw binary format.
Write a function named `parse` that takes an... | glaive |
You are tasked with creating a web application that takes a parameter "iterations" from the user and generates HTML content accordingly. For each iteration, the web application should display the value of a custom tag "tagTimeUnit" with the parameter "foo" set to "SECONDS". The HTML content should display the value of ... | glaive |
You are tasked with creating a StubRunner class that provides a stub URL for a given groupid and artifactId. The stub URL is expected to be in the format "http://localhost:port". The StubRunner class should be able to handle cases where only the artifactId is provided, and should be able to close the runner after findi... | glaive |
You are tasked with creating a Python program to track inventory for a small business. The program should allow the user to add new items to the inventory, update the quantity of existing items, and display the current inventory.
Specifically, you need to create the following functions:
1. `add_item`: This function sh... | glaive |
You are required to create a smart contract in Solidity for a simple counter. The contract should have a public variable called "count" to store the current count, which is initially set to 0. Additionally, the contract should have a function called "inc" to increment the count by 1. | glaive |
You are tasked with implementing a StockPriceDAO interface in Java. The interface should have the following methods:
1. addStockPrice(StockPrice stockPrice) - This method should add a new stock price to the database and return a boolean indicating whether the addition was successful or not.
2. updateStockPrice(StockP... | glaive |
You are tasked with creating a login system using PHP and the Laravel framework. You need to implement a SessionController that handles user login, logout, and authentication. The controller should have methods for showing the login form, attempting to authenticate a user, and removing the user's session from storage. ... | glaive |
I am trying to extend the Vertex type in my custom graph implementation without having to reimplement the entire set of classes. I want to add arbitrary protocols to the graph with minimal boilerplate. Specifically, I want to add the Region and HasRegion protocols to the graph, and then extend the Vertex type to implem... | glaive |
I am working on a project where I need to encrypt and decrypt sensitive information using the Advanced Encryption Standard (AES) algorithm in Python. I want to implement a function that takes a plaintext message and a secret key, and then encrypts the message using AES with the given key. Can someone provide a solution... | glaive |
How can I convert the string "apple, banana, pear" into a list of individual words in Python? | glaive |
You are tasked with creating a web page that displays a list of products with their respective names, prices, thumbnails, and an option to add the product to the cart. You need to use HTML, CSS, JavaScript, and a popular frontend framework like Bootstrap to create a visually appealing and functional web page. The table... | glaive |
You are tasked with creating a CMake script to find and set the include directories and libraries for the libjingle library. The script needs to find the paths for specific header files and set the required system libraries and additional libjingle libraries based on the configuration (Release/Debug). The script should... | glaive |
How can I create a linear regression model to predict the probability of a bank loan being approved using Python? | glaive |
I have the following code segment that iterates through a list and appends unique numbers less than 50 to a result list. However, I suspect that this code could be more efficient. Can someone please suggest a more sophisticated data configuration and a multi-step logical procedure to improve the efficiency?
```python
... | glaive |
You are tasked with creating a smart contract in Solidity that will manage a simple voting system for a community organization. The contract should allow members to vote for a particular proposal and keep track of the total number of votes for each proposal. Each member should be able to cast only one vote, and the con... | glaive |
You are tasked with creating a program that will remove all files and subdirectories within a specified directory. Your program should be able to handle the removal of both empty and non-empty directories, and it should provide feedback to the user on which files and directories were removed. | glaive |
You are tasked with creating a program to read GPS and IMU data from files and process it into a structured array for further analysis and visualization. The data files are in the following format:
1. GPS position data:
- File: gps_pos_lla.txt
- Columns: Latitude (rad), Longitude (rad), Altitude (m)
2. GPS velo... | glaive |
I am working on a project that requires generating a unique identifier for each user in the system. I need to implement a function that takes in a user's information (such as name, email, and date of birth) and generates a unique identifier for them. This unique identifier should be a combination of the user's initials... | glaive |
You are tasked with implementing a Fortran program to calculate the value of the function A52. The function has the following signature:
```fortran
double complex function A52(j1,j2,j3,j4,j5,za,zb)
```
Where `j1`, `j2`, `j3`, `j4`, and `j5` are integer parameters, and `za` and `zb` are double complex arrays. The func... | glaive |
In Keras, what is the difference between an Activation Layer and a Dense layer? Considering that an Activation Layer seems to be a fully connected layer and Dense has a parameter to pass an activation function, what is the best practice? For a hypothetical network structured as Input -> Dense -> Dropout -> Final Layer,... | glaive |
I need to create an encrypted version of a given string in my Python code. Can someone provide a solution for this using the hashlib module? | glaive |
I am trying to automate the process of activating and deactivating a virtual environment in my Python project. I want to create a script that sets the virtual environment path and updates the prompt to display the environment name. Additionally, I need to create an alias to run the Python documentation tool (pydoc) fro... | glaive |
You are required to create a module in Erlang that handles operations on BSON documents. The module should include functions for looking up, including, excluding, updating, merging, appending, and extracting fields from BSON documents. Additionally, it should have functions for converting time to BSON format, creating ... | glaive |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.