instruction_seed
stringlengths
43
8.03k
source
stringclasses
1 value
embeddings
listlengths
1.02k
1.02k
mean_positive_score
float64
0.73
0.85
mean_negative_score
float64
0.71
0.82
difference_score
float64
0.01
0.07
You are required to implement a SQL function that calculates the factorial of a given integer using the `WITH RECURSIVE` SQL feature. The factorial of a non-negative integer `n` is denoted as `n!` and is defined as the product of all positive integers less than or equal to `n`. The logical definition of the factorial f...
glaive
[ 0.02606058679521084, 0.04853133112192154, -0.01488476898521185, -0.032609548419713974, 0.025938203558325768, -0.03644007071852684, -0.018620122224092484, 0.05231050029397011, 0.04152660444378853, -0.002756365342065692, 0.022035440430045128, 0.045652009546756744, -0.03092719055712223, 0.006...
0.801567
0.772886
0.028681
What is the probability of rolling two even numbers with two dice rolls?
glaive
[ 0.004445898346602917, -0.00011734204599633813, -0.025571022182703018, -0.02922629937529564, 0.01303665991872549, 0.0008623582543805242, -0.01609840802848339, 0.032638661563396454, 0.032443463802337646, -0.03285270556807518, 0.00541946804150939, 0.026629187166690826, -0.022713003680109978, ...
0.763987
0.74013
0.023857
You are given two arrays, 'le' and 'et', both containing unsigned 8-bit integers. Your task is to create a new array 'leet' by concatenating the two arrays in the order leet = le ++ et. Additionally, you are asked to create another array 'bit_pattern' by repeating the sequence [1, 0, 0, 1] three times using the repetit...
glaive
[ 0.020473459735512733, 0.043728526681661606, -0.015227042138576508, -0.04166831821203232, 0.04648730158805847, -0.020127329975366592, -0.03171674907207489, 0.06173483282327652, 0.0277697816491127, -0.0224692914634943, 0.02460513822734356, 0.019657209515571594, -0.05352022498846054, -0.03659...
0.82968
0.787863
0.041817
You are tasked with creating a function called "convert" that takes an integer "n" as input and returns a specific output based on the following conditions: - If "n" is a multiple of 3, the function should return "Fizz" - If "n" is a multiple of 5, the function should return "Buzz" - If "n" is a multiple of both 3 and ...
glaive
[ 0.02723173052072525, 0.04007377848029137, -0.02245449647307396, -0.05425771325826645, 0.04295939579606056, -0.0374070480465889, -0.026304366067051888, 0.02395300753414631, 0.026140201836824417, 0.006663220003247261, 0.032474957406520844, 0.05362144112586975, -0.04647257179021835, -0.025901...
0.81692
0.781145
0.035775
You are tasked with creating a VBA program that analyzes stock data from multiple worksheets in a workbook. Each worksheet contains data on ticker symbols, opening prices, closing prices, and total stock volumes. Your goal is to calculate the yearly change, percent change, and total stock volume for each ticker symbol,...
glaive
[ 0.006168497260659933, 0.009782504290342331, -0.03544583544135094, -0.027567807585000992, 0.03549277409911156, -0.039784807711839676, -0.02115752175450325, 0.06796645373106003, 0.049265578389167786, -0.003575968323275447, 0.019037149846553802, 0.011783374473452568, -0.040740977972745895, -0...
0.780615
0.76484
0.015775
You are tasked with creating a program that will recursively list all files in a given directory and its subdirectories. The program should output the file paths along with their respective sizes in bytes. Write a function that takes a directory path as input and returns a list of tuples, where each tuple contains the...
glaive
[ -0.0079636937007308, 0.03823825344443321, -0.024673406034708023, -0.04027554392814636, 0.02368621900677681, -0.020920366048812866, -0.020984742790460587, 0.028192192316055298, 0.03442424163222313, -0.031307023018598557, 0.040277622640132904, 0.04524032026529312, -0.04479311406612396, -0.01...
0.791668
0.774192
0.017476
You are tasked with implementing a program that computes the modified Bessel functions I0(z), I1(z), K0(z), K1(z), and their derivatives for a complex argument using subroutine CIK01. The input will be a complex number (z) and the output will be the computed values of CBI0, CDI0, CBI1, CDI1, CBK0, CDK0, CBK1, and CDK1....
glaive
[ 0.019190622493624687, 0.04451308399438858, -0.014090106822550297, -0.025785496458411217, 0.03444448858499527, -0.043364547193050385, -0.011240212246775627, 0.04265674203634262, 0.047803208231925964, -0.007047474849969149, 0.020632272586226463, 0.02664802223443985, -0.0409729890525341, -0.0...
0.799246
0.775818
0.023428
You are tasked with creating a function to calculate trending tracks based on play counts from a music database. The function should take into account the genre, time range, and total play counts. The function should return a list of trending tracks with their corresponding play counts. The function should have the fo...
glaive
[ 0.025158200412988663, 0.028918225318193436, -0.04982433468103409, -0.0212995707988739, 0.02126401476562023, -0.02427038736641407, -0.047188423573970795, 0.024787897244095802, 0.029111478477716446, 0.001184214954264462, 0.028401069343090057, 0.0026598565746098757, -0.024859415367245674, -0....
0.78309
0.762902
0.020188
You are tasked with implementing a random walk sampling algorithm using CUDA in C++. The goal is to create a program that can efficiently sample random walks on a graph using CUDA parallel processing. The program should take input in the form of a compressed sparse row (CSR) graph representation, including the indptr ...
glaive
[ -0.0047180973924696445, 0.03912799805402756, -0.02048085443675518, -0.018139488995075226, 0.029978927224874496, -0.002433881163597107, -0.034498147666454315, 0.10135675221681595, 0.026203088462352753, -0.023481624200940132, 0.030041974037885666, 0.03912261500954628, 0.011460259556770325, 0...
0.794514
0.765211
0.029303
You are tasked with writing a program to calculate the number of (n+1) X (1+1) 0..1 arrays with each 2 X 2 subblock having a clockwise pattern of 0000, 0011, or 0101. This will involve creating a function or algorithm that takes an input value of n and returns the corresponding number of arrays that meet the specified ...
glaive
[ 0.006810115650296211, 0.02311205118894577, -0.040260035544633865, -0.006047467235475779, 0.028947221115231514, -0.01556318998336792, -0.051669105887413025, 0.059311140328645706, 0.025244323536753654, 0.004505199380218983, 0.01376175694167614, 0.028618941083550453, -0.036200013011693954, -0...
0.846695
0.788275
0.05842
You are tasked with implementing a GPU-accelerated model of the luo_rudy_1991 cardiac cell model using CUDA C. The model involves solving a system of ordinary differential equations (ODEs) for each cell in a tissue matrix. The given code snippet includes the necessary memory allocation, execution configuration, and ker...
glaive
[ 0.000720758514944464, 0.03281896561384201, -0.018457477912306786, -0.03383473679423332, 0.0213029645383358, -0.03523784503340721, -0.026055248454213142, 0.09518717229366302, 0.032418519258499146, -0.019447607919573784, 0.024579210206866264, 0.026948681101202965, -0.022967195138335228, 0.01...
0.800634
0.785206
0.015428
You are tasked with implementing the `zipWith` function in Haskell. The `zipWith` function takes in a binary function and two lists, and returns a new list by applying the function to each pair of elements from the input lists. The input lists are of type `List` defined as: ```haskell data List a = Emp | (...
glaive
[ 0.01787509024143219, 0.009857792407274246, 0.008469407446682453, -0.030194910243153572, 0.04637546464800835, -0.00761833693832159, -0.001785788219422102, 0.031661275774240494, 0.02323121763765812, -0.0146067189052701, 0.007255225908011198, 0.04011052846908569, -0.00860525295138359, -0.0257...
0.805063
0.790565
0.014497
You are tasked with clustering a given set of cities into a specified number of groups, while minimizing the total pairwise distance between cities and ensuring that the variance in the total populations of each group is relatively small. For this specific exercise, you will use the 20 most populous cities in the Unit...
glaive
[ 0.002469027880579233, 0.022448712959885597, -0.04840206354856491, -0.012333378195762634, 0.04504314064979553, -0.007582406047731638, -0.03883202373981476, 0.030801240354776382, 0.03337576612830162, -0.006900262087583542, 0.00042502005817368627, 0.028750093653798103, -0.02717495895922184, 0...
0.802568
0.760862
0.041707
You are tasked with solving a problem related to finding the maximum seat ID and identifying your own seat on an airplane. The boarding passes consist of a string of 10 characters, with the first 7 characters representing the row and the last 3 characters representing the seat. Your task is to implement the following:...
glaive
[ 0.02888956107199192, 0.03269921615719795, -0.03762103244662285, -0.024094723165035248, 0.036498140543699265, -0.03160099312663078, -0.004271598532795906, 0.040735095739364624, 0.052097856998443604, -0.0059584504924714565, 0.036532212048769, 0.013232207857072353, -0.028028391301631927, -0.0...
0.822722
0.795824
0.026898
You are tasked with implementing a function that calculates the maximum absolute value in an array. The function should take in a Numpy array and return the maximum absolute value within the array. If the input array is `a`, the function should return $\max{\vert a \vert}$.
glaive
[ 0.024119781330227852, 0.03864433243870735, -0.03440156206488609, -0.015254417434334755, 0.029401404783129692, -0.04158817604184151, -0.024949245154857635, 0.04959903284907341, 0.04553612321615219, -0.005416715983301401, 0.018345830962061882, 0.025324376299977303, -0.031091269105672836, -0....
0.807601
0.778348
0.029253
You are tasked with creating a module in the programming language of your choice that includes a rule with a case statement and an if-else statement. Within the case statement, you should define different actions based on the value of a register. If the register has a value of 0, the variable 'n' should be set to 17; i...
glaive
[ 0.010746904648840427, 0.02060735784471035, -0.028896482661366463, -0.0283642765134573, 0.03295649215579033, -0.027012605220079422, -0.023607775568962097, 0.06683779507875443, 0.02241899073123932, -0.01464075967669487, 0.02884969487786293, 0.03722609952092171, -0.03717883676290512, -0.00388...
0.812774
0.793441
0.019333
You are tasked with implementing a function that takes in a list and a size, and checks if the length of the list matches the given size. If it does, the function should return true, otherwise it should return false. The function should be implemented in the SVL framework.
glaive
[ 0.0016123531386256218, 0.01717749424278736, -0.04938085004687309, -0.04897487163543701, 0.05153067782521248, -0.03289717435836792, -0.009235157631337643, 0.05949883162975311, 0.03201310336589813, -0.02478807605803013, 0.025268135592341423, 0.05265871062874794, -0.004626389127224684, -0.024...
0.818111
0.801746
0.016365
You are tasked with implementing a function that performs k-nearest neighbors (KNN) algorithm on a given dataset. The function should take in a matrix X of type AbstractMatrix{S}, where S is a subtype of AbstractFloat, representing the dataset, an integer n_neighbors representing the number of nearest neighbors to cons...
glaive
[ 0.017126543447375298, 0.04214969277381897, -0.03720857948064804, -0.041333913803100586, 0.04338899254798889, -0.02491048537194729, -0.016240714117884636, 0.03805629536509514, 0.047593969851732254, 0.015736445784568787, 0.03321894258260727, 0.02495586685836315, -0.020467093214392662, 0.0227...
0.806061
0.765556
0.040504
You are tasked with implementing a CUDA C program to perform a 1D stencil operation on an input array. The stencil operation involves calculating the sum of elements within a specified radius around each element in the array and storing the result in an output array. Your program should allocate memory for the input a...
glaive
[ 0.005182535387575626, 0.06137550249695778, -0.01553787849843502, -0.021406253799796104, 0.035474471747875214, -0.023849591612815857, -0.044612713158130646, 0.10488362610340118, 0.04703431576490402, -0.027816245332360268, 0.03780273720622063, 0.03895474597811699, -0.0040411921218037605, -0....
0.802283
0.774352
0.027932
You are tasked with implementing a function that counts the number of true invariants in a given array of integers. The function should take in an array of integers and the size of the array, and return the total count of true invariants. A true invariant is defined as the number of set bits (i.e., the number of 1s) i...
glaive
[ 0.02701684460043907, 0.040349774062633514, -0.03758782520890236, -0.008657285943627357, 0.040525518357753754, -0.027214059606194496, -0.029269535094499588, 0.10803025960922241, 0.02690555900335312, -0.004844682291150093, -0.003364067990332842, 0.032570742070674896, -0.011933963745832443, -...
0.818194
0.770866
0.047328
You are tasked with creating a function in R to simulate a case generation process based on a given set of betas and omegas. The function should take in the betas (coefficients) and omegas (weights) as input and generate the expected number of cases based on the provided parameters. Your task is to create a function c...
glaive
[ 0.017220482230186462, 0.020633971318602562, -0.04372759908437729, -0.030409786850214005, 0.03153986483812332, -0.0004053896409459412, -0.035780005156993866, 0.10289406776428223, 0.023641597479581833, -0.002669751178473234, 0.010395977646112442, 0.04733232408761978, -0.027636058628559113, -...
0.794669
0.780216
0.014454
You need to implement a function that calculates the derivative of a univariate polynomial. The function should take a polynomial as input and return its derivative as the output. The derivative of a polynomial is calculated by taking the sum of the product of the coefficient and the degree of each term in the polynomi...
glaive
[ -0.006548232864588499, 0.04696647822856903, -0.028295107185840607, -0.036324575543403625, 0.038930799812078476, -0.04298175498843193, -0.02464461699128151, 0.06737041473388672, 0.03962402045726776, -0.008618155494332314, 0.006454896181821823, 0.03507975861430168, -0.02614656277000904, 0.00...
0.784206
0.758167
0.026038
Two identical vehicles start from the same point at the same time, with one traveling eastward and the other traveling westward. The eastward vehicle is moving 1.5 times faster than the westward vehicle. After 2 hours, they are separated by a distance of 300 kilometers. What are the respective velocities of each vehicl...
glaive
[ 0.03353191539645195, 0.01547903474420309, -0.022129733115434647, -0.014512531459331512, 0.019371485337615013, -0.004314518067985773, -0.03966031223535538, 0.08881611377000809, 0.05226953700184822, -0.025617586448788643, 0.0013441138435155153, -0.00007303867459995672, -0.026161788031458855, ...
0.779438
0.755349
0.024089
You are tasked with creating a model to analyze the effect of different treatments at different airports on a certain outcome. You have data for N observations, with each observation having the following variables: - N: the total number of observations - n_airport: the number of unique airports - n_treatment: the numbe...
glaive
[ 0.013768439181149006, 0.019872313365340233, -0.05709456279873848, -0.043007366359233856, 0.033891987055540085, -0.015761271119117737, -0.031370144337415695, 0.07229530811309814, 0.04344578832387924, -0.002022859873250127, -0.004099757876247168, 0.04398550093173981, -0.024851588532328606, 0...
0.792756
0.776455
0.016301
You are working on a project that requires you to implement CUDA backend for horizontal operations using the Enoki library, a C++ template library that enables transparent vectorization of numerical kernels using SIMD instruction sets available on current processor architectures. Your task is to implement a function `c...
glaive
[ 0.014077533967792988, 0.0415952205657959, -0.01954401656985283, -0.002482031937688589, 0.013560401275753975, -0.008708939887583256, -0.016080783680081367, 0.08738862723112106, 0.04635052755475044, -0.02121046558022499, 0.015333886258304119, 0.03279482200741768, 0.0041570840403437614, 0.001...
0.805347
0.781762
0.023586
You have been tasked with implementing a sequential reduction over statically-sized array types in a C++ CUDA environment. The goal is to create a function that can perform a sequential reduction over a specified number of elements in an input array, using a binary reduction operator. The function should be able to han...
glaive
[ 0.008404144085943699, 0.047243278473615646, -0.02103239856660366, -0.020157942548394203, 0.045803315937519073, -0.00637049088254571, -0.03205007314682007, 0.12561988830566406, 0.06057300791144371, -0.00232114945538342, 0.018569311127066612, 0.025182470679283142, -0.005769230425357819, 0.00...
0.815915
0.787765
0.02815
How can I create an n-dimensional array in C++?
glaive
[ -0.0006723444093950093, 0.030195327475667, -0.021505821496248245, -0.03295174613595009, 0.04174632206559181, -0.022716188803315163, -0.0316084586083889, 0.08012475073337555, 0.03188949450850487, -0.026803033426404, 0.018270382657647133, 0.03867567703127861, -0.03684846684336662, -0.0270274...
0.784584
0.764613
0.019971
You are tasked with creating a function that generates a random integer within a specified range. The function should take two parameters, min and max, and return a random integer between min (inclusive) and max (exclusive). You should use the `random-preview` import to access extended random value utilities and ensure...
glaive
[ 0.021163519471883774, 0.021918216720223427, -0.022596511989831924, -0.02559898979961872, 0.042533162981271744, -0.02225170098245144, -0.04169763997197151, 0.044670913368463516, 0.034512825310230255, 0.0012459690915420651, 0.03063199669122696, 0.04974892735481262, -0.02895505726337433, -0.0...
0.800783
0.780582
0.0202
You are tasked with calculating the probability distribution for a quantum system described by a given amplitude function. The amplitude function is defined as a complex-valued function of two variables, x and y. The probability distribution is given by the absolute square of the amplitude function. Your goal is to fin...
glaive
[ 0.01811329834163189, 0.01880655065178871, -0.046832215040922165, -0.031780991703271866, 0.03857312351465225, -0.03298424184322357, -0.020242389291524887, 0.05558878555893898, 0.05087680369615555, 0.008622162975370884, 0.016520248726010323, 0.030838696286082268, -0.028931355103850365, -0.00...
0.782639
0.75413
0.028508
You are tasked with creating a program to calculate the probability distribution of a quantum state and visualize it in a 3D plot and contour plot. The quantum state is defined by the amplitude function, which takes in two input variables x and y. The probability distribution is calculated using the probability functio...
glaive
[ 0.0006469679065048695, 0.027485432103276253, -0.03493794426321983, -0.029883189126849174, 0.04680780693888664, -0.020032161846756935, -0.016900936141610146, 0.07924815267324448, 0.049897439777851105, 0.005448781419545412, 0.02409202978014946, 0.037958767265081406, -0.020405586808919907, -0...
0.781412
0.758244
0.023167
You are tasked with implementing a program to generate a lower triangular array, called S1hat(-1), related to partition number array A145361. The array should be populated with 1s and 0s according to a specific pattern. Write a program that takes an input parameter n and generates the lower triangular array S1hat(-1) ...
glaive
[ 0.031495749950408936, 0.038196954876184464, -0.03419249504804611, -0.030732473358511925, 0.033468350768089294, -0.038798559457063675, -0.029312578961253166, 0.07370159775018692, 0.032987192273139954, -0.01222548820078373, 0.03322327136993408, 0.033559348434209824, -0.027993546798825264, -0...
0.825293
0.781663
0.04363
You are tasked with implementing CUDA kernels to perform mathematical operations on half-precision floating-point numbers. The goal is to create CUDA kernels for addition, multiplication, finding the minimum, and finding the maximum of two half2 variables. The input will be a half2 variable, and the output should be a ...
glaive
[ 0.005622298456728458, 0.045706577599048615, -0.03539572283625603, -0.018274834379553795, 0.025210749357938766, 0.0025079830083996058, -0.0284078661352396, 0.08574461191892624, 0.051924798637628555, -0.019103124737739563, 0.015472636558115482, 0.04001644626259804, 0.007082968484610319, -0.0...
0.792849
0.778332
0.014517
You are tasked with creating a program that calculates the spanwidth of a series of numbers entered by the user. The spanwidth is defined as the difference between the maximum and minimum values entered. Your program should prompt the user to enter a series of positive integers and then calculate and display the spanwi...
glaive
[ 0.019984908401966095, 0.019370706751942635, -0.05297905206680298, -0.03042593225836754, 0.06009287014603615, -0.02915322035551071, -0.046499185264110565, 0.04596257209777832, 0.044902052730321884, -0.019881224259734154, 0.0223615113645792, 0.04693130776286125, -0.04279240593314171, -0.0137...
0.819591
0.784365
0.035226
You are tasked with writing a query to retrieve the minimum name of the people that Alice knows. You need to select the person that Alice knows and their minimum name from the provided database.
glaive
[ 0.03404701128602028, 0.02730954810976982, -0.03474516421556473, -0.010086781345307827, 0.028828054666519165, -0.04452040046453476, -0.005817838478833437, 0.012999421916902065, 0.03792867064476013, 0.008028511889278889, 0.02974727191030979, 0.019184807315468788, -0.005922373384237289, -0.01...
0.765256
0.743391
0.021865
You are tasked with implementing a Prolog predicate called "power" that calculates the power of a given number. The predicate should take in three arguments: the base (X), the exponent (Y), and the result (Z). The power predicate should calculate Z as X raised to the power of Y. If the exponent is 0, the result should ...
glaive
[ 0.04304130747914314, 0.048746924847364426, -0.011311015114188194, -0.053513526916503906, 0.042711041867733, -0.04109007865190506, 0.0051274970173835754, 0.04963165894150734, 0.05055319890379906, -0.03812926635146141, 0.023219790309667587, 0.04812852293252945, -0.04223779961466789, -0.01249...
0.796283
0.778266
0.018016
How can an AI algorithm in C be designed to create an array containing prime numbers?
glaive
[ 0.025610100477933884, 0.02293369360268116, -0.008001374080777168, -0.027266763150691986, 0.03156473487615585, -0.04110094904899597, -0.020035207271575928, 0.07277248799800873, 0.03245049715042114, -0.02921941690146923, 0.007988028228282928, 0.022511709481477737, -0.02394653670489788, -0.02...
0.803277
0.784293
0.018984
You are tasked with creating a CUDA program that calculates the neighbors of a graph and performs various operations on them. The program must be able to reduce the neighbor counts, sort the neighbors by keys, and then perform an exclusive scan on the neighbor counts. The program should use the CUDA framework, includin...
glaive
[ 0.011294920928776264, 0.05130733549594879, -0.03502557799220085, -0.006794786546379328, 0.02562093734741211, -0.0031619241926819086, -0.02402915619313717, 0.07053650915622711, 0.04828263819217682, -0.022805185988545418, 0.022858208045363426, 0.03313695639371872, -0.00998175423592329, -0.01...
0.813769
0.796147
0.017622
You are tasked with creating a program to analyze and extract information from a text document containing a football match report. The document includes details of a match between the National team and Ukraine at the Westfalenstadion. The report provides information on the goals scored, the players involved, and the ti...
glaive
[ 0.04111659154295921, 0.014962240122258663, -0.04731506481766701, -0.047313425689935684, 0.03536810353398323, -0.024854950606822968, -0.01061975210905075, 0.04476560652256012, 0.03466267138719559, -0.02033865824341774, 0.022501224651932716, 0.023097917437553406, -0.033089667558670044, 0.004...
0.782496
0.768071
0.014426
You are tasked with creating a program that calculates the probability of a quantum state and then visualizes the results. The program should take into account a specific number of qubits, states, and a given name. The problem requires the calculation of the maximum probability within a certain range and the visualizat...
glaive
[ -0.0008231148240156472, 0.02646661177277565, -0.04109194129705429, -0.022829115390777588, 0.04411861672997475, -0.01089988462626934, -0.02712620608508587, 0.0721244364976883, 0.038142673671245575, -0.0009870495414361358, 0.029924338683485985, 0.03844341263175011, -0.007353851571679115, -0....
0.792824
0.773444
0.01938
You are tasked with implementing a program that checks the properties of a quadrilateral formed by points A, B, C, and D, as well as points M and N. The program should verify the following conditions: 1. The quadrilateral formed by the points C, A, M, and N is cyclic. 2. The quadrilateral formed by the points N, M, B, ...
glaive
[ 0.019377660006284714, 0.012198608368635178, -0.03506188467144966, -0.0345950722694397, 0.03263462707400322, -0.029022537171840668, -0.0037008319050073624, 0.07076285034418106, 0.04307577759027481, -0.010106810368597507, 0.011240181513130665, 0.0333915613591671, -0.01996457949280739, -0.012...
0.803919
0.778248
0.025671
I have two Python dictionaries, 'x' and 'y', and I want to determine if they are symmetric. By symmetry, I mean that both the keys and their corresponding values are the same in both dictionaries. Here are the dictionaries: Dictionary 'x': {"First":"Hello", "Second":"World", "Third":"Python"} Dictionary 'y': {"Third"...
glaive
[ 0.011166265234351158, 0.008109224028885365, -0.05761268734931946, -0.03836148604750633, 0.024134743958711624, -0.03712760657072067, -0.0063021425157785416, 0.05272400751709938, 0.03504190221428871, -0.05325749143958092, 0.010618657805025578, 0.02544454112648964, -0.03746224567294121, -0.00...
0.796125
0.779093
0.017031
You are tasked with implementing a function that generates a Binary Volume Hierarchy (BVH) for a given set of triangles. The BVH is a tree data structure used in computer graphics for efficient ray tracing and collision detection. The function should take an array of triangles as input, sort them based on their Morton ...
glaive
[ 0.028642306104302406, 0.01928624138236046, -0.012620220892131329, -0.015553250908851624, 0.02030285820364952, -0.023829104378819466, -0.02525084838271141, 0.09685427695512772, 0.057625263929367065, -0.005640103947371244, 0.036532070487737656, 0.05405924469232559, 0.0012915440602228045, -0....
0.812373
0.783343
0.02903
You are tasked with implementing a rotating mask technique for image filtering using CUDA. The goal is to take a noisy image as input and output a filtered image using GPU parallel processing. The input image is represented as a 2D array of unsigned characters, and the output will also be a 2D array of unsigned charact...
glaive
[ -0.00015562922635581344, 0.05426453799009323, -0.021349649876356125, -0.006638866849243641, 0.02906664088368416, -0.006385453976690769, -0.030467605218291283, 0.08495309948921204, 0.04167346656322479, -0.023800000548362732, 0.018711594864726067, 0.0009872977389022708, 0.007803407497704029, ...
0.779719
0.763009
0.01671
You are tasked with implementing a shadow mapping algorithm for a 3D scene rendered using OpenGL 3.3. The given code snippet includes a fragment shader that calculates the shadowing effect caused by a directional light source. Your task is to implement the corresponding vertex shader, and to modify the main rendering l...
glaive
[ 0.029792414978146553, 0.03238876909017563, -0.00995921716094017, -0.0506407767534256, 0.03865000978112221, -0.02252083458006382, -0.021550998091697693, 0.08353050798177719, 0.029009418562054634, -0.015387039631605148, 0.035312119871377945, 0.021286366507411003, -0.00825880840420723, -0.009...
0.776595
0.761281
0.015315
You are required to write a program that implements the following logic: Given a number n, if n is an exponent of the Weyl group W(E_6), the program should return 1; otherwise, it should return 0. The Weyl group W(E_6) is a specific mathematical group, and an exponent of this group is a specific property of a number wi...
glaive
[ 0.022536884993314743, 0.0459674634039402, -0.02091710828244686, -0.051894355565309525, 0.047995153814554214, -0.05486801639199257, -0.028210947290062904, 0.061881717294454575, 0.0302621778100729, -0.023993344977498055, 0.029274139553308487, 0.03438827767968178, -0.03249916434288025, -0.043...
0.809556
0.773903
0.035654
You are tasked with implementing a function to extract a subgraph from a given graph based on a set of specified vertices. The graph is represented as a GraphCOOView with vertices, edges, and optionally, edge weights. The function should take the graph, a set of vertices, and the number of vertices as input and return ...
glaive
[ 0.016846800222992897, 0.018802078440785408, -0.023895958438515663, -0.018454894423484802, 0.023862695321440697, -0.021023327484726906, -0.01733577810227871, 0.07547730207443237, 0.04714079946279526, 0.00342795392498374, 0.02496805414557457, 0.026144862174987793, 0.0005266183288767934, 0.00...
0.802299
0.782241
0.020059
You are working on a project to build a quantum computer chip. One of the tasks is to create a function to build a chip specification based on a certain topology. Write a function to create a chip specification for a Bristlecone chip, which has a square grid layout with qubits coupled to nearest neighbors using CZ gat...
glaive
[ 0.023070869967341423, 0.04149426147341728, -0.02626701071858406, -0.01750374399125576, 0.04215549677610397, -0.03368230536580086, -0.03312298282980919, 0.0519929975271225, 0.031988732516765594, -0.0038436264730989933, 0.012272676452994347, 0.03547275811433792, -0.018118835985660553, 0.0028...
0.799301
0.783708
0.015593
You are tasked with writing a program to input a 2x2 matrix and print it. The program should prompt the user to input each element of the matrix and then display the entire matrix.
glaive
[ 0.037181127816438675, 0.030505990609526634, -0.03264492750167847, -0.03770259767770767, 0.033647600561380386, -0.03683509677648544, -0.019854068756103516, 0.05806021764874458, 0.05194730684161186, -0.019330114126205444, 0.026390502229332924, 0.03831982985138893, -0.017170602455735207, -0.0...
0.799114
0.769123
0.029991
How can I construct a frequency table for a given set of values?
glaive
[ 0.024007011204957962, 0.019985677674412727, -0.04091254994273186, -0.014897488988935947, 0.03294677659869194, -0.04480522871017456, -0.00709588872268796, 0.04840107634663582, 0.0301479734480381, -0.025252120569348335, 0.013724234886467457, 0.036379486322402954, -0.029990820214152336, -0.00...
0.778235
0.76152
0.016714
You are tasked with implementing a simulation of the compressible Euler equations in 2D using the DGSEM (Discontinuous Galerkin Spectral Element Method) solver. The simulation involves solving the equations on a deformed rectangle mesh that looks like a waving flag, with lower and upper faces being sinus curves and lef...
glaive
[ 0.003889806568622589, 0.02299698069691658, -0.01392784807831049, -0.056122615933418274, 0.021373474970459938, -0.015395705588161945, -0.009890773333609104, 0.07781217992305756, 0.023919984698295593, 0.001735698082484305, 0.02812623232603073, 0.03811723738908768, -0.0018502220045775175, -0....
0.791519
0.773717
0.017802
You are tasked with implementing a topological sort function for a directed graph in OCaml. The function should take in a graph and return a list of vertices, representing a valid topological ordering of the graph. The graph is represented using a module type G with the following signature: ```ocaml module type G = si...
glaive
[ 0.029372699558734894, 0.017924197018146515, -0.018042221665382385, -0.04737170785665512, 0.02502290904521942, -0.03121054545044899, -0.03070988692343235, 0.04679248481988907, 0.03522418439388275, -0.009501569904386997, 0.027496598660945892, 0.048212431371212006, -0.005169684067368507, -0.0...
0.808645
0.789921
0.018724
You are tasked with creating a SQL database table to store a list of countries along with their corresponding IDs and names. The table should have two columns: "id" and "value", where "id" is a VARCHAR(64) and "value" is also a VARCHAR(64). The "id" column should be the primary key of the table. You need to write the S...
glaive
[ 0.037436969578266144, 0.01969042420387268, -0.02935745194554329, -0.04167712479829788, 0.029404208064079285, -0.0332990363240242, 0.003140954067930579, 0.014056104235351086, 0.03041560761630535, -0.003139007370918989, 0.02668491192162037, 0.03262628614902496, -0.010508529841899872, 0.01591...
0.767498
0.750829
0.016669
You are tasked with implementing a CUDA kernel to generate elements of the interpolation matrix for a given set of grid points and body points. The interpolation matrix elements are computed based on the discrete delta function defined by Roma et al. (1999) and are used in the context of a computational physics simulat...
glaive
[ 0.004718579351902008, 0.04312020540237427, -0.013945123180747032, -0.0364006906747818, 0.024290062487125397, -0.03528059273958206, -0.009638144634664059, 0.08139141649007797, 0.045509129762649536, -0.032877255231142044, 0.03394273295998573, 0.04281619191169739, -0.032381001859903336, 0.008...
0.804439
0.78125
0.023189
I'm trying to develop a JavaScript algorithm that can identify the smallest prime number within an array of integers. Can someone help me with this? Here's an example array: `[17,29,32,7,23,90,35]`
glaive
[ 0.007502180989831686, 0.030230948701500893, -0.024677932262420654, -0.03820741921663284, 0.031565651297569275, -0.02899564802646637, -0.0020127170719206333, 0.04405787214636803, 0.032021887600421906, -0.02633693814277649, 0.028481945395469666, -0.0008700020844116807, -0.03309644013643265, ...
0.816514
0.801529
0.014985
You are tasked with implementing a function to compute residuals in a computational fluid dynamics simulation. The function should calculate the L2 norm and weighted L2 norm of the difference between two arrays, as well as the sum of drag and lift forces on a boundary. The function will take as input several arrays, in...
glaive
[ 0.006793193984776735, 0.04661659896373749, -0.010190828703343868, -0.04284796863794327, 0.04756280779838562, -0.03268551081418991, -0.03667650371789932, 0.08115283399820328, 0.03767300397157669, -0.013791901990771294, 0.01922740787267685, 0.051190320402383804, -0.034721579402685165, 0.0015...
0.814951
0.787854
0.027097
You are tasked with creating a CUDA program that will utilize a kernel to perform a series of mathematical operations on input variables. The main function will take in 21 command line arguments, representing 21 floating-point numbers, and pass them as parameters to the `compute` kernel. The `compute` kernel will execu...
glaive
[ 0.010520977899432182, 0.05012226849794388, -0.02256770431995392, -0.020659955218434334, 0.03706207126379013, -0.00969020090997219, -0.02665325254201889, 0.07391410320997238, 0.048234425485134125, -0.014344335533678532, 0.025718102231621742, 0.05097343400120735, -0.012889960780739784, -0.00...
0.807961
0.788018
0.019943
You are tasked with implementing a function that calculates the factorial of a given natural number using the provided code snippet. Factorial of a non-negative integer n is denoted as n! and is the product of all positive integers less than or equal to n. Your task is to define a function `factorial` that takes a nat...
glaive
[ 0.02721112221479416, 0.03394955024123192, -0.0182010717689991, -0.033220235258340836, 0.047942616045475006, -0.02877684496343136, -0.012197498232126236, 0.06361442059278488, 0.04410708323121071, -0.004238572902977467, 0.014872181229293346, 0.04378713667392731, -0.04628026857972145, -0.0169...
0.817156
0.790277
0.02688
How can I construct a linked list of integers using C++?
glaive
[ 0.012316228821873665, 0.026327839121222496, -0.018143359571695328, -0.03662450239062309, 0.037431858479976654, -0.01751687377691269, -0.014566240832209587, 0.06314777582883835, 0.04142008349299431, -0.03557255491614342, 0.02237091213464737, 0.05121926963329315, -0.02508043311536312, -0.008...
0.796951
0.776746
0.020205
You are tasked with creating a program that calculates the average of an array of numbers. Your function should take in an array of integers and return the average of those numbers. The average should be rounded to the nearest whole number. For example: Input: [1, 2, 3, 4, 5] Output: 3 Input: [10, 15, 20, 25, 30] Out...
glaive
[ 0.016724610701203346, 0.04391774162650108, -0.036185819655656815, -0.036523036658763885, 0.056692611426115036, -0.034184034913778305, -0.04504981264472008, 0.02987484261393547, 0.030719386413693428, -0.0263624619692564, 0.019657591357827187, 0.014468720182776451, -0.0509076826274395, -0.00...
0.795438
0.745871
0.049567
You are tasked with implementing a CUDA kernel function to perform type casting on arrays of data. The goal is to convert each element of the input arrays to a different type and store the results in the corresponding positions of the output arrays. You are given the following specifications: - The input arrays are of...
glaive
[ 0.009338629432022572, 0.06481081247329712, -0.013345726765692234, -0.016327617689967155, 0.036748532205820084, -0.023781128227710724, -0.01837407611310482, 0.09579402953386307, 0.04913303628563881, -0.017403751611709595, 0.027736598625779152, 0.0507783517241478, -0.012879375368356705, -0.0...
0.794679
0.78029
0.014389
You are tasked with implementing a Java program that defines a data structure and its associated enums. The data structure, called WrappedData, consists of three fields: serialization_protocol, compression_algorithm, and data. The serialization_protocol field is of type SerializationProtocol enum, the compression_algor...
glaive
[ 0.008407391607761383, 0.00980822741985321, -0.05376081168651581, -0.0217451099306345, 0.03317170590162277, -0.0523962676525116, -0.004635266959667206, 0.06425724178552628, 0.03217262402176857, -0.034776680171489716, 0.03127557411789894, 0.03447342291474342, -0.025935478508472443, 0.0010522...
0.810137
0.79083
0.019307
You are tasked with conducting a statistical power analysis to determine the statistical power of a test. You have been given the following information: - Two groups (Group 1 and Group 2) with respective probabilities (Prop_N1 and 1-Prop_N1) - Sample size for each group (n1 and n2) - Estimates for Group 1 and Group 2 ...
glaive
[ 0.014613612554967403, 0.012942293658852577, -0.03958906605839729, -0.07365241646766663, 0.03179701417684555, -0.039615076035261154, -0.0007733998936600983, 0.06886719912290573, 0.03905055299401283, -0.017713144421577454, 0.01529427245259285, 0.03826744109392166, -0.02915675938129425, -0.02...
0.773671
0.747054
0.026617
You are given a problem to implement an All-Pairs-Shortest-Paths (APSP) algorithm in C++ using CUDA. The APSP algorithm finds the shortest paths between all pairs of vertices in a weighted graph. The given code snippet provides the host code and a recursive in-place implementation of the APSP algorithm. Your task is to...
glaive
[ 0.004420284181833267, 0.02380705438554287, 0.004458039533346891, -0.014402272179722786, 0.02606021799147129, -0.013757273554801941, -0.020662527531385422, 0.10158585011959076, 0.035793013870716095, -0.02157166786491871, 0.030342398211359978, 0.03744237869977951, 0.0003147487004753202, -0.0...
0.808811
0.776696
0.032115
Can someone help me solve this basic algebra problem in Python?
glaive
[ 0.030476156622171402, 0.03843951225280762, -0.03554510325193405, -0.04543235898017883, 0.038028232753276825, -0.0281640887260437, -0.0038067810237407684, 0.046771932393312454, 0.04863530769944191, -0.023733150213956833, -0.00011631716915871948, 0.01456377748399973, -0.03637579828500748, -0...
0.820818
0.794972
0.025845
You are required to implement a CUDA kernel function that performs YOLO box calculations on input data. The input data consists of float arrays, and the kernel function should generate output boxes and scores based on the input data. The YOLO box calculations involve various mathematical operations such as sigmoid, exp...
glaive
[ 0.001700377557426691, 0.0553242452442646, -0.02195165865123272, -0.03006732277572155, 0.02843646891415119, -0.006499075796455145, -0.02329348772764206, 0.09000901877880096, 0.0464133620262146, -0.019385436549782753, 0.01601996459066868, 0.03557947650551796, 0.0002480990660842508, 0.0145817...
0.800706
0.781112
0.019594
You are tasked with creating a Fortran program that calculates Legendre polynomials coefficients for a given set of input data. The program should take in various command-line options, including the file name, position of the covariate in the file, minimum and maximum values of the input covariate, order of Legendre po...
glaive
[ 0.007616823073476553, 0.0265057273209095, -0.034381963312625885, -0.05175301060080528, 0.026793021708726883, -0.02508392184972763, -0.01443508267402649, 0.04933900386095047, 0.03876318037509918, -0.011704784817993641, 0.011121672578155994, 0.061100590974092484, -0.027906270697712898, -0.00...
0.799907
0.77422
0.025688
You are tasked with implementing a program to parse and evaluate a custom packet format. The packet format is represented as a series of hexadecimal values, which need to be converted to their respective integer values and then processed according to specific rules. The packet format consists of the following componen...
glaive
[ 0.026600904762744904, 0.02536064386367798, -0.03708495572209358, -0.023340459913015366, 0.03570045530796051, -0.048363327980041504, -0.008983303792774677, 0.08050314337015152, 0.053402625024318695, -0.011610761284828186, 0.02697208896279335, 0.0289545226842165, -0.034003835171461105, 0.000...
0.81598
0.797638
0.018341
You are tasked with creating a function that can convert various data types to their equivalent decimal values. You need to handle different data types such as Boolean, Int16, Int32, Object, SByte, Single, UInt16, UInt32, and UInt64. For each data type, you must handle different input scenarios, including values that a...
glaive
[ 0.010587191209197044, 0.028051832690835, -0.03222443535923958, -0.03988879919052124, 0.04801543429493904, -0.053218550980091095, -0.0021039352286607027, 0.05541037395596504, 0.06246253475546837, -0.032281480729579926, 0.0386185385286808, 0.03716731071472168, -0.017145277932286263, -0.00872...
0.790377
0.770219
0.020158
You are tasked with creating a program that calculates the number of years left until retirement and the year in which a person can retire. The program should prompt the user to input their current age and the age at which they would like to retire. After receiving the input, the program should calculate the number of ...
glaive
[ 0.02162412740290165, 0.04906900227069855, -0.025313589721918106, -0.03645249083638191, 0.0415959507226944, -0.02724365144968033, -0.032379213720560074, 0.07029161602258682, 0.05116431787610054, -0.012408990412950516, 0.02784109115600586, 0.0430961437523365, -0.04524583742022514, 0.01193028...
0.800259
0.77394
0.026319
You are tasked with implementing a shader program to visualize the Mandelbrot set. The given code snippet is a fragment shader that uses the Mandelbrot algorithm to determine the color of each pixel based on the number of iterations it takes to escape a certain threshold. The shader takes in a coordinate and iterates t...
glaive
[ 0.0135727534070611, 0.03381877765059471, -0.003915753681212664, -0.03700125217437744, 0.03811471536755562, -0.04134893789887428, -0.014900102280080318, 0.08042560517787933, 0.06449677050113678, -0.02870217338204384, 0.018505770713090897, 0.03425530344247818, -0.016913043335080147, 0.002832...
0.810342
0.789372
0.020969
You are tasked with implementing a data structure in Zig that represents a bounded array with a maximum size known at compile-time and an actual size known at runtime. The data structure should support various operations such as initializing the array, resizing it, slicing it, adding and removing elements, and more. Yo...
glaive
[ 0.022724950686097145, 0.018612394109368324, -0.03593145310878754, -0.014138112775981426, 0.04688403382897377, -0.038993459194898605, -0.007261595223098993, 0.057042405009269714, 0.03525827080011368, -0.021478453651070595, 0.032519664615392685, 0.022670358419418335, -0.024162765592336655, 0...
0.815046
0.789179
0.025867
You are tasked with creating a program in R that uses the parallel library to perform a specific calculation on a dataset. The program should utilize the mclapply function to apply a custom function to a vector of seeds, using multiple cores for parallel processing. The custom function should use the given parameters s...
glaive
[ 0.015497023239731789, 0.0608169287443161, -0.028859170153737068, -0.029929252341389656, 0.03675032779574394, -0.007865835912525654, -0.035655345767736435, 0.062252387404441833, 0.03708306699991226, -0.0012088624062016606, 0.003021548967808485, 0.02888987585902214, -0.019730227068066597, 0....
0.795576
0.776881
0.018695
You are tasked with creating a program that supports the identification of the 'Carian' block in Unicode. Your program should be able to recognize and handle the fuzzy permutations of the 'Carian' block, providing accurate results for any input.
glaive
[ 0.02293744869530201, 0.0479680597782135, -0.031076578423380852, -0.028398221358656883, 0.035575490444898605, -0.019612746313214302, -0.007933964021503925, 0.07580024003982544, 0.03515959531068802, -0.01678479090332985, 0.039426520466804504, 0.03095236048102379, -0.022744016721844673, 0.001...
0.807785
0.790178
0.017607
You are tasked with writing a CUDA kernel function that performs vector addition on two arrays A and B, and stores the result in array C. The size of the arrays is given by the variable arraySize. You will need to allocate device memory, transfer the arrays A and B to the device, launch the CUDA kernel, and then copy t...
glaive
[ 0.004109897650778294, 0.06276410073041916, -0.017636606469750404, -0.01945018395781517, 0.03204788267612457, -0.004099715501070023, -0.03954385593533516, 0.09589129686355591, 0.04423992708325386, -0.01699470356106758, 0.017363201826810837, 0.04499796777963638, -0.008201047778129578, 0.0060...
0.793343
0.774293
0.01905
You are required to create a CUDA class that generates random numbers using the Philox algorithm. The class should have a constructor that takes in a seed, subsequence, and offset, and a method that returns a float4 of random numbers. The random number generation process should follow the 7-round Philox algorithm and e...
glaive
[ 0.012764421291649342, 0.01610817387700081, -0.0217641182243824, -0.02372616156935692, 0.02732032909989357, -0.024600934237241745, -0.0348450131714344, 0.07521786540746689, 0.031635429710149765, -0.02789497561752796, 0.021011410281062126, 0.05203428864479065, -0.019535614177584648, -0.00004...
0.807907
0.791077
0.01683
You are tasked with writing a function in the programming language that takes in three parameters: a, b, and c, all of type nat. The function should also take in a function f that takes in two parameters of type nat and returns a value of type nat, as well as a function g that takes in a parameter of type nat and retur...
glaive
[ 0.0234211478382349, 0.030824344605207443, -0.0483655221760273, -0.019709598273038864, 0.048744890838861465, -0.019810477271676064, -0.016390128061175346, 0.0728120505809784, 0.013603098690509796, -0.013410507701337337, 0.018109573051333427, 0.05035030469298363, -0.021947916597127914, -0.02...
0.824578
0.804423
0.020155
You are tasked with creating a program that simulates the playback of a musical track with associated notes. The track is represented by a series of "Beat" lines, each indicating a timestamp and a value. The notes are represented by "Note" lines, each indicating a start timestamp, an end timestamp, and a value. You ne...
glaive
[ 0.025678535923361778, 0.022044066339731216, -0.06956177949905396, -0.0029148776084184647, 0.0361909456551075, -0.030872667208313942, -0.026144571602344513, 0.06494276970624924, 0.025810346007347107, -0.004007923882454634, 0.02212253212928772, 0.027955982834100723, -0.03665480017662048, -0....
0.807847
0.776755
0.031092
You are tasked with creating a program to solve a harmonic oscillator ordinary differential equation using the BDF (Backward Differentiation Formula) method. Your program should take into account an initial state, solution times, parameters, data, and integer data, and should integrate the ODE system using the given me...
glaive
[ 0.012817944400012493, 0.01553074736148119, -0.043518248945474625, -0.05033920705318451, 0.04329438507556915, -0.031910140067338943, -0.0011410044971853495, 0.06353000551462173, 0.05433296412229538, -0.004265627358108759, 0.010767052881419659, 0.028900885954499245, -0.026476068422198296, -0...
0.791221
0.774287
0.016934
You are tasked with creating a program that calculates the probability of a quantum state for a given set of parameters. The program should use the provided functions `amplitude[x_,y_]`, `amplitude2[x_,y_]`, and `probability[x_, y_]` to calculate the probability of a quantum state based on the input values of `x` and `...
glaive
[ -0.0024010613560676575, 0.03033348172903061, -0.02435518242418766, -0.020078539848327637, 0.04102960601449013, -0.015294416807591915, -0.012001749128103256, 0.07066669315099716, 0.042742446064949036, 0.007224975619465113, 0.022133832797408104, 0.04020266979932785, -0.01323255617171526, -0....
0.789785
0.756836
0.032949
You are tasked with implementing a function to determine if a given string of digits is valid according to the Luhn algorithm. The Luhn algorithm is used to validate a variety of identification numbers, such as credit card numbers. Here's how the algorithm works: - Starting from the rightmost digit, double every second...
glaive
[ -0.008977383375167847, 0.030864229425787926, -0.0070312065072357655, -0.024696916341781616, 0.035302627831697464, -0.018521945923566818, 0.0008617888088338077, 0.06218179315328598, 0.006925681605935097, -0.013448633253574371, 0.009921991266310215, 0.036492638289928436, -0.022527581080794334,...
0.825217
0.792762
0.032455
You are required to implement the FFT1D subroutine in Fortran, which is used to perform an in-place DFT computation using the Sande algorithm and Markel pruning modification. The subroutine takes the following input parameters: - X: Array of length 2^M used to hold the real part of the complex input - Y: Array of lengt...
glaive
[ 0.00997891929000616, 0.04102366417646408, -0.02825060859322548, -0.05030243471264839, 0.03671322017908096, -0.030479881912469864, 0.00994743313640356, 0.0576564259827137, 0.04848470911383629, 0.01095876656472683, 0.03126894310116768, 0.03400016203522682, -0.036124106496572495, -0.006178889...
0.804609
0.78102
0.023588
You are tasked with implementing a simple Hidden Markov Model (HMM) using the Stan programming language. The HMM has 2 states and produces 1 output. You are given the number of observations (N), the number of states (K), and the observation data (y). Your task is to write the code to define the model's parameters, tran...
glaive
[ 0.022562300786376, 0.020671570673584938, -0.017792852595448494, -0.0453607477247715, 0.047777123749256134, -0.014895939268171787, -0.02805992029607296, 0.07206565886735916, 0.037174299359321594, -0.02234666235744953, 0.012554855085909367, 0.042074598371982574, -0.01013200357556343, 0.01145...
0.805326
0.784871
0.020455
You are tasked with implementing a subroutine for processing element mass, stiffness, thermal load, pressure load, and stress recovery matrices if there are any offsets of the element at any grid points. The subroutine should be a general routine that can be used by any of the elements as long as the element has no mor...
glaive
[ 0.03839033469557762, 0.020314546301960945, -0.03120850957930088, -0.04455064237117767, 0.03664346784353256, -0.052428942173719406, -0.014184288680553436, 0.08601310104131699, 0.016369087621569633, 0.00021170939726289362, 0.03299110755324364, 0.04209350049495697, -0.030893033370375633, -0.0...
0.800492
0.783723
0.016769
You are tasked with implementing a function in the sccz80 assembly language called dpush3. The function should push the value of the variable fa onto the stack under the return address and the stacked long. The function should follow the given steps: 1. Save the return address in HL, the next word in DE, and the high w...
glaive
[ 0.024904273450374603, 0.02049347758293152, -0.032929226756095886, -0.04193567857146263, 0.022532330825924873, -0.029340729117393494, -0.012954614125192165, 0.06402401626110077, 0.03866702318191528, 0.0010627491865307093, 0.022320959717035294, 0.052768319845199585, -0.04509277641773224, -0....
0.802348
0.786353
0.015995
How can I determine the score of a student on a given five-point scale?
glaive
[ 0.003886920167133212, 0.004191592335700989, -0.02929750084877014, -0.05297978222370148, 0.03550593927502632, -0.04104151204228401, -0.02797834202647209, 0.046008072793483734, 0.04100973531603813, -0.004082515370100737, 0.021539540961384773, 0.040051449090242386, -0.028352482244372368, -0.0...
0.756826
0.741557
0.015268
You are tasked with creating a program that can calculate the area of a triangle given the length of its base and height. The program should take two inputs - the base and the height of the triangle - and output the area of the triangle. The area of a triangle can be calculated using the formula: area = 0.5 * base * he...
glaive
[ 0.03431035205721855, 0.03302845358848572, -0.04734622687101364, -0.024951918050646782, 0.04179844632744789, -0.02429736591875553, -0.016311895102262497, 0.05319395661354065, 0.032618436962366104, -0.011396684683859348, 0.025998681783676147, 0.04530833289027214, -0.03141549974679947, -0.028...
0.786674
0.756457
0.030217
You are tasked with creating a function that takes an array of numbers as input and returns a new array with the numbers multiplied by 2. The function should also handle any errors that may occur during the process and provide a descriptive error message.
glaive
[ 0.02677682787179947, 0.047686316072940826, -0.029788168147206306, -0.031843267381191254, 0.03744924068450928, -0.024704407900571823, -0.038312189280986786, 0.06853951513767242, 0.013957623392343521, -0.008897264488041401, 0.013566941022872925, 0.027396628633141518, -0.023304298520088196, -...
0.807167
0.779251
0.027916
You are tasked with implementing a union in C that contains a single unsigned char variable and a struct with 8-bit fields. The union should be named "un_rtcc0" and should be able to store an 8-bit value in either the unsigned char variable or the struct fields. Write the code for the union "un_rtcc0" with the followi...
glaive
[ 0.011315626092255116, 0.032181110233068466, -0.017803052440285683, -0.026553090661764145, 0.02686210721731186, -0.02004615217447281, -0.029077762737870216, 0.09024954587221146, 0.03758089989423752, -0.0066933948546648026, 0.024722063913941383, 0.020745310932397842, -0.012826299294829369, -...
0.795118
0.780137
0.014982
You are tasked with implementing a function to perform a left shift operation on a given array of integers. The function should take in the source array, the size of the array, and the number of positions to shift by as parameters. The left shift operation involves moving each element of the array to the left by the sp...
glaive
[ 0.019983284175395966, 0.0450286865234375, -0.014564570039510727, -0.025296593084931374, 0.036796312779188156, -0.01830482669174671, -0.04029805213212967, 0.07611925154924393, 0.0368085578083992, -0.013991788029670715, 0.021086368709802628, 0.012540725991129875, -0.031170137226581573, -0.01...
0.811808
0.774295
0.037513
You are tasked with implementing a dynamic array data structure in C++ that automatically resizes itself when necessary and keeps track of the minimum and maximum values in the array. The DoubleArray structure should have the following functionalities: 1. A constructor that initializes the array with default values. 2....
glaive
[ 0.008983297273516655, 0.02182471752166748, -0.02103046141564846, -0.028518887236714363, 0.029314199462532997, -0.018619582056999207, -0.02467723749577999, 0.1107143759727478, 0.03946974128484726, -0.01676793582737446, 0.024404315277934074, 0.03643038123846054, -0.03858311101794243, -0.0012...
0.803828
0.771554
0.032274
I need to write a program that collects the 10,001st prime number. A prime number is a whole number greater than 1 whose only factors are 1 and itself. For example, the first six prime numbers are 2, 3, 5, 7, 11, and 13. The program should implement a sieve algorithm to efficiently find prime numbers, and then collect ...
glaive
[ 0.03789856284856796, 0.031061755493283272, -0.010812636464834213, -0.027278166264295578, 0.036710403859615326, -0.038456209003925323, -0.015135126188397408, 0.054737821221351624, 0.03225887939333916, -0.017113136127591133, 0.027359435334801674, 0.01888747699558735, -0.05728762969374657, -0...
0.809716
0.772732
0.036984
You are tasked with creating a program to calculate the probability of a quantum state in a quantum system. The amplitude of the system is defined by the `amplitude` function, and the probability is calculated using the `probability` function. You need to find the maximum probability for a given quantum state, and then...
glaive
[ 0.0043767159804701805, 0.02737569622695446, -0.033495619893074036, -0.02328001707792282, 0.04957740008831024, -0.028609098866581917, -0.024335743859410286, 0.07498624175786972, 0.032193880528211594, 0.004293196368962526, 0.024112198501825333, 0.03446488827466965, -0.014505255036056042, -0....
0.806068
0.783209
0.022859
Can you provide a program that prints the numbers between 1 and 10 (including 10) in ascending order?
glaive
[ 0.020250096917152405, 0.037584368139505386, -0.01661507412791252, -0.023688852787017822, 0.030680149793624878, -0.03592514991760254, -0.022362137213349342, 0.036475490778684616, 0.023185839876532555, -0.036408498883247375, 0.02548186667263508, 0.03822699934244156, -0.06591805815696716, -0....
0.802145
0.787713
0.014431
You are tasked with implementing a CUDA-based function that calculates the L1 norm of a vector stored in segments on a GPU. The vector is represented using a SplitPointer, which is a data structure that allows the vector to be split across multiple memory segments. The goal is to implement the function that calculates ...
glaive
[ -0.014640849083662033, 0.04011436551809311, -0.02518846094608307, -0.023283785209059715, 0.03247995674610138, -0.0025448515079915524, -0.03782704845070839, 0.08878472447395325, 0.034674905240535736, -0.01792840287089348, 0.020473582670092583, 0.042911186814308167, -0.01809738762676716, 0.0...
0.809732
0.786837
0.022895
You are tasked with implementing a function to perform a big multiplication of two lists of digits. The function should take two lists of integers as input and return a list representing the product of the two input lists. For example: Input: [9;9;9;9], [9;9;9;9] Output: [9;9;9;8;0;0;0;1]
glaive
[ 0.031441036611795425, 0.04029214009642601, -0.030319567769765854, -0.05134196579456329, 0.03743277117609978, -0.010763544589281082, -0.029850414022803307, 0.05538846179842949, 0.03153752535581589, -0.01823761686682701, 0.007814060896635056, 0.03456159681081772, -0.030821392312645912, -0.02...
0.817136
0.772747
0.044389
You are given a mathematical sequence defined by the function u, where u(n+1) = √(x + u(n)), and a real number x. You are also provided with the fact that the sequence u converges to the real number 9. Your task is to write a program in Lean to find the value of x such that 9 = √(x + 9).
glaive
[ 0.012991001829504967, 0.027483798563480377, -0.05486969277262688, -0.05152326077222824, 0.024461209774017334, -0.013724514283239841, -0.02454061061143875, 0.0717049315571785, 0.050379808992147446, -0.019841887056827545, 0.0413774773478508, 0.04230346903204918, -0.026186194270849228, -0.011...
0.821099
0.798336
0.022763
You are required to create a Clojure program that calculates the hash values of a given string using various hash algorithms. The program should be able to calculate hash values for the following algorithms: adler32, crc32, blake2b-160, blake2b-256, blake2b-384, blake2b-512, gost, md2, md4, md5, sha1, sha224, sha256, s...
glaive
[ 0.019268084317445755, 0.04085444286465645, 0.0019212656188756227, -0.033894132822752, 0.03037186712026596, -0.03902151808142662, -0.012770319357514381, 0.023080838844180107, 0.0454561673104763, -0.026083175092935562, 0.022497953847050667, 0.017190730199217796, -0.03346322849392891, -0.0284...
0.80064
0.778815
0.021825
You are working on a speech evaluation application and need to implement a SpeechScore class to calculate the speech score based on certain criteria. The SpeechScore class should have the following properties: - CorrectPhonemes: an integer representing the number of correctly pronounced phonemes - TotalPhonemes: an int...
glaive
[ 0.01003715768456459, 0.02163608744740486, -0.005286050029098988, -0.03872125968337059, 0.046283137053251266, -0.05091903731226921, -0.020790720358490944, 0.07307948172092438, 0.03452223166823387, -0.016277408227324486, 0.031876787543296814, 0.032932303845882416, -0.04571976140141487, -0.01...
0.799264
0.78243
0.016834
You are tasked with creating a program to simulate a lawn mower that can navigate through a grid to mow the lawn. The lawn is represented by a grid, and the mower can move in four directions: north, south, east, and west. The mower receives a sequence of commands containing letters 'N', 'S', 'E', or 'W' to move forward...
glaive
[ 0.006673324853181839, 0.030408577993512154, -0.02604534663259983, -0.049221329391002655, 0.026660623028874397, -0.04340184107422829, -0.04023483768105507, 0.05794920772314072, 0.030287638306617737, -0.008319783955812454, 0.005946541205048561, 0.0378606952726841, -0.03363582864403725, -0.00...
0.790946
0.77345
0.017496
You are tasked with implementing a subroutine called DELLXN, which will delete a specific line from the list of lines for a given node. The subroutine takes in several input parameters, including the maximum number of nodes (MXND), the list of lines for each node (LXN), the unique identifiers for each node (NUID), the ...
glaive
[ -0.0006959835882298648, 0.011950228363275528, -0.03398355096578598, -0.03632478415966034, 0.031208205968141556, -0.021760713309049606, -0.019558168947696686, 0.07038848102092743, 0.051444925367832184, 0.009030227549374104, 0.029280686751008034, 0.028977103531360626, -0.020373277366161346, ...
0.792729
0.778347
0.014382