instruction_seed stringlengths 29 40.5k | source stringclasses 6
values |
|---|---|
How can I convert an array of integers into a comma separated list in JavaScript? | glaive |
You are tasked with creating a responsive web layout using HTML and CSS. The layout should consist of four columns, each with a unique background color. The first column should have a width of 19.7% and a height equal to 70% of the viewport height. The remaining three columns should fill up the remaining space equally.... | glaive |
I am looking for a cross-platform tool that can apply a collection of patches to a specific directory. I want to be able to run this tool in the source directory of my project. The tool should be able to find and use the 'git' tool for patching, and it should clean the target directory before applying the patches. Addi... | glaive |
I have a Hibernate query that is generated dynamically using the criteria API. However, the queries are extremely slow when executed as-is. I have noticed that if I prepend /*+ FIRST_ROWS(10) */ to the query, it runs about 1000% faster. How can I achieve this using the criteria API? I have tried using criteria.setComme... | glaive |
How can an AI program be created to help students revise Biology concepts by presenting interactive multiple-choice questions? | glaive |
I am working on a web application using the Vaadin-on-Kotlin framework and need to create a servlet to provide access to REST services using the Javalin library. I want to configure the REST services to use GSON for JSON serialization, and I also need to register a custom type adapter for serializing LocalDate objects ... | glaive |
You are tasked with implementing a verification system for a specific type in a programming language. The verification system should include the ability to verify a function reference and a module reference. The verification process should be implemented using the LlvmM monad for handling LLVM IR.
Write a program that... | glaive |
What is the SQL query to retrieve the name of the employee who has the highest salary? | glaive |
You are tasked with creating a web-based portlet that displays a list of items and allows users to edit or delete them. The portlet should include a search feature to filter the displayed items based on user input. The portlet will be developed using the Java Portlet API (JSR 286) and JSP.
Your task is to write the ne... | glaive |
I am trying to manipulate the orientation of a molecule in my program using the Orient package in the Orient namespace. I have already selected the molecule using the "atomselect" command and drawn its principal axes using the "draw principalaxes" command. Now, I want to orient the molecule based on these principal axe... | glaive |
You are tasked with creating a supervisor module in Erlang that will start and manage multiple child processes. The supervisor module should be able to start and manage worker and supervisor child processes, with different restart and shutdown strategies for each.
Your task is to write the Erlang code to implement the... | glaive |
I am working on a project where I need to delete specific data from a database using SPARQL. I have a dataset where each page has a version and a URL, and I need to delete the URL for the latest version of each page. Can someone provide a SPARQL query that can accomplish this task? | glaive |
You are working on a project that involves multivariate polynomials and need to implement a function to evaluate these polynomials. The goal is to create a function that takes a multivariate polynomial and evaluates it for a given set of variable assignments. The function should also be able to determine if the polynom... | glaive |
I'm following Michael Hartl's Rails Tutorial and I'm having an issue with the code provided. I have a link_to method with the :method option set to :delete, but it's still issuing a GET request instead. I've checked that the javascript_include_tag is present in my application view. I noticed that the method defined in ... | glaive |
Our iPhone app sends invoice data multiple times a day, but when there is low cell signal, we sometimes receive duplicate tickets. Each ticket is assigned a unique 'job id' in the mysql database. I want to filter out these near-duplicate rows in my query while still including the job id for each ticket. How can I achie... | glaive |
You are working on a web application that displays statistics for different types of pages on your website. You need to write a SQL query to retrieve the current date and the number of pages in a specific namespace that have a title ending with a certain type.
Write a SQL query to retrieve the current date as "day" an... | glaive |
You are tasked with writing a script that prepares the environment variables and then executes a user command. The script is required to create a scratch directory, run the user command in the scratch directory, and then copy any output files to a specified location. The script should also handle any potential errors d... | glaive |
I need to create a program that generates a unique signature for a given input using the MD5 hashing algorithm. The program should take a string input and return the MD5 hash value as a hexadecimal string. It should also include a timestamp for when the signature was created.
Can someone provide a complete implementat... | glaive |
You are tasked with implementing a function that provides semantic classifications for a given input in F# programming language. The function should take in a range, formatSpecifierLocations, and an optional range and return an array of tuples containing a range and a SemanticClassificationType. The function should han... | glaive |
I want to write a JavaScript function that counts the number of times a specific character appears in a given string. Can someone help me with this? | glaive |
You are tasked with implementing an interface for a Core module in a RISC-V CPU system. The interface contains various components, including CPU reset server, AXI4 Fabric interfaces, coherent DMA port, external interrupt sources, non-maskable interrupt request, optional PC Trace output, optional Tandem Verifier interfa... | glaive |
You are tasked with creating a web application for managing instances of a specific type of application. The application is written in Java and utilizes JSP along with some custom JavaScript code and jQuery for making AJAX requests.
Your task is to implement the functionality to start, shutdown, and perform various op... | glaive |
I am working on a smart contract using Solidity and I want to implement a function that can only be called by the owner of the contract. Can someone help me write a function that allows only the owner to call it? I want to ensure that this function cannot be called by anyone else except the contract owner. | glaive |
I am trying to write a program in assembly language using the given framework and technology. However, I am encountering difficulties and need help with implementing the NESTED_ENTRY and LEAF_ENTRY macros in my code. Can someone provide a clear example of how to use these macros to define entry points and basic blocks ... | glaive |
You are tasked with creating a Dockerfile to set up a development environment for a Go project. The Dockerfile should use the Fedora 28 build variant base image and install Go version 1.14.6. Additionally, it should run a test script for the Go project and set up the necessary environment variables.
Write a Dockerfile... | glaive |
You are tasked with creating a Go program that reads metrics exposed by Beat and gathers specific statistics from it. The program should be able to make HTTP requests to a specified URL, parse the JSON response, and extract the desired metrics. The metrics to be collected are defined in the `include` configuration opti... | glaive |
You are tasked with building a random geometry graph (RGG) using the given specifications and parameters. The RGG should be constructed based on the input nodes, with the option to associate per edge weight values. The graph should be undirected and constructed based on a specified threshold. The goal is to implement t... | glaive |
How can I concatenate numpy arrays which are elements of a list? I have a list containing numpy arrays like L=[a,b,c] where a, b and c are numpy arrays with sizes N_a in T, N_b in T and N_c in T. I need to row-wise concatenate a, b and c and get a numpy array with shape (N_a+N_b+N_c, T). I can use a for loop and numpy.... | glaive |
I am trying to configure my C++ project to use static linking for iOS and set the library suffix for linking. Additionally, I need to use rpath for dynamic linking on Unix-based systems and set specific Boost components based on the build type. I also need to set the C++ standard options, define C/C++ macros, and handl... | glaive |
I am working on a project that requires using the nauty_jll library for armv7l-linux-musleabihf. I need to generate an autogenerated wrapper script for the nauty_jll library and declare and initialize various executable and library products. Can someone guide me on how to do this using the GMP_jll wrapper and provide a... | glaive |
You are tasked with creating a Node.js module that exports a component named "Puzzle" with the following properties:
- Package: 'i8'
- Name: 'Puzzle'
- Data: A size property with a default value of 50
- Template: A template function that renders an image with the specified size using an SVG image encoded in base64 form... | glaive |
Is there a way to set the immutable attribute for a file in Go? I need a function that can toggle this attribute on a file, similar to the command "chattr +i file". I came across the "IoctlSetInt" function in the "golang.org/x/sys/unix" package. Can someone guide me on how to use it?
```go
file, err := os.Open("file")... | glaive |
You are tasked with creating a script that checks for the existence of a specific file and then executes a command based on whether the file exists or not. The script should first check if a file named "node.exe" exists in the current directory. If it does, the script should run the "stylelint.js" file using the "node.... | glaive |
You are tasked with creating a function in Fortran that will find the index of the element with the minimum value in an array. The function should take in three parameters: n (the number of elements in the array), dx (the array of real numbers), and incx (the increment for the array). The function should return the ind... | glaive |
You are tasked with creating a simple web server using Golang that responds to HTTP requests on port 8080. The server should have a single endpoint "/hello" that returns a JSON response with the message "Hello, World!" when accessed via a web browser or curl command. | glaive |
I am trying to create a module in Scheme that extends the functionality of vectors. However, I am not sure how to properly define the module and use it in my code. Can someone provide a clear example of how to define a module in Scheme that extends the functionality of vectors and demonstrate how to use it in a program... | glaive |
You are tasked with creating a protocol buffer message structure for a client-server communication system. The client will send messages to the server, and the server will respond with messages of its own. Each message type has a unique ID, and each message may have different fields depending on its purpose. Your task ... | glaive |
You are tasked with creating a progress button with spinner animation using HTML, CSS, and possibly JavaScript. The progress button should have a spinner animation that activates when the button is clicked, and the button should be disabled during the animation. The spinner should rotate 360 degrees and then stop when ... | glaive |
You are tasked with creating a function that executes a Maven command in a specified directory and stores the result and output in the given destination variables. The function should take in the source directory, destination output variable, and destination result variable as parameters. The Maven command to be execut... | glaive |
Can you provide a script in Ruby to encrypt a given message? | glaive |
You are tasked with implementing a program that uses the C language to define a set of compiler flags and object files for a specific microcontroller. The program should include the necessary header files and define the stack size for a fiber. | glaive |
You are tasked with creating a program that can parse and extract information from a given set of bibliographic entries. Each entry is in the BibTeX format and contains details about a publication such as title, author, booktitle, month, year, address, publisher, url, doi, and pages. Your program should be able to extr... | glaive |
I need to create a middleware function in Clojure that checks if a user's Spotify token needs to be refreshed. The function should take the user's token expiration time and, if it has expired or is within five minutes of expiring, call the refresh token function. If the refresh is successful, it should continue process... | glaive |
I need to create a script that checks for the existence of a specific file and executes a command based on the result. If the file "node.exe" exists in the current directory, the script should run the command "node.exe" with the path to the "semver" script as an argument. If "node.exe" does not exist, the script should... | glaive |
You are working on a text-based narrative engine for a game, and you need to implement a function to pre-parse all the content and find any errors to display. The content is stored in different modules and needs to be combined into one dictionary. You also need to handle specific rules for certain content that should n... | glaive |
How can I generate a list of distinct values from an array of integers in Python? | glaive |
Can you help me modify this Python function to find the first index of a specific keyword within a given string? | glaive |
How can I create an input field in HTML that accepts phone numbers and ensures that the input data matches a specific phone number format? | glaive |
You are tasked with implementing a function in Erlang that can perform Key Value Coding style "queries" for commonly used data structures. The function should be able to handle various data types such as proplists, structs, dictionaries, trees, and maps. The query function should be able to return the result of the que... | glaive |
You are tasked with creating a Clojure project with the following specifications:
- Project name: codingame
- Version: 0.1.0-SNAPSHOT
- Description: "FIXME: write description"
- URL: "http://example.com/FIXME"
- License: Eclipse Public License, with the URL "http://www.eclipse.org/legal/epl-v10.html"
- Dependencies: On... | glaive |
You are tasked with creating a macro in Rust that implements the multiplication trait for a custom data type called "Amount" with the following signature:
```rust
struct Amount {
value: u64
}
```
Your macro should generate implementations for the multiplication trait (`Mul`) for the primitive integer types `u8`, ... | glaive |
You are tasked with creating a program that can parse and display a list of skills from a JSON array. The program should be able to take in a JSON array of skill lists and then render each skill list using a partial template. The partial template should be named "skill_list" and should be accessed via the variable "ski... | glaive |
You are working on a project that requires implementing a custom data structure called Listag. The Listag class needs to have several methods and properties to manage a collection of nodes. Each node will have an identifier, cargo, and tags associated with it. The cargo can be of any type, and the tags are strings that... | glaive |
You are tasked with implementing the Quark-BMW512 hashing algorithm using CUDA in C/C++. The Quark-BMW512 algorithm involves a series of bitwise operations and rotations on an input message to generate a 512-bit hash. The algorithm also includes specific constant values and memory manipulation.
Your task is to write a... | glaive |
Is there a way to generate a Machine Learning model that can predict the price of a car based on its age and mileage? | glaive |
You are tasked with creating a unique ID generator class in the ElectronFlex namespace. The ID generator should have a method that returns the next available ID as a byte. The IDs should start from 0 and increment by 1 with each call to the method. Once the maximum value for a byte is reached (255), the generator shoul... | glaive |
I need help creating a JavaScript function that rearranges the elements of an array so that a specific element becomes the first element. Can you provide a solution for this? | glaive |
You are tasked with implementing a GPU-accelerated image filtering function in Julia using OpenCL. The function should take in an image array and a kernel array as input and apply the filter to the image using GPU parallel processing. The kernel may require padding, and the function should be able to handle this. Addit... | glaive |
You are tasked with creating a PowerShell script to retrieve connection information using the `Get-FSConnection` cmdlet. The script should utilize an API key and a base URI to make the request and retrieve the content of the response.
Create a PowerShell script that:
1. Assigns the API key to a variable named `$ApiKey... | glaive |
I need to create a program in Stan that models the relationship between two variables, Y and X, taking into account measurement errors in the data. The data includes the measured values of Y and X, as well as the standard deviations of these measurements. Additionally, there is a grouping variable, scale_group, that in... | glaive |
I am trying to create a blogging application in Common Lisp using the Hunchentoot and Elephant libraries. I want to define a package called ":blog" that uses the ":cl", ":hunchentoot", and ":elephant" packages, and exports the functions "start-blog" and "stop-blog". However, I am having trouble with shadowing imports f... | glaive |
I am working on a project using Emacs and I want to create a command that allows me to jump to a file in the current project. I want to be able to invalidate the cache with a prefix argument and use completion based on context if DWIM is non-nil. Can someone help me create a function that accomplishes this? | glaive |
You are working on a PowerShell script to retrieve mining algorithm information from a specific pool and configure mining settings based on the retrieved data. You need to create a function that takes in the following parameters:
- $Auto_Algo: A boolean value indicating whether the algorithm selection should be automat... | glaive |
I am trying to implement a DSL for logic and proofs in Haskell, and I need to create a function that pushes negation through logical constructors. Specifically, I need to implement a function that takes a logical term and returns its negation. The logical terms can include And, Or, Implies, Not, False, True, and named ... | glaive |
How can I pass a Python list into a function that expects multiple arguments? For example, when I try passing a list like `my_list = ['red', 'blue', 'orange']` into a function `function_that_needs_strings('red', 'blue', 'orange')`, it works. However, it breaks when I try `function_that_needs_strings(my_list)`. Is there... | glaive |
I am trying to create a form in my web application using Laravel, but I am encountering an issue. I want to create a form for adding data, but when I submit the form, it does not work as expected. The form is not being submitted and I am not getting any success or error messages. Can someone help me identify the issue ... | glaive |
You are tasked with creating a program that simulates a zoo, specifically focusing on the behavior of ducks. The program should include a struct called Duck, which has an optional string attribute called quack. Your task is to write a function that takes in a Duck object and prints out the sound it makes, if the quack ... | glaive |
You are tasked with implementing a protocol in Swift that allows for automatic multi-selection in a tree data structure. The protocol should have a method or property that takes a boolean value and sets the auto-multi-selection feature accordingly. The tree data structure should then be able to use this protocol to ena... | glaive |
I have a programming challenge called "The Duel of the Drinks" and I need help solving it. Here's the situation: We have two types of drinks, X and Y, and initially, we have `M` ml of each drink. We can take three different actions:
1. Serve 120 ml of drink X and 0 ml of drink Y.
2. Serve 60 ml of drink X and 60 ml o... | glaive |
You are tasked with creating a function in a programming language that performs a bitwise inclusive OR operation on two integers. The function should take two integer parameters and return the result of performing the bitwise inclusive OR operation on the two integers. You should also create separate functions for perf... | glaive |
I am trying to create a client-server communication system in Scheme using the SRFI 106 library. I need to implement a function to create a client socket and a function to create a server socket. The client socket function should take in a node (hostname or IP address) and a service (port number) as mandatory parameter... | glaive |
You are tasked with creating a database schema for managing clusters and their configurations for a cloud infrastructure platform. The schema should include tables for clusters, cluster configurations, operations, Kyma release, and Kyma configuration.
You need to create the following tables:
1. Cluster:
- id (uui... | glaive |
You are tasked with creating a Perl script that decorates /proc/net/arp entries with DNS names. The script should take one or more files as input, or read from stdin if no files are specified. The input files contain ARP (Address Resolution Protocol) entries in the format "IP address HW type Flags HW ad... | glaive |
How can I install PyQt4 in Anaconda? I have two versions of Python on my system, one is the regular version, and the other is within Anaconda. I found instructions on the PyQt4 website which suggested downloading the tarball and using the config file, but I am unsure how to install it within Anaconda. Is there a specif... | glaive |
What is the difference in performance between Algorithm A and Algorithm B for the same task? | glaive |
I need to create a module in Elixir that acts as a Code Freezer registry. The module should allow me to register and use modules that can be frozen. When a module is frozen, the frozen version should still be available for internal use.
I need to implement the following functionalities in the module:
1. A function `em... | glaive |
You are tasked with creating a JavaScript function that takes a phone number as input and searches for the corresponding contact in a given contact list. If the number is found, the function should return the contact information; if not found, it should return null. The function should be able to handle both short and ... | glaive |
I am working on a codefix module in my F# project where I need to implement a function that walks forward until a specific condition is met in a given source text. The function should take the source text, a starting position, a position change function, a terminal condition, and a check condition as input and should r... | glaive |
:
You are tasked with implementing a processor system information memory (SYSINFO) for a NEORV32 processor. The SYSINFO memory should provide information regarding the NEORV32 processor system configuration, derived from the top's configuration generics. The provided code snippet shows the entity and architecture for t... | glaive |
I need to create a rule in a web application firewall using the F5 iRules scripting language. The rule should be triggered when an HTTP request is made, and it should check for the presence of a specific cookie called "testcookie". Depending on the value of the cookie, the rule should route the request to different bac... | glaive |
You need to create a program that generates a bubble chart with transparency using CUDA and OpenGL. The program should use the ArrayFire library to create a window and a chart with specified dimensions. It should then use CUDA to generate data for two different functions (cosine and tangent) and their respective colors... | glaive |
You are tasked with implementing a data sink in the cpp impala namespace, using the given code snippet as a reference. The data sink should forward data to a remote plan fragment based on the output partition specification. The sink should support both data stream and table sinks, and should be able to create new Hdfs ... | glaive |
Can you provide an algorithm that can find the smallest missing number in an array of integers? | glaive |
You are tasked with implementing a Thrift service interface for an EchoService. The service should have a method called "echo" which takes an input DTO (TEchoServiceInputDTO) containing a message and returns an output DTO (TEchoServiceOutputDTO) with the echoed message. Additionally, the service should handle two types... | glaive |
You are tasked with creating a SAS program to manipulate a dataset called "persone". Your goal is to create a new dataset called "nomipersone" that only includes the variables "nome" and "cognome". Write the SAS code to achieve this transformation. | glaive |
I am working on a Node.js project and need to create a new model for a Category using Sequelize. I want to define a Category model with the following requirements:
- The model should have an "id" column of type INTEGER, which is the primary key and auto-increments.
- The model should have a "category_name" column of ty... | glaive |
I have the following code which works perfectly:
```assembly
procedure ShuffleAry16(var Ary16: TByteAry; MaskLow, MaskHigh: Int64); cdecl; assembler;
asm
movdqu xmm0, [rcx] // unaligned load Ary16
movq xmm1, rdx
pinsrq xmm1, r8, 1
pshufb xmm0, xmm1
movdqu qword... | glaive |
You are tasked with creating a web application that needs to handle various HTTP routes based on regex patterns. Your task is to write a function that matches the incoming request URL with a given regex pattern and returns the appropriate response based on the match. The function should handle scenarios where the regex... | glaive |
I'm trying to test the settings in my .spacemacs file for correctness. I want to ensure that all the configurations and variables are correctly defined and adhere to the expected format. I need a way to run tests on my .spacemacs file to check if everything is set up properly. | glaive |
You are working on a web application using the Laravel framework and need to add a new column to the projects table in the database. The new column should store the user ID associated with each project.
Write a migration file to add the 'user_id' column to the 'projects' table using the Laravel migration schema. The ... | glaive |
You are tasked with creating a Dockerfile for a new project that requires the use of OpenJDK v7-jre. Your Dockerfile should include the necessary commands to install the OpenJDK v7-jre and set the JAVA_HOME environment variable to the appropriate path. Additionally, you need to ensure that the PATH environment variable... | glaive |
You are tasked with implementing a function to parse a given HTTP request and extract relevant information from it. The function should be able to handle different types of requests, such as GET, POST, and multipart form data. The parsed information should include the request method, URI, headers, protocol, host, and b... | glaive |
You have been tasked with creating a Ruby Gem for a new project called "inventory_sync". The Gem should provide functionality for synchronizing inventory held at an external facility with Spree. You need to define a Gem specification that includes the platform, name, version, summary, description, required Ruby version... | glaive |
You are tasked with creating a Dockerfile to build a Docker image that includes the FFmpeg multimedia framework along with various other multimedia libraries and codecs. The Dockerfile should handle the installation and configuration of FFmpeg and its dependencies, as well as ensure that the resulting image is as small... | glaive |
I am working on a project and need to write a script to remove specific files from a directory in my C++ project. I want to remove the "digest_test.cc.o", "digest_test.pdb", and "digest_test" files. Can someone provide a code snippet or a script that I can use to accomplish this task in C++? | glaive |
I am working on a shader program in OpenGL with version 3.30, and I am trying to manipulate the color of fragments in my fragment shader. However, I am facing issues with the color calculation part of the shader. I need to write a fragment shader that takes in a texture sample and modifies the color of each fragment ba... | glaive |
You are tasked with creating a Perl module that generates time zone data for America/Phoenix. The module needs to be able to handle multiple time spans, including the start and end times for both UTC and local time, as well as the corresponding offset and time zone abbreviation. Your task is to implement the necessary ... | glaive |
I am working on building a tableau method for a logical framework, and I need to implement a function that can determine if a given set of formulas leads to a contradiction. The function should take a list of formulas as input and return whether or not there is a contradiction within the given set of formulas. The cont... | glaive |
You are working on a multi-threaded application in a programming language that supports macros and exceptions. You need to implement a macro called `recv` that allows for receiving messages from a thread's mailbox with various clauses for handling different message types. The `recv` macro should also support a timeout ... | glaive |
You are tasked with creating an XSLT stylesheet to transform XML data into a specific format. The XSLT stylesheet should include the following parameters:
- siteHref: representing the URL of the website
- docHref: representing the URL of the documentation page
- siteLinkText: representing the text for the website link... | glaive |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.