instruction_seed stringlengths 29 40.5k | source stringclasses 6
values |
|---|---|
You are tasked with implementing a shader effect in Unity called "Hidden/Kino/Fringe". The effect is meant to create a chromatic aberration effect. The shader code provided defines the properties needed for the effect, including texture sampling, lateral shift, axial strength, and axial shift. It also includes a Poisso... | glaive |
Write a program to calculate the value of a sequence using the following formula: a(n) = 10*n^2 + 10*n + 2. The program should take an input n and output the corresponding value of the sequence. | glaive |
You are tasked with creating a program that can fetch and parse data from a given URL, extract the version number and SHA256 hash from it, and then use this information to download a specific file. Your program should be able to handle any valid URL and properly extract and utilize the version number and SHA256 hash fr... | glaive |
I am trying to build a CMake project on Windows and I need to target a specific Windows SDK version (10.0.16299.0). Additionally, I want to include the option to build .NET bindings via CMake on Linux. How can I achieve this using CMake and ensure that the native dependencies of the underlying library are passed throug... | glaive |
Is there an equivalent operator in C++ that works similar to the null coalescing operator in C#? I find myself writing a lot of null checks in my code and I'm looking for a way to reduce the amount of null code. | glaive |
You are tasked with creating a SPARQL query to retrieve information about basketball players and their respective teams from the DBpedia dataset. Specifically, you need to fetch the player's nationality, birthplace, birth date, and team information. Additionally, if available, you should also retrieve the team's presid... | glaive |
You are tasked with implementing a Java class that handles the serialization and deserialization of a map of objects. The map contains key-value pairs, where the key is an object of type `com.chronoxor.test.StructSimple` and the value is an object of type `com.chronoxor.test.StructNested`. Your task is to create a `Fin... | glaive |
I'm trying to determine whether a given group `G` is a simple group. A group is simple if it has no nontrivial proper normal subgroups. I have a commutative group `G` and I want to check if it is simple. I also want to check if the order of the group is prime and if the group is cyclic.
Can someone provide me with a f... | glaive |
I need to create a Java class that can store strings in natural order. Can anyone help me with this? | glaive |
You are tasked with creating a CSS stylesheet for a website. The stylesheet should include the following styles:
1. Set the text size adjustment to 100% for both Microsoft and webkit browsers.
2. Set the text color to #24292e and the line height to 1.5.
3. Use the font family -apple-system, BlinkMacSystemFont, Segoe U... | glaive |
How can I write a Python program that encodes a string into Base64 representation? | glaive |
Is there a way to get the inserted document in MongoDB in a single step, instead of having to perform another query? | glaive |
Can you provide an algorithm that reverses a given string while keeping the words unaffected? | glaive |
You are tasked with implementing a function that calculates the distance of a complex number from the origin after a given number of iterations. The function should take in a complex number, an integer representing the maximum number of iterations, another complex number, a real number representing the square of the es... | glaive |
I need to implement a SamplingManager service that provides different sampling strategies for tracing in my application. The service should have a method getSamplingStrategy that takes a string parameter serviceName and returns a SamplingStrategyResponse object. The SamplingStrategyResponse should include the type of s... | glaive |
You are tasked with creating a module in Elixir that defines the configuration for continuous tests in a Google Cloud Dialogflow environment. The module should include the following attributes:
- `enableContinuousRun`: a boolean indicating whether to run test cases periodically
- `enablePredeploymentRun`: a boolean ind... | glaive |
You are tasked with creating a program that manages deployment configurations for a micro-service. The program should support various deployment patterns, including full restart, customizable rolling updates, and fully custom behaviors. Each individual deployment should be represented as a replication controller. The p... | glaive |
I am encountering an issue with Sublime Text where I am unable to stop it from executing an infinite loop. For instance, when I execute the following code snippet in Sublime Text:
```python
while True:
print('loop')
```
I can't seem to be able to stop it and have to manually kill the process and restart Sublime T... | glaive |
I'm trying to implement a function in Python that calculates the harmonic series up to a given positive integer `n`. The harmonic series is defined as the sum of the reciprocals of the natural numbers up to `n`, i.e., `1 + 1/2 + 1/3 + ... + 1/n`. I need to implement a function `harmonic_series(n)` that returns the valu... | glaive |
I am working on a project in Python and I need to create a virtual environment to manage my dependencies. However, I am having trouble setting up the virtual environment using a script. Can someone help me write a script to set up a virtual environment in Python? | glaive |
You are required to create a class in SystemVerilog called "employee" that represents an employee in a company. The class should have the following properties:
- Name (string)
- ID (integer)
- Department (string)
You also need to include a method in the class called "displayDetails" that prints out the details of the e... | glaive |
我想要撰寫一個程式來根據配對資訊進行降序排序。請問有什麼方法可以使用 Python 來處理這個問題嗎?以下是我的配對資訊:
```python
my_list = [('John', 70), ('Jane', 80), ('Dave', 65)]
``` | glaive |
You are tasked with creating a file monitoring system using the file-watchers module in Racket. Your goal is to implement a program that can monitor file activity in a system and react accordingly. The program should be able to watch directories, files, and links, and report any changes in real-time. You need to create... | glaive |
You are tasked with creating a custom Google Maps Place Picker widget in Flutter. You need to build a widget that allows users to pick a place on the map and get its details. The widget should include features such as searching for a place, moving the map, and selecting a place. The widget should also have options to e... | glaive |
What is the code to create a website that displays a table with the data from the provided array? | glaive |
You are tasked with creating a PowerShell function that uses an ADSI DirectorySearcher to search the current Active Directory site for Lync servers and returns a random local server. The function should grab the AD group named 'RTCHSUniversalServices', which contains the DN to the local Lync FrontEnd (FE) servers.
You... | glaive |
How can I generate code to compare two objects in Python? | glaive |
You are tasked with creating a function in Kotlin that takes a higher-order function as a parameter. The higher-order function should be able to take a string and perform some operation on it. However, when attempting to call the higher-order function inside the main function, an error is encountered. Your task is to i... | glaive |
You are working on a database project and need to alter a table to change the data type of a column. You are required to write a SQL query to alter the table 'product' and change the data type of the column 'name' to varchar(80). Ensure that the query does not cause the ScriptRunner to fail. | glaive |
You are tasked with implementing a configuration for the adblock package to block ad/abuse domains by using DNS. Your goal is to create a Lua script that defines the configuration options for the adblock package, including the main adblock options, blocklist sources, and extra options.
The script should include optio... | glaive |
You are tasked with creating a class that extends the abstract class `BindDelegateNodeDescriptor`. The class should have two generic type parameters, `T` and `TInterface`, where `T` is a subclass of `BindDelegateNode` and `TInterface` is an interface of `IDelegate`. The class should have a constructor that takes an ins... | glaive |
You are tasked with creating a script to download and install a specific version of the MinGW toolchain for Win32. The version to be downloaded is 8.1.0 and the download link is https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/8.1.0/threads-posix/dwarf/i686... | glaive |
You are tasked with creating a mixin for a Role Model in a Node.js application using the given framework. The mixin should inject new fields into the Role Model and should be able to handle caching based on certain options. The fields to be injected include the role list, permissions cache list for roles, and the role ... | glaive |
I have an array in Python and I want to find the maximum element from it. Can you help me with a solution? | glaive |
You have been tasked with creating a component called "StairsUp" in a web application using the Lemon framework. The component should display an image of stairs going up in an SVG format. The size of the image should be customizable and set to a default value of 50. Your task is to write the template for the "StairsUp"... | glaive |
You are tasked with implementing a simple paging mechanism for search results in a web application using Groovy. The goal is to create a class that allows you to extract an offset into the search results, helping with the implementation of paging functionality.
You need to create a class called "OffsetCollector" that... | glaive |
I have a simple `main.c` file and an even simpler `hello.asm` file. When I try to link them using the command `ld -o main main.o hello.o -arch i386 -lc`, I get an error message that says "ld: warning: ignoring file main.o, file was built for unsupported file format (0xCF 0xFA 0xED 0xFE 0x07 0x00 0x00 0x01 0x03 0x00 0x0... | glaive |
I created a stored procedure in SQL Server 2008 that retrieves the changes made to a table. I am using Linq to SQL in C# to access this table. Here is my stored procedure:
```sql
CREATE PROCEDURE dbo.getlog
@p1 int = 0,
@p2 int = 0
AS
BEGIN
SET NOCOUNT ON;
DECLARE @from_lsn binary(10), @to_lsn binar... | glaive |
You have been tasked with implementing a new event loop policy in asyncio. Your task is to subclass the DefaultEventLoopPolicy and override the methods for which custom behavior is wanted. The custom behavior should include implementing the get_event_loop method to return a customized event loop. Your implementation sh... | glaive |
I am trying to create a feedback button in my web application using the re-frame framework in Clojure. I want to implement a functionality where a user can click on the feedback button and be redirected to a feedback form in a new tab. Additionally, I want to dispatch an action when the user clicks on the feedback butt... | glaive |
Can you provide an AI solution to generate an XML document that includes all the details of books from a given list? | glaive |
I need help formulating an SQL query command to extract the 'name' and 'email' fields of workers whose unique identifiers (id) fall within the numerical bracket [10, 20]. Can you provide a query that is properly formatted to avoid any potential syntax errors? | glaive |
How can I write a SQL query to find the most expensive product in each category? | glaive |
I have an existing Java calculator program that performs basic arithmetic operations using four methods: addition, subtraction, multiplication, and division. However, I want to modify the program to include additional functionality and error handling. Specifically, I want to incorporate the modulus, exponentiation, squ... | glaive |
You have been tasked with creating a browser storage system for a lounge application. The system should allow users to load and save documents to the lounge storage, with the added functionality of automatically checkpointing as users type. You need to implement the necessary functions to store and retrieve documents f... | glaive |
I am currently working on solving UVa problems and I want to focus on efficient algorithms. I have already covered some topics like IO optimization and memory management. Now, I want to dive into dynamic programming. Can anyone provide me with a priority list or suggestions for must-have efficient algorithms in dynamic... | glaive |
Can someone provide a solution in JavaScript to determine if a given number is a power of 2? | glaive |
You are required to implement a class called SolverStereoHuberL1, which computes the disparities between two views by using a Huber-L1 Regularization-Dataterm combination optimized with a primal-dual optimization. The class should have the following functionalities:
- Constructor with parameters, size, and level
- Init... | glaive |
You are tasked with implementing an address decoder and data router in VHDL for educational purposes. The address decoder and data router will interconnect the core with memory (ROM, RAM, and I/O). The VHDL code should include the entity and architecture for the address_decode module, with specific input and output por... | glaive |
You are tasked with creating a PowerShell script that downloads and installs a specific branch of a repository from GitHub. The branch name should be stored in a variable called $Branch. The script should download the installation script (dnvminstall.ps1) from the GitHub repository and execute it. Additionally, the scr... | glaive |
How can I build a React application that displays a table of books with columns for title, author, and ISBN? | glaive |
You are tasked with creating a program that uses the AWS CLI to list all deployments associated with a specified application and deployment group, and filter the results based on the deployment status and create time range.
Create a script that takes the following inputs:
- application name (e.g., WordPress_App)
- dep... | glaive |
How can I generate a binary tree in Java using an array of integers? | glaive |
I need to parse a list of US addresses from a file using the Text.Regex.PDeriv.ByteString.Posix module in Haskell. The addresses are in the format "City, State ZipCode". The regular expression to match this format is "^(.*) ([A-Za-z]{2}) ([0-9]{5})(-[0-9]{4})?$". I need to read the addresses from a file, compile the re... | glaive |
You are tasked with implementing a music player in Go, which has three different modes of operation: RandomMode, RepeatMode, and SequentialMode. The player should be able to receive requests and play tracks accordingly. It should also have the ability to switch between modes, stop playing, and play the previous or next... | glaive |
I am working on a pastebin application and need to implement a function that calculates the MD5 hash of a given string and stores the data in a database with a unique key. I also need to implement a function that retrieves the stored data using the unique key. Can someone provide a solution in Clojure for implementing ... | glaive |
You are required to create XSLT functions for a specific scenario using the given code framework. The functions need to be implemented to perform certain tasks in the context of XML transformation. Assume that the functions need to be implemented from scratch, and the goal is to create a set of custom XSLT functions ac... | glaive |
You are tasked to implement a parser for a templating language. The language has a set of rules for parsing expressions, comments, helpers, partials, and more. Your task is to create a function that takes a string input and parses it according to the rules of the templating language. The function should be able to hand... | glaive |
You are tasked with creating a Clojure web application using the ring and selmer libraries. Your goal is to implement a function that renders an HTML template using the provided parameters. The function should set the content type to "text/html; charset=utf-8" and use the parser/render-file function to render the templ... | glaive |
You are tasked with creating a Go program that involves handling sessions for authentication with a provider. The program should include the following functionalities:
1. Define a struct named "Session" with the following fields:
- AuthURL (string)
- AccessToken (string)
- RefreshToken (string)
- ExpiresAt ... | glaive |
You are tasked with implementing a virtual machine for an orthographic programming language. The virtual machine needs to be able to evaluate values, read values, and step through the program code.
The virtual machine should be able to handle errors such as word not found, type errors, divide by zero, negative denomin... | glaive |
You are tasked with creating a backup and restore system for a MariaDB database using mariabackup. The goal is to automate the process of taking full and incremental backups and restoring them when needed. You need to write a script that sets up the backup user, installs mariabackup, and creates a cron job for regular ... | glaive |
You are tasked with implementing a program to generate the first n terms of the sequence defined by the recurrence relation: a(n) = a(n-1) + 3*a(n-2) - a(n-4), with initial values a(0)=1, a(1)=1, a(2)=4, and a(3)=7. The program should take an integer n as input and output the first n terms of the sequence.
For example... | glaive |
You are tasked with implementing a functionality to integrate Emacs "tags" facility with org mode. The goal is to define tag destinations in org-mode files as any text between double angled brackets. This will allow the tags-generation program `exuberant ctags` to parse these files and create tag tables that record whe... | glaive |
You are tasked with creating a program to model the financial data of multiple firms. The program will take in various parameters such as the number of firms (J), the number of observations (N) for different years, the number of seasons (Q), and the number of coefficients for the column vectors in different covariate m... | glaive |
I am working on a project where I need to add support for a third-party tool called RenderDoc. I want to create a CMake file to specify whether to add support for RenderDoc or not. Can anyone help me with the code to achieve this using the CMake language? | glaive |
I am using the caret package in R to tune a glmnet logistic regression model. I've noticed that while the lambda value from the best tune is one of the values I specified in the tuneGrid, the lambda values of the final model are completely different. The optimal value of lambda in the final model also does not appear i... | glaive |
You are tasked with implementing a statistical model using Stan, a probabilistic programming language. The model is designed to analyze a dataset with the following variables:
- N: the number of data points
- N_T: the number of treatments
- N_B: the number of groups for treatment B
- N_A: the number of groups for treat... | glaive |
I need to implement a function that uses Brent's algorithm to find a root of a real valued function of one variable. The function should accept a function F that takes a single real argument t and returns a table F(t) containing an entry F(t)["err"], which we want to be zero. The function should also take two numbers a... | glaive |
You are tasked with creating a game room using the GameMaker Studio software. The room should have specific settings, views, layers, and physics settings. The room should inherit from a parent room and have certain dimensions and properties. Your task is to write the code to create the game room with the given specific... | glaive |
You are tasked with creating a Python program that retrieves information from multiple GitHub repositories and their associated references. Your program should be able to extract the URLs of the Git repositories and the corresponding references mentioned in the given snippet. You need to write a Python function that ca... | glaive |
I'm working on a project where I need to optimize the compiled assembly code for a specific architecture. The problem is that branch instructions are very costly in terms of performance due to the way the processor pipelining is implemented. Are there any strategies or techniques I can use to minimize the number of bra... | glaive |
How can I write a Java program to find the middle element of a linked list? | glaive |
You are tasked with implementing a quantum amplitude calculation and visualization program. The program should calculate the probability of a quantum state given certain input parameters and then visualize the probability distribution in a 3D plot and a contour plot. The input parameters are the angles `a` and `b`, whi... | glaive |
You are tasked with writing a bash script that performs a series of tasks based on certain conditions. The script should first check the value of the variable JHI_APP, and if it contains the substring "uaa", it should change directory to the folder specified by the variable JHI_FOLDER_UAA, run a maven build with the co... | glaive |
You are tasked with creating an Android settings activity that allows the user to select a directory path and choose a search mode. The activity should have the following functionalities:
1. Display a text view to show the selected index data path.
2. Use radio buttons to allow the user to select between "Hybrid" and "... | glaive |
You are tasked with implementing a class in the Calypso-NavigationModel-Model category called ClySortBrowserItemFunction. This class should have the ability to sort ClyBrowserItem instances based on their actual objects using a provided sort function called actualObjectSortFunction. You need to create the instance vari... | glaive |
I am working on a web application using Elm and I need to implement a router module that handles routing and rendering of different views based on the current route. The router should also check if the user is logged in and display the appropriate view accordingly. Can someone provide a complete implementation of the r... | glaive |
I am trying to create a package for my database test 2 (dbt2) project using CMake and CPack. I want the package to be in tar.gz, tar.bz2, and tar.xz formats. The package name should be "dbt2" and the description summary should be "Database Test 2". The version of the package should be 0.42.0 and the vendor should be "d... | glaive |
You are tasked with creating a CMake macro to initialize project metadata and handle different platform-specific configurations. The macro should include setting the resource folder, icon name, and handling different configurations for Windows and macOS platforms. Additionally, the macro should initialize the OS bundle... | glaive |
You are tasked with creating an editor application in a programming language that supports object-oriented programming. The application should have the ability to handle events such as exposure, entering and leaving the window, focus change, button presses, button releases, mouse motion, key presses, and key releases.
... | glaive |
I am trying to implement a subroutine in Fortran that includes a dummy procedure, but I keep encountering errors related to elemental functions and procedure references. Additionally, I am having issues with passing non-intrinsic elemental procedures as actual arguments. Can someone provide guidance on how to resolve t... | glaive |
You are tasked with implementing a Python script for object detection using the CUDA framework. The script should take in the following command-line arguments:
- `ckpt_path`: the path to the checkpoint file for the trained model
- `labels_path`: the path to the label map file
- `file_name`: the path to the input video ... | glaive |
You are tasked with creating a data structure using the provided macros to read and write binary data. Your task is to define a composite data class named "define-composite" with parent classes and slots. The slots should be defined using the following forms:
- (name type)
- (name type default)
- (name (type count))
-... | glaive |
You need to create a bash script that takes in a file path and a byte size as input and writes a specific number of bytes to the specified file. The script should first check if the correct number of arguments is provided and if the file path is writable. It should also validate if the byte size provided is a positive ... | glaive |
You are tasked with creating an R script to generate a multi-plot graph from a given input file. The script should take at least 18 arguments, including the input file name, output file name, IDs for 6 different metabolites, the end cycle, a title, and 6 colors for the metabolite plots. If available, it should also tak... | glaive |
You are tasked with creating a library called "sa" that contains stand routines, io routines, network routines, network info services, and boot filesystems. The library should include the following source files:
- alloc.c
- exit.c
- getfile.c
- getln.c
- globals.c
- memcmp.c
- memcpy.c
- memset.c
- printf.c
- snprintf.... | glaive |
You are tasked with creating a LaTeX presentation template using the KOMA-Script class. The template should include a title slide, table of contents, multiple presentation slides, and a citation section. The presentation should feature various elements such as text, bullet points, numbered lists, tables, figures, theor... | glaive |
I am trying to create a data structure that can hold different types of items, such as lists, maps, and a mix of both. I need to define the structure and its components in a way that allows for flexibility and easy access to the data. Can someone help me come up with a solution for this? | glaive |
You are working on a project that requires measuring power consumption on Cray machines, such as Piz Daint. Your task is to implement a feature that allows the user to measure power consumption using the CrayPower library. The code snippet provided sets flags and macros based on the value of ${USE_CRAYPOWER} and define... | glaive |
How can I create a robot controller to move an object from one end of a room to the other using an AI? | glaive |
You are tasked with implementing a data structure and its associated enum in the C++ programming language. The data structure, called Item, should have three fields: a string key, an optional binary value, and an enum value of type ItemEnum. The enum, called ItemEnum, should have two options: OPTION_ONE with a value of... | glaive |
You are tasked with creating a command file for Sphinx documentation. The command file should be able to handle various targets, such as creating HTML files, pickle files, JSON files, LaTeX files, and more, based on the user's input. Additionally, the command file should be able to check for the availability of the sph... | glaive |
You are tasked with creating a BossAI object that controls the behavior of a boss unit in a game. The BossAI object should have the following functionalities:
- It should be able to transition between different states such as IDLE, AGRO, LEASHING, and DEAD based on certain conditions.
- It should be able to handle the ... | glaive |
You are tasked with creating a CMake configuration file for a project that requires the use of several third-party libraries. The project requires the use of the following libraries with the specified versions and configurations:
1. Catch (Version 2.13.7)
- Download URL: https://github.com/catchorg/Catch2/archive/v... | glaive |
I am trying to create a subclass in my Smalltalk program using the *core-squeak-subclass creation method. However, I am currently facing some issues with the instance variable names, class variable names, and pool dictionary names. Can someone provide a detailed example of how to use the *core-squeak-subclass creation ... | glaive |
I am working on a project and need to write a CMake script to remove specific files and directories. Can someone provide a sample CMake script that demonstrates how to use the file(REMOVE_RECURSE) command to delete multiple files and directories at once? | glaive |
You are tasked with creating a custom validation rule for a PHP application. The application needs to validate a new field called "custom_field" with the following requirements:
- The field should only accept alphanumeric characters, dashes, and underscores.
- The field should have a minimum length of 3 characters and ... | glaive |
I have a table called `tblEmployee` with a foreign key column called `Manager` that references the primary key `tblEmployee.EmployeeID`. This allows for an arbitrarily deep hierarchy. However, I encountered a problem where a circular reference was created in the table. For example, I accidentally set the manager of Ali... | glaive |
You are tasked with creating a function in R that calculates the propagation of a matrix based on a given physical and functional network. The function should take in a matrix Y and an optional parameter alpha (default value of 0.2). It should perform the following steps:
1. For the physical network, calculate the prop... | glaive |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.