instruction_seed stringlengths 17 40.5k | source stringclasses 10
values |
|---|---|
I need to construct a query to retrieve information about organizations that have assigned awards to individuals. The query should return the organization, the property, and the object related to the organization. The organization should be of type foaf:Organization and the award should be of type core:AwardReceipt. Ca... | glaive |
3 houses are available in a new flat . 3 persons apply for the houses . each applies for 1 house without consulting others . the probability that all the 3 apply for the same house is ? | tiger_math |
You are tasked with creating a Kotlin component that initializes a Retrofit instance and a SharePreference object in an Android application. The component should have a function that takes in a Context and a RetrofitConfig as parameters and initializes the Retrofit instance and SharePreference object. The RetrofitConfi... | glaive |
Given an array of n loan accounts with varying annual interest rates. If the total loan amount borrowed is p dollars, and the total interest paid in one year is q dollars, design a program that will calculate and display the distribution of the amount borrowed from each loan account. The program should handle variable ... | codefeedback |
Please focus on the algorithm of this problem and provide code in ANSI C:
You are given a string array `features` where `features[i]` is a single word that represents the name of a feature of the latest product you are working on. You have made a survey where users have reported which features they like. You are given ... | dolphin |
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 |
The mathematical construct known as the Torian, represented as \$x!x\$, for any non-negative integer \$x\$, can be defined recursively with the following relationships:
$$
x!0 = x \\
x!n = \prod^x_{i=1} i!(n-1) = 1!(n-1) \times 2!(n-1) \times \cdots \times x!(n-1)
$$
In essence, the Torian value corresponds to \$x!x\$ ... | evolcodegolf |
You are tasked with implementing a custom exception class for handling errors in a GraphQL server. The exception class should be designed to provide detailed information about the error, including the GraphQL query, the specific field causing the error, and the error message.
Your task is to create a custom exception ... | magicoder |
Find the number of real values of $k$ such that the equation $\left|\frac{k}{1+i}\right| = 2$ has a solution. | nvidia_math |
You are tasked with creating a shader that combines three different textures based on a control map and applies normal maps to each texture. The shader should use the provided properties and input structure to apply the textures and normal maps to the surface output.
Create a shader that takes in three textures (_Spla... | glaive |
Given a BF program consisting solely of the characters +-[]<>., which possesses the characteristic that there's an equal number of < and > between every matching pair of [], you are required to determine the shortest program that can be achieved with the optimal memory layout (by rearranging the cells on the tape), whi... | evolcodegolf |
Please explain the following problem in detail and provide code in Haskell:
Given an integer array `nums`, you need to find one **continuous subarray** that if you only sort this subarray in ascending order, then the whole array will be sorted in ascending order.
Return _the shortest such subarray and output its lengt... | dolphin |
You are tasked with implementing a testing function for a `PendingStreamWritesManager` class, which manages pending write operations on a stream. The function should assert various conditions to ensure the correctness of the write operations and the resulting promise states.
The function takes the following parameters... | codefeedback |
Task Description
Elias omega coding serves as a universal encoding method capable of transforming positive integers of any magnitude into a continuous bitstream. The procedure for decoding a provided bitstream, denoted as \$S\$, is outlined as follows:
Commence by determining if \$S\$ is devoid of content, in which ... | evolcodegolf |
Find the analytic continuation of the function f(z) = sqrt(z-1) from z=1 to z=4. | tiger_lab_math |
How can I convert a datetime string to the ISO 8601 format using Python? | sharegpt |
Find the sum of three consecutive odd numbers if the middle number is 2n + 1. | tiger_math |
In triangle $DEF,$ we have $\angle E = 2\angle D,$ and the altitude from $F$ to side $DE$ has a length of 12. If $d = 24,$ what is the length of the median from $F$ to side $DE$? | nvidia_math |
A person was asked to subtract 25% of a number from the original but he subtracted 25 from the number. His answer was 25 more than correct one. What was the original number?
Answer Choices: (A) 160 (B) 170 (C) 180 (D) 200 (E) 220 | tiger_lab_math |
You are tasked with implementing a simplified version of an event-driven order processing system. The system consists of an `Instance` class, which represents a specific instance of order processing, and various event classes that can be processed by the `Instance` to update its data.
The `Instance` class has the foll... | magicoder |
You are tasked with creating a Python program that processes a given GitHub repository's README file and extracts information about the repository's name, owner, and the number of stars it has received. The README file is assumed to follow a specific format, as shown in the code snippet below:
```markdown
<gh_stars>0
... | magicoder |
Devise a personally tailored function of a determined length that operates specifically with alphanumeric sequences known as strings. | codefeedback |
Ana has to drive 18 miles to the airport to catch her flight, and she has 30 minutes before check-in closes. How fast does she need to drive in miles per hour to arrive on time? | nvidia_math |
How can I write a Python function that receives an array as an argument and returns only the distinct elements from the array? | glaive |
Can you provide a code snippet that removes the last 5 elements from an array? | sharegpt |
You are given a Python code snippet that prompts the user to input a sentence. The code then aims to determine the ordinal numbers of the first pair of adjacent identical characters in the input sentence. If no such pair exists, a corresponding message is printed. Your task is to write a Python function that achieves t... | codefeedback |
What is a way to classify words as nouns, verbs, adjectives, or adverbs using programming? | sharegpt |
Devise a segment of executable code that functions across a minimum of three distinct programming languages. The output should yield the integer 1 in the first selected language, 2 in the second, and 3 in the third, and so forth.
Parameters:
The output must strictly consist of the integer itself, with allowances for ... | evolcodegolf |
What is the probability that a college student, who has a 1 in 3.8 chance of winning on each scratch-off ticket, will lose all four of their $2 scratchers? | automath |
translate this code from C# to Perl:
```csharp
public int MaxDistance(int[][] arrays) {
int maxDist = 0;
int minVal = arrays[0][0];
int maxVal = arrays[0][arrays[0].Length - 1];
for (int i = 1; i < arrays.Length; i++) {
maxDist = Math.Max(maxDist, Math.Max(Math.Abs(arrays[i][arrays[i].Lengt... | dolphin |
Consider the following two statements: Statement 1: If G is a group and H is a subgroup of G, then the order of H divides the order of G. Statement 2: If a, b are elements in a group G and the order of a is 5 and the order of b is 7, then the order of ab is 35. Answer Choices: (A) True, True (B) False, False (C) Tru... | tiger_lab_math |
Tricia is a third of Amilia’s age and Amilia is a quarter of Yorick’s age. Yorick is twice Eugene’s age and Khloe is a third of Eugene’s age. Rupert is 10 years older than Khloe but 2 years younger than Vincent who is 22 years old. How old, in years, is Tricia? | tiger_lab_math |
Four-In-A-Row AI Tournament with Enhanced Constraints
Today, we will be engaging in an exhilarating Four-In-A-Row tournament. However, rather than a contest between humans, we will witness a fierce battle among our computer programs! This challenge is strictly to be executed in C#.
Rules
Basic Game Rules
If you... | evolcodegolf |
At time $t=0,$ a ball is thrown downward at 24 feet per second from a height of 160 feet above the ground. The equation $h = -16t^2 - 24t +160$ describes the height (in feet) of the ball. In how many seconds will the ball hit the ground? Express your answer as a decimal. | nvidia_math |
Lindsey owns 4 more cars than Cathy. Susan owns 2 fewer cars than Carol. Carol owns twice as many cars as Cathy. Erica owns 25% more cars than Lindsey. Jack owns half the number of cars that Susan and Carol have combined. Additionally, Kevin has 10% fewer cars than the total owned by Lindsey and Cathy. If Cathy owns 5 ... | tiger_math |
A quantity surveyor is figuring the construction costs for a couple that wishes to build a house. The costs are as follows: land costs $50 per square meter, bricks cost $100 per 1000 bricks and roof tiles cost $10 per roof tile. If the house they wish to build requires 2000 square meters, 10000 bricks, and 500 roof til... | tiger_math |
You are tasked with implementing a Python class that represents a fan controller for a smart home system. The fan controller should support different modes such as "low", "medium", "high", and "auto". Additionally, the class should provide methods to set the fan mode, get the current fan mode, and retrieve a string rep... | magicoder |
You are tasked with creating a Portfolio class in a Node.js environment. The class should have a constructor that takes an 'app' parameter and initializes a 'detail' element using the app. It should also add thumbnails to the DOM and initialize them when the app is ready. Additionally, the class should have methods to ... | glaive |
Jack has $43 in his piggy bank. He also gets an allowance of $10 a week. If Jack puts half of his allowance into his piggy bank every week, after 8 weeks how much will Jack have in his piggy bank? | tiger_lab_math |
Let $g : \mathbb{C} \to \mathbb{C} $ be defined by $ g(z) = z^3 - 2iz + 3 $. Find all complex numbers $z $ such that $ \text{Re}(z) < 0 $ and both the real and the imaginary parts of $g(z)$ are rational numbers with denominators at most $5$. | nvidia_math |
Create a program that prints the first 20 Fibonacci numbers, but with a twist. Implement the Fibonacci sequence using a recursive function. | codefeedback |
A password consists of 3 letters followed by 3 digits. The letters can be any of the 26 letters in the alphabet, but no letter can be repeated. The digits can be any of the 10 digits from 0 to 9, but the first digit cannot be 0. How many different passwords are possible if the letters and digits are chosen independentl... | nvidia_math |
If $x = 12$, $y = 15$, and $z = 3$, evaluate the expression $[x+(y+z)]-[(x+y)+z]$. | tiger_math |
You are tasked with creating an install script for a specific directory using CMake. The script should set the install prefix, install configuration name, component getting installed, and whether to install shared libraries without execute permission. You need to write a script that performs these tasks using CMake com... | glaive |
Please explain the reasoning behind the following solution and provide code in F#:
Given two positive integers `a` and `b`, return _the number of **common** factors of_ `a` _and_ `b`.
An integer `x` is a **common factor** of `a` and `b` if `x` divides both `a` and `b`.
**Example 1:**
**Input:** a = 12, b = 6
**Outpu... | dolphin |
How can I stop Python's urllib or urllib2 from following a redirect? I am trying to log into a website using Python, but the site appears to be sending a cookie and a redirect statement on the same page. Python seems to be following that redirect which prevents me from reading the cookie sent by the login page. | sharegpt |
You are tasked with implementing a class for controlling the velocity of a vehicle. The class should have an initializer method that accepts several parameters and initializes corresponding attributes. The parameters include `sigma` (default value 0.0), `v_des` (default value 0.0), `a_max` (default value 1.0), and `k_p... | magicoder |
Introduction
Craft a compact solver for the intricate Hitori puzzles while minimizing byte usage.
Challenge
Your task is to design a highly efficient solver for the Hitori (ひとり, signifying "alone" in Japanese; reflecting the game's essence of solitude) logical puzzles. The rules are delineated below:
You are pre... | evolcodegolf |
Please explain the following problem in detail and provide code in Scala:
There are `n` people standing in a queue, and they numbered from `0` to `n - 1` in **left to right** order. You are given an array `heights` of **distinct** integers where `heights[i]` represents the height of the `ith` person.
A person can **se... | dolphin |
A motel bills its customers by charging a flat fee for the first night and then adding on a fixed amount for every night thereafter. If it costs George $\$155$ to stay in the motel for 3 nights and Noah $\$290$ to stay in the motel for 6 nights, how much is the flat fee for the first night? | nvidia_math |
You are tasked with implementing an n-bit up/down binary counter in VHDL using the following entity declaration and architecture body:
Entity declaration:
```vhdl
entity cnt_up_down is
generic(
g_CNT_WIDTH : natural := 4 -- Number of bits for counter
);
port(
clk : in std_logic; -- M... | glaive |
Please explain the following problem in detail and provide code in Julia:
You have `n` gardens, labeled from `1` to `n`, and an array `paths` where `paths[i] = [xi, yi]` describes a bidirectional path between garden `xi` to garden `yi`. In each garden, you want to plant one of 4 types of flowers.
All gardens have **at... | dolphin |
A woman is trying to decide whether it will be quicker to take an airplane or drive herself to a job interview. If she drives herself, the trip will take her 3 hours and 15 minutes. If she takes an airplane, she will first need to drive 10 minutes to the airport, and then wait 20 minutes to board the plane. After tha... | tiger_lab_math |
How can I run just one test in a file using the "m" gem?
```ruby
m spec/my_spec.rb:25
``` | sharegpt |
The areas of three squares are X, 49 and 169. What is the average (mean) of their side lengths?
If we know the answer to the above question is 8, what is the value of unknown variable X? | tiger_math |
How can I create a CSS layout for a homepage that includes a navigation bar, header, footer, main content area, and sidebar? | glaive |
If Lauren paid for her grocery items, including 2 pounds of hamburger meat at $3.50 per pound, 1 pack of hamburger buns for $1.50, a head of lettuce for $1.00, a 1.5-pound tomato priced at $2.00 per pound, and a jar of pickles that cost $2.50 with a $1.00 off coupon, using a $20 bill, how much change would she receive? | tiger_math |
translate this code from Object Pascal to Perl:
```pascal
program Solution;
type
TInterval = record
left, right: Integer;
end;
TIntervalArray = array of TInterval;
function MinGroups(intervals: TIntervalArray): Integer;
var
i, end_time: Integer;
pq: array of Integer;
begin
SetLength(p... | dolphin |
Mike brings 60% as many bottles of juice as sandwiches for the school picnic. Emily brings one-third as many sandwiches as Mike and twice as many bottles of juice as sandwiches. If Emily brings 48 bottles of juice, what is the total number of bottles of juice and sandwiches that Emily and Mike brought to the school pic... | nvidia_math |
port this code to Rust:
```pascal
function minimumDeleteSum(s1: string; s2: string): integer;
var
dp: array of array of integer;
i, j: integer;
begin
SetLength(dp, Length(s1) + 1, Length(s2) + 1);
for i := 1 to Length(s1) do
dp[i][0] := dp[i - 1][0] + Ord(s1[i]);
for j := 1 to Length(s2) do
dp[0][j] :... | dolphin |
Create a list of the top 5 programming languages currently in use, excluding any languages that were released before 2010. Additionally, rank the programming languages based on the following criteria:
1. Number of job listings on popular job portals.
2. Popularity on coding forums and communities.
3. Number of active o... | codefeedback |
convert this code to Julia:
```perl
sub minimum_path_cost {
my ($stones) = @_;
my $n = scalar(@$stones);
my $max_cost = $stones->[-1];
for (my $i = 1; $i < $n-1; $i++) {
my $current_cost = max($stones->[$i], $stones->[-1]-$stones->[$i]);
$max_cost = min($max_cost, $current_cost);
}
... | dolphin |
Reese had a sum of money in her savings account. The company she used to work with was not doing well which is why she lost her job. So she spent 20% of her savings for her expenses in February, 40% of it in March, and $1500 in April. She had 11000 in her savings account if she still has $x after spending those amounts... | tiger_math |
What is the expected output type of the following function?
```python
def double_number(num):
return num * 2
``` | sharegpt |
Dana borrows 5000 pounds annually for her college education. If Dana gives her parents 4% of that amount back each month, how much will she still owe her parents after four years of college?
Answer Choices: (A) 9800 (B) 10000 (C) 10200 (D) 10400 (E) 10600 | tiger_lab_math |
How many different 5-digit numbers can be formed using the digits 1, 2, 3, 4, and 5 if each digit can be used only once? | tiger_math |
You are working on a Python project that involves data processing using the Dagster library. Your task is to create a custom type storage plugin for a specific data type. Type storage plugins in Dagster are used to define how a specific Python type should be stored and loaded from the Dagster event log. You need to imp... | magicoder |
How can you reverse a given string using a while loop, without using any built-in string reversal functions? Additionally, you are not allowed to use any additional variables to store the reversed string.
string = "hello"
*Rewritten test with increased difficulty:*
How can you reverse a given string using a while lo... | codefeedback |
Given that a sound level reading of 132 dB was recorded at a construction site with multiple chippers operating and a sound level of 122 dB was measured when only one chipper was working, how many chippers were in operation when the sound level was recorded at 132 dB? Please provide your answer as a whole number. | automath |
You are working on a system that processes and updates lists of data based on certain conditions. The code snippet provided is a part of a larger system and is responsible for filtering and updating lists based on specific criteria. The code snippet includes a conditional block that iterates through `LIST1` and appends... | magicoder |
Can you provide a Python function that can rearrange the characters of a given string? | glaive |
You are tasked with creating a Python program to analyze a dictionary containing URLs as keys and a list of related URLs and keywords as values. The program should implement a function that takes this dictionary as input and returns a new dictionary containing only the URLs that have a specific keyword in their related... | magicoder |
What is the clique number of the generalized Johnson graph \( J(4n-1, 2n-1, n-1) \) for a given integer \( n \), and under what conditions does equality \( \omega(J(4n-1, 2n-1, n-1)) = 4n-1 \) hold? | automath |
You are tasked with implementing a module for testing counters in a particular programming language. The module should include various test cases for different counter scenarios, each providing a different input and expecting a specific output. The tests should cover different counter types such as system cyclic, numer... | glaive |
You are working on a web application project called "Meiduo Mall" and need to implement a feature that involves setting an expiration time for OpenID tokens. The code snippet provided is from the file `constants.py` in the `auoth` module of the project repository. The snippet defines a constant `OPENID_EXPIRES` with a ... | magicoder |
Refine the existing programming script with the aim to compute the aggregate sum of all numerical integers within the range of 0 to 10 inclusively, capturing and storing the final calculated sum into the variable identified as 'total'.
total = 0 | sharegpt |
A bookstore has 1872 books on its shelves at the beginning of the day. By lunchtime, 417 books are sold, and in the late afternoon, a shipment of 612 new books arrives at the store. How many books does the bookstore have on its shelves at the end of the day? | nvidia_math |
Challenge:
Output the 'integer-factors' of the following five arithmetic operations based on the input:
- addition (+);
- subtraction (-);
- multiplication (*);
- division (/);
- integer exponentiation (^).
Rules:
What I define as 'integer-factors': Every unique integer that can evenly divide the result of the arithm... | evolcodegolf |
In the Mathland fair, Lizzy and her little brother Max found a booth playing a number-challenge game. The game organizer told them that they should choose a number \( x \), and then they would get as many candies as the result of the expression \( |x-3| + |x+2| \). Lizzy wants to win as many candies as possible. For wh... | tiger_math |
You are tasked with implementing a decorator system for composing audio effects in Python. The provided code snippet outlines the beginning of this system, with a decorator `effect` and an empty dictionary `EFFECTS` to store the composed effects.
The `effect` decorator is used to declare composable effects. When a fun... | magicoder |
You are tasked with implementing a JSON parser that can handle parsing and extracting values from a JSON string. Your parser should be able to handle parsing boolean values and floating-point numbers, and provide methods to access these values from the parsed JSON object.
Write a class `JSONParser` with the following ... | magicoder |
If the total cost of \( n \) equally priced shares of a stock is $12,000, and it is known that:
1. If the price per share had been $1 more, the total cost would increase by $300.
2. If the price per share had been $2 less, the total cost would decrease by 5%.
What is the price per share of the stock? | automath |
Write a function in Python to assign the value 0 for special values, i.e. empty strings, NaN, and negative numbers. The function should handle nested lists and dictionaries as well. Additionally, the function should also replace any positive even numbers with the value 1.
#Example Input:
my_list = [5, -2, 3, None, ''... | sharegpt |
A library has two shelves, one for fiction books and one for non-fiction books. The fiction shelf has 50 books with an average rating of 4.2 out of 5 stars, while the non-fiction shelf has 30 books with an average rating of 4.5 out of 5 stars. If 10 fiction books with an average rating of 4.8 out of 5 stars are moved t... | nvidia_math |
You are tasked with implementing a generic stack data structure in C#. The stack should support the standard operations of push, pop, and peek, as well as a method to check if the stack is empty. Additionally, the stack should have a method that returns the minimum element in the stack in constant time.
Your task is t... | magicoder |
I am trying to write a C++ program that performs a linear search in an integer array. Can someone help me with the code? | sharegpt |
Debug the following Python program which raises a SyntaxError. | codefeedback |
You are tasked with implementing a layout manager for a user interface in a mobile application. The layout manager is responsible for positioning UI elements within a parent view. The code snippet provided below represents part of the logic for adjusting the constraints of these UI elements based on the parent view's d... | magicoder |
Your assignment involves devising a program in the programming language of your choice that yields the value 1. This value can either be represented as a string or as a numeric equivalent of the integer one.
The intriguing twist lies in the following stipulation: if you determine the Unicode codepoint (or the equival... | evolcodegolf |
A 2000 kg automobile is traveling east at 60 mi/hr and collides with a 4000 kg truck traveling south at 20 mi/hr. If the two vehicles become coupled after the collision, what is the magnitude and direction of their combined velocity immediately after the collision? Please provide the answer in meters per second and ind... | automath |
What is the code to create an HTML form for submitting user feedback? | sharegpt |
Convert a timestamp from Australian Eastern Standard Time to different time zones around the world (UTC-1, UTC+1, UTC+4). Your program must also show the respective time when Daylight saving is considered in both the original and target time zones. | codefeedback |
Create a function in Ruby for performing the following string manipulations on the given text:
1. Reverse the order of the words in the text.
2. Capitalize the first letter of each word in the text.
3. Replace all occurrences of the letter 'o' with the number '0' in the text.
4. Remove all punctuation marks from the te... | codefeedback |
Is there a way to generate 5 unique random numbers in SQL?
Now I have the following code:
```sql
declare v_counter integer;
declare v_random integer;
declare v_result varchar(10);
select FLOOR(1+(rand()*50)) into v_result;
set v_counter=0;
while v_counter < 4 then
select FLOOR(1+(rand()*50)) into v_random;
s... | sharegpt |
Moving along a particular line in the Cartesian plane, when the $x$-value increases by 3 units, the $y$-value increases by 7 units. When the $x$-value increases by 9 units, by how many units will the $y$-value increase? | nvidia_math |
i have this module
import * as cborg from 'cborg'
import { CID } from 'multiformats/cid'
function cidEncoder (obj) {
}
....
when i build module with this command line
"bundle": "./node_modules/.bin/esbuild ./dist/index.mjs --bundle --outfile=./dist/out.mjs",
I have bundle without export default
when i build ... | codefeedback |
Compose a code to find the mean and median of a given list of positive integers. The code should handle cases where the list may contain duplicates or be unsorted. Additionally, you should optimize the code to reduce time complexity and avoid unnecessary calculations.
```python
def find_mean_median(numbers):
# Cal... | codefeedback |
Develop a function that not only eliminates successive identical elements present within a specified list, but also returns a new list with the remaining elements sorted in descending order. Additionally, the function should be able to handle both numerical and alphabetical elements. | codefeedback |
I am unsure of what the `cbw` command actually does. I have a snippet of code:
```assembly
mov ax,0FF0h
cbw
idiv ah
```
How does the value of ax change after `cbw`? | glaive |
I am currently working on a program in Turbo Assembler where I need to receive a number from the console, perform calculations based on it, and then display the result on the console. I have managed to convert a string to a floating-point number and vice versa using subprograms. However, I am encountering a problem. I ... | glaive |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.