instruction_seed stringlengths 29 40.5k | source stringclasses 6
values |
|---|---|
You have been given a task to create a program that generates, sorts, and benchmarks one million randomly ordered eight byte floats. The program should be able to sort the floats using different methods including R, IML, and Datastep. Additionally, the program should also be able to read and write the sorted data to an... | glaive |
I am trying to write a function in Scheme that takes a procedure and a list as input, and returns the first element in the list for which the procedure returns true. If no element in the list satisfies the procedure, the function should return #f. Can someone help me write this function? | glaive |
You are tasked with creating a program to manage a file system of different types of resources. Each resource can be categorized into different folders based on its type. Your program needs to be able to create new folders, add resources to these folders, and provide a way to filter and retrieve resources based on thei... | glaive |
I want to create a program to represent a graph using Prolog. The program should have the ability to define nodes and edges between the nodes. I want to be able to add, remove, and check for the existence of nodes and edges in the graph. Can someone help me write the Prolog code to achieve this? | glaive |
I am trying to write a function in Emacs Lisp that will help me find and load the correct package.el. I want to ensure that when switching between Emacs 23 and 24, the bundled package.el in Emacs 24 is always used. I also need to define standard package repositories and enable the on-demand installation of packages. Ad... | glaive |
I have successfully installed Kubernetes Cluster (minikube) on my Windows 10 machine and it is running fine. I am able to access the minikube dashboard and everything seems to be working. However, I have a Windows Image with an Asp.Net Web API .Net framework 4.6 Application in it, which is stored in the Azure Container... | glaive |
I need to implement an iterator in Rust, but I'm confused about which methods of the Iterator trait I need to implement. The documentation mentions the next method, but are there any other methods that need to be implemented as well?
Here's an example of what I tried:
```rust
struct SomeStruct {}
trait SomeTrait {
... | glaive |
I need to write a Python program that can find the minimum cost path in a matrix. How can I generate an optimization problem to solve this? | glaive |
Can you provide an example of how to generate an HTML page displaying a weather forecast for a specific location? | glaive |
I am trying to implement a program that involves sending and receiving messages using IPv6 multicast. I have a code snippet that includes functions for sending and receiving messages, as well as setting up the multicast group. However, I seem to be encountering some errors and would like some help in understanding and ... | glaive |
We are debating the best node size for our production GKE cluster. Is it better to have more smaller nodes or less larger nodes in general? We are choosing between the following two options:
1. 3 x n1-standard-2 (7.5GB 2vCPU)
2. 2 x n1-standard-4 (15GB 4vCPU)
We run the following services on these nodes:
- Elastic sea... | glaive |
You are tasked with creating an XSL stylesheet to transform XML data into a specific HTML format. The XML data contains information about lessons and each lesson has an entry with a title, subtitle, and workspace parameter. Your task is to write a template that matches the entry elements within the lesson section and t... | glaive |
I have a list of physical addresses and I need to retrieve their geospatial coordinates, specifically the longitudinal and latitudinal measurements. How can I implement a program that can do this? It should also handle cases where the address doesn't exist or isn't recognized. Additionally, I want the program to be abl... | glaive |
You are tasked with creating a subroutine in Fortran that reads file names for a discrete particle model. The subroutine should take in several input arguments including the number of files, the name of the input file, an array of file names, and other parameters. The subroutine should check if the input file exists an... | glaive |
What is the Java code for calculating the mass of an object using its density and volume? | glaive |
You are working with a dataset in R and need to perform the following tasks:
1. Read in 25 separate text files named "X_64_1.txt" to "X_64_25.txt".
2. Scale each dataset using the `scale` function.
3. Create a second order representation of each scaled dataset using the `create.second_order` function with the `shrink` ... | glaive |
You are tasked with creating a new package in Emacs called "window-switcher" that offers a visual way to switch between windows. The package should require a minimum Emacs version of 24 and should be tagged with the keyword "convenience". The package should also have a URL pointing to its repository on GitHub. Your tas... | glaive |
You are tasked with creating a PowerShell function to retrieve licenses from the Cireson Asset Management system. The function should be able to retrieve licenses based on display name, ID, or a specified filter. The function should also be able to retrieve licenses with a specific number of seats remaining. Your task ... | glaive |
I am trying to create a module in Elm for handling WebSocket communication between a client and a server. I want to fetch news data from the server using different configurations. I need to define a function to make an HTTP request to retrieve news data and handle the response using RemoteData. Can someone help me writ... | glaive |
You are tasked with creating a Dockerfile for building an OpenMPF OpenCV Deep Neural Network (DNN) Classification component. The Dockerfile should pull from a specified build registry and tag, and then run a script to build the component. Additionally, it should include an option to run tests if specified, and then cop... | glaive |
You are tasked with creating a policy type that specializes kernel and dispatch code for a specific copy pass in C++. This policy type should encapsulate kernel-tuning parameters and be specialized for problem type, SM version, and other machine parameters. The kernel function pointer retrieval, constants, and typedefs... | glaive |
Is there a tool or an integrated development environment (IDE) similar to RStudio for Python? In RStudio, I can execute parts of the code in the code editing window, and the results are displayed in the console. It allows me to select whether I want everything up to the cursor to run, or everything after the cursor, or... | glaive |
You are tasked with creating a Flutter command-line tool that will determine which version of Flutter will run based on the project configuration. If the project has a pinned version, the tool should display the project name, directory, pinned version, project environment, and cache information. If the version is not c... | glaive |
I am trying to extend a linear map `f` defined on a subspace of a vector space `E` to the whole space. The catch is that the linear map `N : E → ℝ` is a sublinear map, and I need to ensure that the extended map `g` satisfies `g x ≤ N x` for all `x` in `E`. Can someone help me implement a function to achieve this extens... | glaive |
I am trying to write a script in Python to remove specific files and directories, but I am having trouble understanding the functions and syntax required to achieve this. Can someone provide me with a clear example of how to use the file() function in Python to remove multiple files and directories recursively? | glaive |
You are tasked with creating a Verilog module that acts as a parameter resolution wrapper for the `stratixv_hssi_tx_pld_pcs_interface` module. The wrapper module, `sv_hssi_tx_pld_pcs_interface_rbc`, takes in several unconstrained parameters and some constrained parameters, and then resolves them based on certain condit... | glaive |
You are tasked with creating a Rust program that defines a struct called "CrosstermWindow" to represent a window in a terminal application. The struct should have the following fields:
- height: an unsigned 16-bit integer representing the height of the window
- width: an unsigned 16-bit integer representing the width o... | glaive |
You are tasked with creating a program that utilizes the OpenCV library to perform image processing on a GPU. Your task is to create a function that takes in two GPU matrices (GpuMat) as input, processes the data using a custom kernel, and then stores the result in the destination matrix. The function signature is as f... | glaive |
You need to write a program that asks the user to input a number, and then prints "Hello" that many times. If the user inputs a non-numeric value, the program should display an error message indicating that the input was not a valid number. | glaive |
You are tasked with creating a custom exception class in Kotlin for a specific error scenario in a web application. The exception should be thrown when there is a failure in the registration process. The exception should accept an optional message parameter, defaulting to "Error in registration, please try again." Your... | glaive |
You are tasked with creating a Python program to generate an emperor plot with a specified number of random data samples. The program should be able to accept a command line argument to change the number of samples. The generated plot should be saved as an HTML file.
Your program should generate N random data samples,... | glaive |
You are tasked with writing a method to generate machine code in a programming language. The method should take in two operands, value, and reg, and generate the appropriate machine code based on certain conditions. If the value is a quick value, the machine code should be generated with a specific format and size. If ... | glaive |
:
You are tasked with implementing a messaging system using the given protocol buffer code snippet as a reference. Create a protocol buffer message definition for a new message type called "CIM_MSG_TYPE_CUSTOM" with the following fields:
- string custom_msg_id (field number 1)
- string custom_msg_content (field number ... | glaive |
You are tasked with implementing a subroutine for integrated frag dipoles for pp->Z+gamma + jet. The subroutine takes in various input parameters and calculates the output matrix elements for the process. Your task is to write a subroutine that can accurately calculate the matrix elements for this process, taking into ... | glaive |
I am working on a project that requires me to link a static library to my code and ensure that the necessary include directories are set. Can someone provide me with the code to accomplish this using CMake and the Threads library? | glaive |
I have come across a challenging task of finding a bug in a massive assembly program consisting of over 10,000 lines. This program involves assembler code for a PIC18 microchip microcontroller. The problem is that the code was written by a former colleague who is no longer available for assistance, and he did not provi... | glaive |
You are tasked with creating a CMake script to find the Foreign Function Interface (FFI) library and include paths. Your script should define the following variables:
- LIBFFI_FOUND: True if FFI library was found
- LIBFFI_INCLUDE_DIRS: FFI headers path
- LIBFFI_LIBRARIES: List of FFI libraries
- LIBFFI_DEFINITIONS: FFI... | glaive |
You are tasked with creating a function that generates a test object for a user-defined group with different variable types. The function should take a group as input and return an object with certain properties. The test object should be created using a specified call, number of folds, stratify option, number of cores... | glaive |
You are tasked with creating a CMake script that searches for system libraries and determines which ones are needed based on the system being used. The script should check for the existence of certain functions and libraries to determine which system libraries need to be included.
Create a CMake script that performs t... | glaive |
You are tasked with creating a class for handling adult charges that extends a base Charge class. The adult charge class should have a method for setting default type eligibility and a method for skipping analysis. The default type eligibility method should return an object with eligibility status and reason, while the... | glaive |
You are tasked with creating a command-line program that lists all files in a given directory. The program should take an optional argument to display hidden files. The output should include the mode, last write time, length, and name of each file.
Your task is to implement the `print_dir` function, which takes a path... | glaive |
You are tasked with creating a program that runs unit tests using the DUnitX framework. Your program should be able to execute tests, log the results to the console window, and generate an NUnit compatible XML file for further analysis. Additionally, the program should handle command-line options, exit gracefully in ca... | glaive |
You are tasked with implementing a program that includes multiple data structures and their transformed versions. You will need to create and manipulate arrays, matrices, vectors, and row vectors in a specific way as outlined in the given code snippet. Your program should also include parameters and transformed paramet... | glaive |
You are tasked with creating a custom password entry buffer in Rust using the GTK library. The password entry buffer should have the following functionality:
1. Allow the user to set a maximum length for the password.
2. Enable the user to set the initial text for the password entry buffer.
3. Implement a builder patt... | glaive |
You are tasked with creating a script that will clone a specific branch of a git repository, create a PostgreSQL database, and then run a series of SQL scripts to populate the database. The script should be written in bash and should handle any errors that may occur during the process. | glaive |
I am trying to run a PHP server using Symfony's console command with specific settings, but I am encountering some issues. I want to start the server at 127.0.0.1 on port 8000 and set the document root to public_html. Can someone provide me with the code to achieve this? | glaive |
How can I create a function in JavaScript that takes two parameters, 'a' and 'b', and returns their sum? | glaive |
I am interested in generating a hierarchical output using NetworkX and matplotlib.pylab to produce a tree structure for a flow diagram. However, I am struggling to achieve the desired tree structure with the layouts NetworkX offers. What options or modes should I use, or do I need to use weights to guarantee a hierarch... | glaive |
I am trying to create a web page with various UI elements, but I am facing some issues with the CSS classes. I want to create different styles for different types of elements, such as buttons, input fields, and links. I also want to be able to apply different background colors to these elements based on certain conditi... | glaive |
You are tasked with creating an Angular component that is responsible for sharing a configuration modal. The component should display an image and a share URL based on the modal variables passed to it. Additionally, the component should have a form to enter a caption, description, and email, and should have validation ... | glaive |
I am trying to fetch an external project using CMake's FetchContent module. I want to fetch the harfbuzz project from its GitHub repository and specify the version to be 2.8.2. After fetching the project, I need to make it available in my CMake project and set the target properties for the harfbuzz and harfbuzz-subset ... | glaive |
You are tasked with implementing a channel buffer object that allows for pushing data with a subset of threads. The buffer should be able to store data sent to an output channel during a single run. The buffer object should have the following features:
- It should be a template class that takes a data type `T` and a co... | glaive |
I need to create a scatterplot and a line plot using SAS. The scatterplot should display the relationship between the variables "horsepower" and "invoice" from the dataset "sashelp.cars". The line plot should also display the relationship between "horsepower" and "invoice" from the same dataset. Additionally, I need to... | glaive |
You have been tasked with writing a function in Zig that calculates the unsigned integer representation of a double-precision floating-point number. The function should take a double-precision floating-point number as input and return the equivalent unsigned integer value.
Write a function with the following signature... | glaive |
Write a JavaScript function that utilizes promises to handle asynchronous operations. The function should create two promises, p1 and p2. Promise p1 should resolve to the value 18, while promise p2 should reject with the value 17. The function should then chain these promises together using the `then` and `catch` metho... | glaive |
You are working on an Android application and you need to define a type alias for a function that takes a View as a parameter and performs some action on it. You want to create a typealias for this function so that it can be easily used in your code. Create a typealias called ViewAction that represents a function that ... | glaive |
You are tasked with creating an annotation in Kotlin that allows classes to be open for mocking purposes in debug builds, even if they are marked as final in release builds. This annotation should be used to mark classes that need to be extendable in debug builds for testing purposes.
Write the code for an annotation ... | glaive |
You are tasked with implementing a function in x86-64 assembly language that flushes interrupt requests (IRQs). The function should take no parameters and should call an external routine named real_routine, passing the binary data from the flush_irqs.bin file to it. You need to write the complete assembly code for the ... | glaive |
How can I use the email module in python to send multipart HTML emails with embedded images? For instance, if the body of the email contains an HTML image tag like `<img src="../path/image.png"></img>`, how can I embed the specified `image.png` into the email, replacing the `src` attribute with `content-id`? | glaive |
You are tasked with creating a Java class that will update a requirement substitution type for a topology. The class should have the following properties:
- A non-empty string field called substitutionRequirementId to store the ID of the requirement to be updated.
- A non-empty string field called newRequirementId to s... | glaive |
You are tasked with implementing a program to test the correctness and speed of a Stena implementation for image processing. The program should be able to generate images and filters with given sizes, and compare the results of the GPU version with the CPU version. Additionally, it should check that the encryption/decr... | glaive |
What are the steps to develop a web application using React? | glaive |
Write a Racket program to create a function that takes a list of colors and creates a visual representation of a rainbow using the colors in the list. The program should use the `slideshow/pict` module and display the rainbow colors in a horizontal layout. Additionally, the program should include images of fish in the ... | glaive |
How can I utilize Tensorflow to accurately classify images of cats and dogs as either cats or dogs? | glaive |
Can you provide an algorithm to optimize a given travel route and minimize the total cost? | glaive |
I am trying to perform role inference for type constructors in Haskell. The role inference algorithm is responsible for inferring the roles on the parameters of type constructors. The roles are stored in the tycons, and we need to perform this algorithm on the built tycons without looking at the roles field of a tycon ... | glaive |
I need to create a GMScript that will handle the editor mode event in my application. This script needs to be compatible with mvc version 1.0 and should not be implemented using drag and drop (DnD). Can someone provide a high-quality GMScript that fulfills these requirements and accurately handles the editor mode event... | glaive |
I need to create a makefile rule to build a static library using the aarch64-xilinx-linux-ar command. The library should be named built-in.a and should include the following object files: kernel/fork.o, kernel/exec_domain.o, kernel/panic.o, kernel/cpu.o, and so on. I want to ensure that all the specified object files a... | glaive |
You are tasked with creating a function that can prepend a given value to the Path environment variable and return the new value in an output variable. The function should be os independent, meaning it should work for both Windows and UNIX operating systems. You need to write a function that takes the output variable n... | glaive |
You are tasked with creating a VCL application in Delphi that uses themes and styles to apply a specific visual appearance to the dialog boxes. The application should initialize, set up memory leak reporting, and create a main form on the taskbar. Additionally, the application should try to set the style to 'Windows10'... | glaive |
You are tasked with implementing a CUDA kernel function for a ROI (Region of Interest) align operation. The input is a 4D tensor representing the output of the last convolutional layer in the Backbone network, in the format of NCHW. The ROIs (regions of interest) to process are given as a 2D tensor where the first dime... | glaive |
How can I design a class that categorizes a given list of items into its subgroups? | glaive |
:
I am trying to enable static analysis for my C++ project using cppcheck, clang-tidy, and include-what-you-use. However, I'm running into some issues with enabling these options based on certain conditions. Specifically, I need to enable cppcheck with certain flags and file exclusions, clang-tidy with specific extra a... | glaive |
You are tasked with creating a program that takes a real number as input and performs a specific mathematical operation on it. The program should prompt the user to enter a real number and then carry out the required calculation. You need to implement a function or method that takes the input as a parameter and returns... | glaive |
You are tasked with creating a Flutter widget that displays a library of data based on a given type. The widget should have the following features:
- It should display a loading indicator when the data is being fetched.
- It should display the library data in a scrollable view with a custom header and sticky view.
- If... | glaive |
You are tasked with implementing a priority queue using the uheapq module in micropython. The priority queue should support the following operations:
1. Adding an element with a given priority
2. Removing the element with the highest priority
3. Checking the element with the highest priority without removing it
Design... | glaive |
Is there a way to improve the performance of my database query by creating an index on a table? | glaive |
You have been tasked with implementing a hardware design for the "seeds" entity using VHDL. The "seeds" entity has input and output ports for signals such as clock, reset, start, next, plain text, key, cipher, message, ready, and three seed outputs. The behavior of the "seeds" entity is determined by a state machine wi... | glaive |
In Python, are classes typically separated into different files, similar to Java or PHP? How should I name these files? Should the filename be in lowercase like classname.py or CamelCase like ClassName.py? Furthermore, is there anything special I need to do to create an object from a class in a different file, or is it... | glaive |
You have been tasked with creating a responsive sidebar navigation menu using HTML and CSS. The sidebar should collapse when viewed on smaller screens and expand when viewed on larger screens. Additionally, you need to implement various styling elements such as error messages, spacing, pagination buttons, status marks,... | glaive |
You are tasked with creating a shell script that takes in two arguments: a directory for a new dataset and a directory for the MNIST dataset. The script should create two new directories within the new dataset directory, one for odd digits and one for even digits. Then, it should create symbolic links to the images of ... | glaive |
You are tasked with implementing a Fortran program that interfaces with the fio interpolation library. The program should include the necessary modules and functions to interact with the library, and it should be able to perform various operations such as opening sources, getting available fields, evaluating fields, ge... | glaive |
You are tasked with creating a program that manages different tech dependencies and default values for various vehicles and weapons in a strategy game. The program should handle the research items, default values for different units, weapon damage and effectiveness, and default values for special buildings. You need to... | glaive |
I have two loans, one with an annual interest rate of 4.5% and the second with a rising annual interest rate starting from 5.5% and increasing by 0.2% every quarter. The total loan amount is $10,000, and the total interest paid over the course of a year is $560. I found this code online that attempts to calculate how m... | glaive |
I need to implement a procedure called estimate-integral in Scheme that will use the Monte Carlo integration method to estimate the value of π by measuring the area of a unit circle. The estimate-integral procedure should take as arguments a predicate P, upper and lower bounds x1, x2, y1, and y2 for the rectangle, and ... | glaive |
You are tasked with creating a macro in CMake called "add_test" that takes in a variable number of arguments and performs the following tasks:
1. Calls a private function "_add_test" with the passed arguments
2. Emits an event named "add_test" with the passed arguments
3. Emits an event named "on_target_added" with the... | glaive |
I am trying to create a program that can search a query string in an array of strings. Can someone help me with this? | glaive |
I am working on a project that requires performing warp-synchronous reduction on a GPU. I need to perform concurrent, independent warp-reductions if storage pointers and their local-thread indexing id's are set up properly. I am looking for a way to implement a warp-synchronous reduction procedure that can handle this ... | glaive |
You are tasked with creating a program to solve the Circuit Satisfiability problem. In this problem, you are given a Boolean circuit with AND, OR, and NOT gates, and your task is to determine if there exists an assignment of true or false values to the input variables that makes the entire circuit evaluate to true.
Y... | glaive |
You are tasked with implementing a program to find the maximum value of a given mathematical function over a specified range of variables. The function is defined as follows:
\[f(x, y) = \text{Exp}[-14i y] \times \left[ \text{terms} \right]\]
Where the terms are long algebraic expressions involving trigonometric func... | glaive |
You are tasked with creating a monitoring solution for SIP usage using SNMP. The solution should allow for checking the status of SIP usage, as well as monitoring inbound and outbound session rates, average latency, and the Answer-to-Seizure Ratio (ASR).
You need to implement a plugin that can connect to the SNMP serv... | glaive |
I am trying to run a simulation for a testbench in my Verilog project, but I am encountering some issues. The simulation command I am using is "vsim +define+SIMULATION -t ps -novopt work.testbench_top -l $TEST_NAME\_run.log +TESTNAME=$TEST_NAME". However, when I run this command, it does not execute as expected and I a... | glaive |
You are tasked with creating a CMake file to find and include the "fmt" package in your project. The "fmt" package is required and the configuration must be found. You need to report the dependencies, definitions, includes, libraries, and runtimes for the "fmt" package. Write a CMake file that accomplishes these tasks. | glaive |
How can I write a MongoDB query to select documents where the value of the field "age" falls between 18 and 25? | glaive |
You are tasked with creating a converter for V4 metadata using the `sap.ui.model.odata.v4.lib._V4MetadataConverter` class. The converter should be able to process various elements and attributes within the V4 metadata.
Write a program that creates a converter for V4 metadata, with the following requirements:
- The pro... | glaive |
You are required to implement a CUDA kernel that compares the results of two matrix multiplications using different libraries. The goal is to identify any discrepancies between the results and ensure that the maximum difference between corresponding elements of the matrices is within a certain threshold.
You will need... | glaive |
You are tasked with developing a CMake script to handle the implicit dependencies for a project. The project involves multiple C language files, each with its corresponding object file, and you need to set up the include file search paths and target link information. Additionally, you need to specify the compiler ID an... | glaive |
I followed a guide that explains how to use the puma.rb file in my Rails app's config directory. The guide suggests that I can specify the port, pid, session, and other parameters in the puma.rb file instead of using long commands like "bundle exec puma -e production -b unix:///var/run/my_app.sock". However, when I tri... | glaive |
You are tasked with creating a temporary storage layout in C++ that represents a structure with a union-like field for a given number of slots. Each slot can contain multiple fields of different types, and you need to ensure that the temporary storage layout can be mapped to a temporary buffer for later use.
Your task... | glaive |
You are tasked with implementing a Xamarin.Forms application that retrieves weather data from an API based on the user's input. The application should have a text entry field where the user can input the city name, and a button to trigger the weather data retrieval. Upon clicking the button, the application should make... | glaive |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.