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 create a subroutine that determines the order of elements in an integer EK column, using dictionary ordering on integer data values and array indices. The input to the subroutine consists of an array of integer EK column values, some of which may be null, a logical flag indicating whether nulls are ... | glaive | [
0.02032245695590973,
0.013795731589198112,
-0.018973110243678093,
-0.03631100058555603,
0.014735645614564419,
-0.026707559823989868,
-0.012534204870462418,
0.050733357667922974,
0.040517888963222504,
-0.014281044714152813,
0.020183982327580452,
0.03930847346782684,
-0.03167683258652687,
0.... | 0.816666 | 0.782834 | 0.033832 |
I need to write a function in Scheme that, given a number n, prints all prime numbers up to n. A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself. The function should be named printPrimesUpTo and should take a single parameter n. | glaive | [
0.042427681386470795,
0.01978377066552639,
-0.01185477152466774,
-0.0338137187063694,
0.03788520768284798,
-0.04537678509950638,
-0.013305081985890865,
0.04615594074130058,
0.01512557826936245,
-0.001823979546315968,
0.017663776874542236,
0.05504868924617767,
-0.035826098173856735,
-0.0232... | 0.803183 | 0.784031 | 0.019152 |
You are required to implement a function in CUDA C++ that calculates the value and derivative of a two-compartment exchange model. The model is used in pharmacokinetics to describe the exchange of a substance between two compartments, such as blood and tissue. The function should take in parameters for Ktrans, Ve, Vp, ... | glaive | [
0.008812843821942806,
0.030079038813710213,
-0.03635852038860321,
-0.019435467198491096,
0.03247987478971481,
-0.019632957875728607,
-0.041019096970558167,
0.10521167516708374,
0.05985674262046814,
-0.022509919479489326,
0.03139491006731987,
0.041168421506881714,
-0.013874104246497154,
0.0... | 0.792365 | 0.776249 | 0.016116 |
You are given a division ring `R` and you need to implement a function that calculates the division of two elements in the ring. The function should take two elements `a` and `b` as input and return the result of `a / b` in the division ring `R`. You need to ensure that the function handles the cases where `b` is zero ... | glaive | [
0.02524643763899803,
0.027441667392849922,
-0.03554600849747658,
-0.01696150377392769,
0.03354288265109062,
-0.022803595289587975,
-0.007489340845495462,
0.07352672517299652,
0.04293380677700043,
-0.0023171519860625267,
0.02465331181883812,
0.030340109020471573,
-0.007185789290815592,
-0.0... | 0.806328 | 0.785567 | 0.020761 |
You are given a dataset with the following columns: X, Y, TStamp, Pres., EndPts. The DataSize is 366. Your task is to write a program that processes this dataset and performs the following operations:
1. Calculate the average of the 'Pres.' column.
2. Find the maximum value in the 'EndPts' column.
3. Identify the row w... | glaive | [
0.012271814048290253,
0.019587360322475433,
-0.04512207582592964,
-0.039871010929346085,
0.035128507763147354,
-0.04111965000629425,
-0.028119029477238655,
0.05750996991991997,
0.04734465479850769,
-0.008368055336177349,
0.03568872809410095,
0.03232213109731674,
-0.03673823922872543,
0.007... | 0.805339 | 0.785154 | 0.020185 |
You are tasked with implementing a system for solving differential equations using the Runge-Kutta method. The system should be able to handle different types of functions with varying numbers of arguments, and should be able to accept different types of data such as arrays, vectors, matrices, and integers. Your task i... | glaive | [
0.018023110926151276,
0.02571140229701996,
-0.031883738934993744,
-0.034326955676078796,
0.02360423654317856,
-0.02491447888314724,
-0.014105929993093014,
0.06141965836286545,
0.05010807886719704,
-0.020598948001861572,
0.021621273830533028,
0.05330439656972885,
-0.007440161891281605,
0.00... | 0.792671 | 0.776575 | 0.016097 |
You are tasked with implementing a CUDA kernel to perform a specific mathematical operation on an array of integers. The kernel should be designed to efficiently carry out the operation on a large amount of data. Additionally, you need to create functions to manage memory allocation, random number generation, and data ... | glaive | [
0.012090570293366909,
0.04714205488562584,
-0.03633766621351242,
-0.021518662571907043,
0.030052362009882927,
-0.004556989297270775,
-0.038150887936353683,
0.07856680452823639,
0.046359267085790634,
-0.01869046688079834,
0.018729807808995247,
0.03559098765254021,
0.0023051246535032988,
0.0... | 0.786957 | 0.771298 | 0.01566 |
You are tasked with implementing a program that performs operations on packed arrays using only one bit. Given two arrays, arr_a and arr_b, you need to perform the following operations:
- Set the value of arr_a to 0xFF (or 11111111 in binary)
- Set the value of arr_b to 0x00 (or 00000000 in binary)
- Assign the value o... | glaive | [
0.030978724360466003,
0.06504293531179428,
-0.026977663859725,
-0.014912689104676247,
0.035368092358112335,
-0.032337069511413574,
-0.020457545295357704,
0.08198343962430954,
0.048465996980667114,
-0.02187749184668064,
0.018686581403017044,
0.013487420976161957,
-0.014602500014007092,
-0.0... | 0.822459 | 0.786942 | 0.035517 |
You are tasked with creating a program to calculate the moments and generating functions of a given random variable. The program should be able to handle both discrete and continuous random variables. The program should be able to calculate the moments around the origin and the central moments of the variable, as well ... | glaive | [
0.02322634868323803,
0.035489827394485474,
-0.03902004659175873,
-0.03684849292039871,
0.03860190138220787,
-0.011553136631846428,
-0.033159948885440826,
0.055817797780036926,
0.03806542605161667,
-0.0009045441402122378,
0.002934132469817996,
0.03509499132633209,
-0.02884051389992237,
0.00... | 0.807857 | 0.772389 | 0.035469 |
You are tasked with implementing a function to traverse a list and apply a given operation to each element using delimited continuations. The function should take the operation and the list as parameters and return the result of applying the operation to each element in the list.
For example, when using the shift oper... | glaive | [
0.03453437611460686,
0.03638014197349548,
-0.018456099554896355,
-0.04607725888490677,
0.05417325720191002,
-0.03617323562502861,
-0.001961702713742852,
0.0516967698931694,
0.038816895335912704,
-0.004273087251931429,
0.019686277955770493,
0.04642310366034508,
-0.021057140082120895,
-0.001... | 0.802286 | 0.777837 | 0.02445 |
You are tasked with implementing a GPU-accelerated algorithm to compute residuals and apply a preconditioner to a given set of complex wavefunctions. The algorithm involves multiple CUDA kernels that operate on arrays of complex numbers and requires careful handling of thread synchronization and shared memory usage. Th... | glaive | [
0.009250026196241379,
0.05781273543834686,
-0.02345096878707409,
-0.03660104051232338,
0.034778300672769547,
-0.013141365721821785,
-0.019032692536711693,
0.09588155150413513,
0.03989225998520851,
-0.013880753889679909,
0.024246688932180405,
0.038084473460912704,
-0.013260627165436745,
0.0... | 0.802823 | 0.782558 | 0.020265 |
You are tasked with implementing a custom hashing algorithm on a GPU using CUDA. The given code snippet defines various functions and constants required for the hashing process. Your task is to implement the following functions:
1. `g_rotr`: This function performs a right rotation on a 32-bit integer value.
2. `g_g`: ... | glaive | [
0.027161477133631706,
0.033767178654670715,
0.005504522938281298,
-0.0037559212651103735,
0.018141625449061394,
-0.025985540822148323,
-0.020493052899837494,
0.07646477222442627,
0.0410589799284935,
-0.018311170861124992,
0.01119592972099781,
0.015530290082097054,
0.007186244707554579,
0.0... | 0.788709 | 0.774247 | 0.014462 |
You are tasked with writing a program that calculates the total area of a set of 2D shapes and saves the individual areas to a text file. The program should prompt the user to select a group of shapes, calculate the area of each shape, sum the total area, and then save the individual areas to a text file.
Write a func... | glaive | [
-0.0029836525209248066,
0.04883655160665512,
-0.04768184944987297,
-0.029030323028564453,
0.05268166586756706,
-0.02288316935300827,
-0.017766259610652924,
0.06198187172412872,
0.03893233835697174,
-0.028416641056537628,
0.02857842855155468,
0.049415748566389084,
-0.032407283782958984,
-0.... | 0.804382 | 0.783601 | 0.020781 |
You are tasked with implementing a function to convert a given RGB color to its equivalent HSV color. The function should take in a vec3 representing the RGB color and return a vec3 representing the equivalent HSV color. The conversion formulas for RGB to HSV are as follows:
- To convert from RGB to HSV:
- Find the m... | glaive | [
-0.013002539984881878,
0.021251067519187927,
-0.02112480066716671,
-0.03711288422346115,
0.021230453625321388,
-0.041437409818172455,
-0.023723211139440536,
0.06801905483007431,
0.04865562543272972,
-0.020662810653448105,
0.046615127474069595,
0.033150576055049896,
-0.003570287022739649,
-... | 0.782993 | 0.760248 | 0.022745 |
You are tasked with implementing a CUDA kernel for performing convolution operations on two input arrays. The goal is to calculate the output array by sliding a window of a certain size over the input arrays and performing element-wise multiplication and summation. The specific details of the window size and input arra... | glaive | [
-0.004822919145226479,
0.060625459998846054,
-0.01689348742365837,
-0.0066404822282493114,
0.035440221428871155,
0.007129393517971039,
-0.026444151997566223,
0.10037905722856522,
0.0439237616956234,
-0.01158926635980606,
0.0300883948802948,
0.03200938552618027,
-0.02032420039176941,
0.0041... | 0.802585 | 0.779454 | 0.023131 |
:
You are tasked with creating a function that calculates the degree of a given vertex in a graph. The input to the function will be the graph and the vertex, and the output should be the degree of the vertex. The graph is represented using the igraph package in R. You need to ensure that the function returns the corre... | glaive | [
0.022110871970653534,
0.014678056351840496,
-0.040998414158821106,
-0.03222416713833809,
0.03858968988060951,
-0.03244491294026375,
-0.031176820397377014,
0.054506171494722366,
0.032428078353405,
-0.0040809293277561665,
0.013050392270088196,
0.0330633707344532,
-0.015174882486462593,
-0.00... | 0.791324 | 0.773327 | 0.017997 |
You are tasked with implementing a CUDA C++ program to calculate the value of PI using the Monte Carlo method. The program should use a specified number of threads to divide the calculation work and achieve parallelism.
The program should take two command line arguments: the number of slices (num_steps) and the number... | glaive | [
-0.00622504111379385,
0.04757240414619446,
-0.0090477978810668,
-0.00804982427507639,
0.037783533334732056,
0.008219234645366669,
-0.03551308438181877,
0.09655085951089859,
0.04247942566871643,
-0.020268581807613373,
0.030166691169142723,
0.046985335648059845,
-0.007953573018312454,
-0.003... | 0.799415 | 0.773411 | 0.026004 |
You are tasked with implementing a kernel function in CUDA for applying a square average filter to an image. The input and output data is represented by unsigned char arrays, with the image dimensions provided as width and height. The input data is padded with additional width and height, and the pitch of the input and... | glaive | [
-0.006519228685647249,
0.058636244386434555,
-0.025539251044392586,
-0.027786817401647568,
0.03842119872570038,
-0.012196642346680164,
-0.033749934285879135,
0.09360802173614502,
0.04097418487071991,
-0.021853871643543243,
0.03040139749646187,
0.023594044148921967,
-0.01724017783999443,
-0... | 0.793946 | 0.777606 | 0.01634 |
You are tasked with implementing a subroutine to test whether any of the given points (u(i),v(i)) are inside a triangle. The vertices of the triangle are specified by the vectors x and y. The subroutine should be called by .Fortran() from triang.list.R.
The subroutine should take the following input parameters:
- x: a... | glaive | [
0.014150169678032398,
0.02200743742287159,
-0.01773218810558319,
-0.032782286405563354,
0.030507991090416908,
-0.00805851723998785,
0.014816713519394398,
0.05573923513293266,
0.0450659841299057,
0.0025033773854374886,
0.010333618149161339,
0.05454407259821892,
0.0032475232146680355,
-0.042... | 0.808533 | 0.774523 | 0.034011 |
You are tasked with implementing a CUDA kernel function for convolution. The function should take in three input arrays `t`, `tk`, and `out`, as well as five integer variables `t_rows`, `t_columns`, `n_channels`, `k_rows`, `k_columns`, and `n_kernels`. The goal is to perform convolution on the input arrays and store th... | glaive | [
0.001499459962360561,
0.0642661303281784,
-0.021722616627812386,
-0.008092648349702358,
0.04564113914966583,
-0.0030580840539187193,
-0.034815702587366104,
0.08711331337690353,
0.04515228420495987,
0.000605472014285624,
0.0246189646422863,
0.022617105394601822,
-0.004880093038082123,
0.008... | 0.795055 | 0.772286 | 0.022769 |
You are tasked with implementing a Riemann Solver for the two-layer shallow water equations. The subroutine `rp1` is provided and it takes in various input arguments such as `maxmx`, `meqn`, `mwaves`, `maux`, `mbc`, and `mx`, along with arrays `ql`, `qr`, `auxl`, and `auxr`. It performs calculations and outputs arrays ... | glaive | [
0.007051415275782347,
0.03602688014507294,
-0.023282714188098907,
-0.053426314145326614,
0.038325268775224686,
-0.010803891345858574,
-0.016985850408673286,
0.06401564180850983,
0.02674018032848835,
-0.015930775552988052,
0.023106863722205162,
0.030465107411146164,
-0.030433492735028267,
-... | 0.803749 | 0.781073 | 0.022676 |
You are tasked with implementing a function in a language that supports dependent types, called `tst1`, which takes two boolean values `a` and `b` as input and returns a proof that `b` implies `a`. The function should be defined in such a way that it takes a proof of `a`, a proof of `b`, and a proof of `true`, and retu... | glaive | [
0.02890668623149395,
0.035082750022411346,
-0.032573405653238297,
-0.036247435957193375,
0.03983176872134209,
-0.030043013393878937,
-0.003269514301791787,
0.07696804404258728,
0.039542220532894135,
-0.011046795174479485,
0.0173630490899086,
0.04889944940805435,
-0.008109870366752148,
-0.0... | 0.826962 | 0.811601 | 0.015361 |
You are tasked with creating a function that converts a given hexadecimal color code to its RGB equivalent. The function should handle both full and short hex codes. The input will be a string representing the hexadecimal color code and the output should be an array representing the RGB values. If the hex code is a sho... | glaive | [
-0.0011387183330953121,
0.056757595390081406,
0.0018094927072525024,
-0.0416940376162529,
0.01604781113564968,
-0.048216454684734344,
-0.021412482485175133,
0.04640531539916992,
0.05267941579222679,
-0.014668514020740986,
0.02093423716723919,
0.026296136900782585,
-0.011102654039859772,
-0... | 0.763777 | 0.749399 | 0.014378 |
Can you provide an algorithm to determine the largest value among three given numbers? | glaive | [
0.0374922975897789,
0.01846597157418728,
-0.03344988450407982,
-0.03452666848897934,
0.029048534110188484,
-0.02811095491051674,
-0.011467788368463516,
0.03219149261713028,
0.02083098515868187,
-0.034465763717889786,
0.042756062000989914,
0.04936373606324196,
-0.049358610063791275,
-0.0229... | 0.802412 | 0.773581 | 0.028831 |
You are tasked with writing a SQL query to retrieve the count of questions and answers on the site "stackoverflow" with the following conditions:
- The question should have a view count between 0 and 100.
- The user should have upvotes between 0 and 1.
- The question's tags should be one of the following: '.net-core','... | glaive | [
0.01849585771560669,
0.006947900168597698,
-0.02273530885577202,
-0.04240056127309799,
0.019790280610322952,
-0.02546166442334652,
-0.02807280421257019,
0.04158739745616913,
0.02900107018649578,
0.0008389563881792128,
0.016511648893356323,
0.02813323587179184,
-0.025283874943852425,
-0.043... | 0.797057 | 0.77826 | 0.018797 |
You are tasked with implementing a high-quality numerical integration algorithm for a given multidimensional function. The goal is to accurately estimate the integral of the function over a specified volume, with a given absolute and relative error tolerance.
You are provided with a function that takes in a multidimen... | glaive | [
0.02876957505941391,
0.016019539907574654,
-0.028022250160574913,
-0.03427845612168312,
0.03919864445924759,
0.001286600949242711,
-0.03624400496482849,
0.050315938889980316,
0.04725457727909088,
-0.004328557755798101,
0.022906746715307236,
0.035339560359716415,
-0.005650293547660112,
-0.0... | 0.798198 | 0.770113 | 0.028085 |
You are tasked with creating a Fortran program that calculates the square of a given number. However, the program should be written in a way that works with units inference system and monomorphism restriction enabled. The program should define a function called "sqr" that takes a real number as input and returns the sq... | glaive | [
0.017174268141388893,
0.04447954148054123,
-0.031258776783943176,
-0.043562643229961395,
0.04311267286539078,
-0.01641455851495266,
0.0024664257653057575,
0.08412162214517593,
0.03682227060198784,
-0.018059585243463516,
0.015437586233019829,
0.05301917716860771,
-0.032736074179410934,
-0.0... | 0.802061 | 0.786343 | 0.015718 |
You are tasked with writing a program to find the smallest square number that is divisible by a given integer n. Your program should output the smallest positive number m such that n/m is a square.
For example:
- If n = 4, the output should be 1, as 4/1 = 4, which is a square.
- If n = 9, the output should be 3, as 9... | glaive | [
0.011173748411238194,
0.052514057606458664,
-0.03764719143509865,
-0.0389547236263752,
0.05682382732629776,
-0.026378057897090912,
-0.0245521143078804,
0.06650171428918839,
0.054218318313360214,
-0.01385706290602684,
0.035021599382162094,
0.01817852258682251,
-0.038338080048561096,
-0.0242... | 0.825345 | 0.784992 | 0.040353 |
Create a Verilog module that takes in a 128-bit input vector and produces a 128-bit output vector based on the following logic operations:
- Bitwise AND of the first 9 bits of the input vector (a9) and the first 9 bits of another 128-bit vector (b9)
- Bitwise AND of the first 4 bits of the input vector (a4) and the fir... | glaive | [
0.017222272232174873,
0.022849084809422493,
-0.019112104550004005,
-0.028983335942029953,
0.01944553293287754,
-0.036531101912260056,
-0.03931813687086105,
0.08083904534578323,
0.02881023660302162,
-0.014297652058303356,
0.02195773459970951,
0.04478883370757103,
-0.018935104832053185,
-0.0... | 0.8112 | 0.787147 | 0.024053 |
You are tasked with implementing a Python library that includes a function to perform a linear search on a given list of elements. The function should take in the list of elements and the target element as input, and return the index of the target element if it is present in the list, and -1 if it is not found.
Write ... | glaive | [
0.005621079821139574,
0.03501611575484276,
-0.0451333224773407,
-0.04584828019142151,
0.04710058867931366,
-0.019145075231790543,
-0.022987784817814827,
0.05857037380337715,
0.027448849752545357,
-0.0117782698944211,
0.02477254718542099,
0.018923718482255936,
-0.018546966835856438,
-0.0001... | 0.812606 | 0.794658 | 0.017948 |
You are tasked with implementing a function that performs duplicate value removal and encoding on input data using CUDA and NCCL. The function should take in the following arguments:
- num_pieces: The number of pieces to divide the input data into
- out: The output column to store the encoded data
- dict: The output co... | glaive | [
0.0010011302074417472,
0.027886351570487022,
-0.013109326362609863,
-0.013748320750892162,
0.02376512810587883,
-0.014326140284538269,
-0.017584960907697678,
0.08381746709346771,
0.04133208468556404,
-0.020133519545197487,
0.023251047357916832,
0.010565551929175854,
0.0009147045202553272,
... | 0.820999 | 0.799711 | 0.021288 |
I need help with developing a Java program that can invert an ordered numerical array while preserving its structure. The array may include both positive and negative numbers, as well as zero. Can anyone provide a solution for this?
```Java
public class Main {
public static void main(String[] args) {
int[... | glaive | [
0.014045368880033493,
0.025452427566051483,
-0.02897770144045353,
-0.014347233809530735,
0.03421280160546303,
-0.049417644739151,
-0.0004181748372502625,
0.056775882840156555,
0.027992138639092445,
-0.026816023513674736,
0.01593138463795185,
-0.001614099950529635,
-0.045938409864902496,
-0... | 0.808784 | 0.778069 | 0.030715 |
What is an algorithm to find the maximum subarray sum of a given array? | glaive | [
0.013789676129817963,
0.02311335876584053,
-0.038867272436618805,
-0.02794729918241501,
0.0333482101559639,
-0.015559831634163857,
-0.037585459649562836,
0.035200513899326324,
0.02625950239598751,
-0.026028435677289963,
0.03097185678780079,
0.03510868176817894,
-0.03190469741821289,
-0.007... | 0.797607 | 0.759418 | 0.038189 |
You are tasked with implementing a program that applies the Inverse Möbius transform to a given sequence of numbers. The Möbius transform is a mathematical operation used in number theory and combinatorics. The input sequence is a list of integers, and the program should apply the Inverse Möbius transform to this seque... | glaive | [
0.035642772912979126,
0.03063116781413555,
-0.022918833419680595,
-0.024402493610978127,
0.04615538939833641,
-0.005856118630617857,
-0.016965791583061218,
0.06958960741758347,
0.049234792590141296,
-0.018658040091395378,
-0.0005181675660423934,
0.029136165976524353,
-0.0272232573479414,
-... | 0.80512 | 0.77223 | 0.03289 |
You are tasked with creating a program to control a robot on a rectangular grid. The robot starts in a random cell on the grid, and the goal is to move the robot to its initial position and mark all the cells on the grid.
You are given the following functions:
- `kray(r, side)`: a function that moves the robot to the ... | glaive | [
-0.0014663042966276407,
0.03614372760057449,
-0.02536907233297825,
-0.04639105498790741,
0.03370485454797745,
-0.04350260645151138,
-0.02069058082997799,
0.05283335968852043,
0.04293832182884216,
-0.010039369575679302,
0.019042648375034332,
0.04493346065282822,
-0.04155120253562927,
-0.020... | 0.810355 | 0.793619 | 0.016736 |
You are tasked with implementing a CUDA kernel for computing the divergence operator from partial derivatives in a 3D array. The goal is to calculate the divergence of a vector field given its x, y, and z component derivatives. The input to your kernel will be three float arrays (dx, dy, dz) representing the partial de... | glaive | [
-0.006464395206421614,
0.049936261028051376,
-0.034060411155223846,
-0.018810942769050598,
0.024335524067282677,
-0.00511970417574048,
-0.043205730617046356,
0.07900944352149963,
0.04531628265976906,
-0.0038508896250277758,
0.029389960691332817,
0.034581609070301056,
-0.027714882045984268,
... | 0.803324 | 0.780626 | 0.022697 |
What is a way to create a data structure that can store 10 integers in sorted order? | glaive | [
0.030719488859176636,
0.008471724577248096,
-0.038155101239681244,
-0.024737881496548653,
0.020295554772019386,
-0.03853605315089226,
-0.032577019184827805,
0.056854818016290665,
0.020286496728658676,
-0.04807223752140999,
0.01802482083439827,
0.025756387040019035,
-0.06365787237882614,
-0... | 0.798122 | 0.774322 | 0.023799 |
You are tasked with creating a program to recode age variables based on specific age ranges. The age ranges are as follows:
- age60e: age equals 60
- age61e: age equals 61
- age62e: age equals 62
- age63e: age equals 63
- age64e: age equals 64
- age5659: age is between 56 and 59
- age6064: age is between 60 and 64
- ag... | glaive | [
0.024004340171813965,
0.007190282456576824,
-0.029690664261579514,
-0.030975177884101868,
0.034513670951128006,
-0.04556775838136673,
-0.028504101559519768,
0.08149314671754837,
0.050740040838718414,
-0.019125450402498245,
0.04308762028813362,
0.025278016924858093,
-0.04160832241177559,
0.... | 0.77874 | 0.755303 | 0.023437 |
You are tasked with implementing a quantum probability distribution function and visualizing it in a 3D plot. The probability function is defined as follows:
\[ P(x, y) = |amplitude(x, y)|^2 \]
Where amplitude(x, y) is a complex-valued function defined as follows:
\[ amplitude(x, y) = \frac{1}{\sqrt{2^{nqubits}}} \s... | glaive | [
0.004801623523235321,
0.03584441542625427,
-0.034522321075201035,
-0.033090610057115555,
0.031416818499565125,
-0.025602811947464943,
-0.0230681374669075,
0.06806360930204391,
0.045888371765613556,
0.021500075235962868,
0.03422515094280243,
0.04024311527609825,
-0.011394635774195194,
-0.00... | 0.797821 | 0.772915 | 0.024906 |
You are tasked with creating a program to manipulate a deck of playing cards. The program should be able to initialize the deck, shuffle the cards, and display specific card information.
The deck should contain 54 cards, including 52 regular playing cards and 2 jokers. Each card should have a unique identifier, a card... | glaive | [
0.01849733293056488,
0.025668200105428696,
-0.036851368844509125,
-0.022959411144256592,
0.026157541200518608,
-0.019551176577806473,
-0.02518453635275364,
0.047864630818367004,
0.033024776726961136,
-0.017907921224832535,
0.0243083406239748,
0.03468581289052963,
-0.03940516337752342,
-0.0... | 0.795132 | 0.769311 | 0.025821 |
You are tasked with creating a program that takes an integer input and checks if it is a prime number. A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself. Your program should prompt the user to enter an integer and then determine whether the input is a prime number o... | glaive | [
0.03628072887659073,
0.010687139816582203,
-0.012353004887700081,
-0.029293788596987724,
0.03657294809818268,
-0.028913071379065514,
0.014382441528141499,
0.07040119916200638,
0.033716484904289246,
-0.01709234155714512,
0.02685823291540146,
0.016658589243888855,
-0.028641238808631897,
-0.0... | 0.795367 | 0.757324 | 0.038043 |
You are tasked with analyzing a large-scale database of T-cell receptor beta (TCR??) sequences and binding associations from natural and synthetic exposure to SARS-CoV-2. The dataset, named covid_cdr3, contains unique TCRB CDR3 sequences extracted via IgBLAST. Your goal is to write a program that calculates the average... | glaive | [
0.004010600503534079,
0.015644041821360588,
-0.056208573281764984,
-0.0341433547437191,
0.031205644831061363,
-0.030762236565351486,
-0.05090766400098801,
0.0577486976981163,
0.03380720689892769,
-0.019325995817780495,
0.010789512656629086,
0.010952109470963478,
-0.030459396541118622,
0.01... | 0.809862 | 0.795075 | 0.014787 |
You are tasked with implementing a CUDA kernel for ray-AABB intersection. The given code snippet defines a CUDA kernel for ray-AABB intersection, which is part of a larger library for GPU-accelerated ray tracing. Your goal is to write the CUDA kernel function, `aabb_kernel`, which takes in several input arrays and comp... | glaive | [
0.031277675181627274,
0.046919241547584534,
-0.00837453082203865,
-0.018200600519776344,
0.029106101021170616,
0.0048681823536753654,
-0.030034886673092842,
0.07568622380495071,
0.04862341657280922,
-0.011282840743660927,
0.028900280594825745,
0.017126519232988358,
-0.0014885345008224249,
... | 0.802974 | 0.780979 | 0.021995 |
You are tasked with creating a program that calculates the probability distribution of a quantum state for a given set of parameters. The program should use the provided amplitude function to calculate the probability using the equation |amplitude|^2. Additionally, the program should use the NMaximize function to find ... | glaive | [
0.0015992643311619759,
0.03077576495707035,
-0.031061021611094475,
-0.023867737501859665,
0.043551135808229446,
-0.027466295287013054,
-0.01617257483303547,
0.07353585958480835,
0.038360804319381714,
0.0033767803106456995,
0.025145549327135086,
0.03842128813266754,
-0.013532720506191254,
-... | 0.788753 | 0.761539 | 0.027213 |
You are tasked with implementing a function that performs byte swapping for integers and vectors of integers. Byte swapping refers to the process of rearranging the bytes of a data element in a computer's memory. Your task is to implement the byteSwap function for integers of various sizes and vectors of integers of va... | glaive | [
0.031002096831798553,
0.036795854568481445,
-0.013043111190199852,
-0.024770241230726242,
0.0346309095621109,
-0.029454728588461876,
-0.019555799663066864,
0.04891740530729294,
0.04890462011098862,
-0.027401676401495934,
0.010380267165601254,
0.019229769706726074,
-0.020406289026141167,
-0... | 0.802269 | 0.770013 | 0.032257 |
You are tasked with creating a CUDA kernel function that performs element-wise addition of two arrays and stores the result in a third array. The arrays are of type uint32_t and have a length of n. The kernel function should be able to handle arrays of any size and must utilize CUDA to execute in parallel on a GPU. You... | glaive | [
0.008454865776002407,
0.05621654912829399,
-0.018907926976680756,
-0.018700847402215004,
0.03997182101011276,
0.0031565658282488585,
-0.02669401653110981,
0.09222965687513351,
0.03968236595392227,
-0.012669390998780727,
0.016229959204792976,
0.04178633540868759,
-0.019303452223539352,
-0.0... | 0.798426 | 0.773923 | 0.024504 |
You are working with a monoid in a programming project and need to define a function to find the conjugates of a given element. In the context of group theory, two elements a and b of a group are said to be conjugate if there exists an element c such that c * a * c⁻¹ = b.
Define a function `conjugates_of` that takes a... | glaive | [
0.026448911055922508,
0.05892857164144516,
-0.03029550239443779,
-0.011305288411676884,
0.03629905357956886,
-0.04737859219312668,
0.0016640917165204883,
0.07638217508792877,
0.037026047706604004,
-0.0025263922289013863,
0.0006934566190466285,
0.0306987501680851,
-0.021967880427837372,
-0.... | 0.818314 | 0.791469 | 0.026845 |
Is there a way to achieve list slicing like in Python using vectors in C++? I want to extract all elements except the first one from a vector.
Python's list slicing operator:
```python
list1 = [1, 2, 3]
list2 = list1[1:]
print(list2) # [2, 3]
```
C++ Desired result:
```cpp
std::vector<int> v1 = {1, 2, 3};
std::v... | glaive | [
0.026502761989831924,
0.01770595833659172,
-0.02560369484126568,
-0.047443587332963943,
0.05148955062031746,
-0.008379663340747356,
-0.015312462113797665,
0.10656367242336273,
0.026416651904582977,
-0.043073587119579315,
0.028420178219676018,
0.03400280699133873,
-0.024203499779105186,
-0.... | 0.784513 | 0.768733 | 0.01578 |
You are tasked with implementing a program to calculate the coordination sequence Gal.5.81.5. The coordination sequence is denoted as G.u.t.v, where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings. The given coordination sequence is: 1,4,8,14... | glaive | [
0.014460031874477863,
0.03744079917669296,
-0.007322385441511869,
-0.03223954513669014,
0.034892477095127106,
-0.002216024324297905,
-0.03372213989496231,
0.07806625962257385,
0.02201644331216812,
-0.014106404967606068,
0.016369318589568138,
0.0320771262049675,
-0.022708669304847717,
-0.00... | 0.820762 | 0.782207 | 0.038555 |
You are tasked with implementing a CUDA program to rotate a 2D matrix using both CPU and GPU. The matrix to be rotated is represented as a 1D array of shorts. The matrix has a width of 1222 and a height of 144. You need to write a function to perform the rotation on the CPU and another function to perform the rotation ... | glaive | [
0.016808224841952324,
0.046109870076179504,
-0.015436743386089802,
-0.008179270662367344,
0.026470554992556572,
-0.008517621085047722,
-0.038264237344264984,
0.08909599483013153,
0.032692935317754745,
-0.022462045773863792,
0.014977614395320415,
0.02548709325492382,
0.0029105476569384336,
... | 0.789412 | 0.7725 | 0.016911 |
You are tasked with implementing a function in C/C++ that will perform hashing using the NeoScrypt algorithm for cryptocurrency mining. The function signature and parameters are as follows:
```c
int scanhash_neoscrypt(bool stratum, int thr_id, uint32_t *pdata, uint32_t *ptarget, uint32_t max_nonce, uint32_t *hashes_don... | glaive | [
0.02469555288553238,
0.03310504928231239,
-0.02272988110780716,
-0.018032439053058624,
0.026950614526867867,
-0.020022841170430183,
-0.027595408260822296,
0.09169495850801468,
0.02831123396754265,
-0.01210307702422142,
0.021255118772387505,
0.006808215286582708,
-0.003435869002714753,
-0.0... | 0.800331 | 0.782936 | 0.017395 |
You are tasked with implementing a CUDA program to perform single-precision
axpy (a*x + y) operation on two arrays. The goal is to calculate the maximum
error between the computed result and the expected result after the operation.
The main function initializes the size of the arrays (N) and allocates memory for
the h... | glaive | [
0.01059882901608944,
0.034203752875328064,
-0.02749054878950119,
-0.027321282774209976,
0.027378441765904427,
-0.008918740786612034,
-0.024733150377869606,
0.07798151671886444,
0.04127108305692673,
-0.024203980341553688,
0.03743632510304451,
0.02771395444869995,
-0.0025733241345733404,
-0.... | 0.813995 | 0.796992 | 0.017003 |
You are tasked with implementing a Fast Fourier Transform (FFT) benchmark in Typed Scheme. The FFT function should take in two vectors of floating-point numbers and perform the FFT algorithm on them. The algorithm involves a variety of floating-point operations and array references. The function should initialize the i... | glaive | [
0.046428341418504715,
0.04999933019280434,
-0.03583992272615433,
-0.041191134601831436,
0.04730828106403351,
-0.03049571067094803,
-0.009917802177369595,
0.06242829188704491,
0.04070651903748512,
-0.008314245380461216,
0.023441949859261513,
0.03862600028514862,
-0.02083684876561165,
0.0187... | 0.791509 | 0.773522 | 0.017987 |
You are tasked with creating a program that simulates a simple poker game. Your program should include the following functionality:
- A pokerlib.c file that contains the logic for the poker game, including functions for checking the hand, determining the winner, and shuffling the deck.
- An arrays.h file that defines t... | glaive | [
0.011256079189479351,
0.020892588421702385,
-0.03014497272670269,
-0.029604455456137657,
0.039991337805986404,
-0.038807980716228485,
-0.01349493209272623,
0.07162483781576157,
0.03250265493988991,
-0.02602463588118553,
0.0218682661652565,
0.04357733204960823,
-0.033154524862766266,
-0.019... | 0.787091 | 0.77083 | 0.016261 |
You are tasked with defining a C++ struct that represents template arguments. The struct should have the following member variables:
- T: an integer representing a template argument
- U: an integer representing another template argument
- V: an integer representing yet another template argument
- Args: an integer repre... | glaive | [
0.03092806786298752,
0.026305967941880226,
-0.037735529243946075,
-0.0035928739234805107,
0.05249057710170746,
-0.04582441225647926,
-0.014527851715683937,
0.08987440168857574,
0.015170356258749962,
-0.01879804953932762,
0.028608690947294235,
0.0476766899228096,
-0.023499062284827232,
0.00... | 0.778083 | 0.763698 | 0.014385 |
How can I output every individual component from a collection of subsequent numerical arrays, sorted first by their arrays and then individually from maximum to minimum? The arrays may contain duplicate values and might not be sorted beforehand.
For example, I have the following arrays: [[8,2,6], [10,5,1], [9,3,7]]. W... | glaive | [
0.029013050720095634,
0.013453846797347069,
-0.029284778982400894,
-0.02793731354176998,
0.016844715923070908,
-0.0383845791220665,
-0.020044732838869095,
0.035031843930482864,
0.029186293482780457,
-0.02228560671210289,
0.021509088575839996,
0.028083359822630882,
-0.04716140404343605,
-0.... | 0.816931 | 0.791775 | 0.025155 |
You are required to define a function in Agda to decide whether two natural numbers are equal. The function should take two natural numbers as input and return a decision of whether they are equal. | glaive | [
0.030927201732993126,
-0.0055429525673389435,
-0.03655717894434929,
-0.03460995480418205,
0.037888843566179276,
-0.02372949756681919,
-0.006114506628364325,
0.0586041621863842,
0.027679050341248512,
-0.00210511963814497,
0.017912758514285088,
0.020199356600642204,
-0.033821139484643936,
-0... | 0.798508 | 0.781619 | 0.016889 |
You are tasked with creating a formal version of the proposition that, for any natural number n, if n is even, then n + 1 is odd. You need to define the proposition using the appropriate syntax and structure, ensuring that it is a completely self-contained and valid statement without referencing any existing code. | glaive | [
0.01856902800500393,
0.014262087643146515,
-0.01964997686445713,
-0.04816219583153725,
0.033319711685180664,
-0.027812974527478218,
-0.008478144183754921,
0.07410390675067902,
0.04170554131269455,
-0.013510407879948616,
0.0160471610724926,
0.01110489945858717,
-0.038849327713251114,
-0.015... | 0.800699 | 0.78641 | 0.014289 |
You are tasked with creating a JavaScript function that takes in an array of numbers and returns the sum of all the even numbers in the array. If the input array is empty or does not contain any even numbers, the function should return 0.
Write a function `calculateEvenSum` that takes in an array of numbers and return... | glaive | [
0.026333004236221313,
0.022896917536854744,
-0.032542746514081955,
-0.04763110354542732,
0.04182521626353264,
-0.01590552181005478,
-0.009580748155713081,
0.044057197868824005,
0.03066393919289112,
-0.018032144755125046,
0.019059790298342705,
0.030723417177796364,
-0.04902965575456619,
-0.... | 0.799121 | 0.756073 | 0.043048 |
You are tasked with creating a program that will generate two plots side by side with minimal space between them. The program should use the R programming language and the graphics package to achieve this. The first plot should display the number 1, while the second plot should display the number 2. You need to ensure ... | glaive | [
-0.00476595014333725,
0.03770905360579491,
-0.034432072192430496,
-0.046983473002910614,
0.02567697875201702,
0.0035230505745857954,
-0.028970718383789062,
0.07291357964277267,
0.05053076893091202,
-0.028341367840766907,
0.012718459591269493,
0.046684250235557556,
-0.008484146557748318,
0.... | 0.807817 | 0.783807 | 0.02401 |
I need to calculate the bandwidth of a given matrix and then perform the Reverse Cuthill-McKee (RCM) algorithm on it. The bandwidth of a matrix is the maximum difference between the row index and the column index of any non-zero element in the matrix. The RCM algorithm reorders the vertices of a graph to reduce the mat... | glaive | [
0.018699578940868378,
0.03255277872085571,
-0.0268184132874012,
-0.02995162270963192,
0.035496290773153305,
-0.03061518259346485,
-0.051190268248319626,
0.06634629517793655,
0.026605045422911644,
-0.020597998052835464,
0.008213202469050884,
0.028675490990281105,
-0.036934468895196915,
0.01... | 0.791229 | 0.771197 | 0.020032 |
You are tasked with writing a shader program that calculates the color of each pixel in a framebuffer based on a given texture and varying coordinates. The program should take into account the framebuffer size, tile size, view box origin, and texture size to correctly compute the color for each pixel. Additionally, you... | glaive | [
0.009823638014495373,
0.040831636637449265,
-0.012342053465545177,
-0.03418484330177307,
0.021890796720981598,
-0.040654923766851425,
-0.03636902943253517,
0.054504942148923874,
0.04103778302669525,
-0.026836015284061432,
0.043593909591436386,
0.037593625485897064,
-0.015150001272559166,
0... | 0.785325 | 0.770982 | 0.014342 |
You are tasked with creating a program that performs matrix multiplication using the NVIDIA CUDA library and the cuBLAS library. The program should generate two random matrices, perform the matrix multiplication on the CPU, and then perform the same operation using the cuBLAS library on the GPU. After the multiplicatio... | glaive | [
0.02101641148328781,
0.03457711637020111,
-0.02636108733713627,
-0.02086060680449009,
0.03858168423175812,
-0.011849232949316502,
-0.028412694111466408,
0.09263253957033157,
0.029909292235970497,
-0.033814601600170135,
-0.00199095718562603,
0.020055953413248062,
-0.009630908258259296,
0.00... | 0.796048 | 0.780392 | 0.015656 |
You are tasked with implementing a CUDA function to calculate the mean value of valid regions within a set of overlaps and piles. The function should take in arrays of overlap begins, overlap ends, pile begins, and pile ends, as well as arrays for valid regions and means. The valid regions array should be set to true o... | glaive | [
0.002701296005398035,
0.032259922474622726,
-0.0357181690633297,
-0.019035737961530685,
0.040483761578798294,
-0.006725235842168331,
-0.03916782885789871,
0.08662539720535278,
0.04118635505437851,
-0.005745967384427786,
0.03455793112516403,
0.037907924503088,
0.007463045883923769,
-0.01213... | 0.802186 | 0.780049 | 0.022137 |
You are tasked with implementing various list operations in Elm. You need to write functions to perform the following operations on a list:
1. Calculate the sum of the elements in the list using foldl and foldr
2. Map each element to itself and to its increment value
3. Check if the list is empty
4. Find the length of ... | glaive | [
0.0300789475440979,
0.03158155083656311,
-0.001087450422346592,
-0.04002956673502922,
0.04540013149380684,
-0.02224276401102543,
-0.007962909527122974,
0.0365939624607563,
0.050448719412088394,
-0.010164442472159863,
0.03268344700336456,
0.03701663017272949,
-0.02660652995109558,
-0.007424... | 0.803162 | 0.775298 | 0.027864 |
I am trying to find the smallest divisor of two numbers, a and b. The smallest divisor of two numbers is the largest number that can divide both a and b without leaving a remainder. I need a function that takes in two numbers, a and b, and returns the smallest divisor of these two numbers.
Can someone help me write a ... | glaive | [
0.03652574121952057,
0.03277202695608139,
-0.03331610560417175,
-0.033250704407691956,
0.04658504202961922,
-0.024088606238365173,
-0.014333720318973064,
0.05132925137877464,
0.038810741156339645,
-0.011273699812591076,
0.03400515764951706,
0.03627964109182358,
-0.009393232874572277,
-0.02... | 0.797632 | 0.781163 | 0.016469 |
You are tasked with implementing a program that calculates the product of all numbers that are congruent to 3 modulo 4 and are also divisors of a given input number. Your program should take an input integer and return the product of all such divisors.
For example, given the input 12, the program should calculate the ... | glaive | [
0.029842594638466835,
0.038531266152858734,
-0.020101699978113174,
-0.021817898377776146,
0.06234350427985191,
-0.024531418457627296,
-0.030065279453992844,
0.056288622319698334,
0.04061239957809448,
-0.022925525903701782,
0.007551928050816059,
0.034895993769168854,
-0.027148660272359848,
... | 0.816582 | 0.785153 | 0.031428 |
You are tasked with creating a program that processes a list of numbers and applies a specific restriction to each number. The restriction is defined by a message called DisjointRestrictToken, which contains an optional integer value called low_bar_for_brute_force, with a default value of 1000. Your program should take... | glaive | [
0.04306785389780998,
0.03752426430583,
-0.02115246094763279,
-0.01308028306812048,
0.037229109555482864,
-0.04379328340291977,
-0.008425131440162659,
0.06485682725906372,
0.04081149771809578,
-0.014875425025820732,
0.01751202903687954,
0.04489138349890709,
-0.04219422861933708,
-0.00775567... | 0.829372 | 0.803117 | 0.026255 |
You are tasked with implementing a program that calculates the page ranks of a given graph using the `Data.Graph.PageRank` module. The graph will be represented as a list of directed edges, and you will need to use the `Data.Graph.Inductive` module to create the graph data structure. The page rank algorithm takes into ... | glaive | [
0.017356840893626213,
0.012396929785609245,
-0.03077779710292816,
-0.03594140335917473,
0.019675910472869873,
-0.023045869544148445,
-0.0023822723887860775,
0.028017563745379448,
0.023524828255176544,
-0.0003520193859003484,
0.009645365178585052,
0.029284942895174026,
-0.03344101458787918,
... | 0.805265 | 0.781526 | 0.023739 |
You are tasked with creating a program to display a 2D representation of a structure from different views, namely the top, side, front, and a full view. The structure is represented by a combination of lines and squares. The user should be prompted to input a letter, and based on the input, the program should display t... | glaive | [
0.019658977165818214,
0.0330142118036747,
-0.024941734969615936,
-0.04033125191926956,
0.04760865494608879,
-0.03108219802379608,
-0.02419927902519703,
0.0687066912651062,
0.042852982878685,
-0.0019629704765975475,
0.03796550631523132,
0.03493663668632507,
-0.03697754442691803,
-0.01036091... | 0.809609 | 0.779402 | 0.030207 |
I am working on a program that involves processing a series of integers and need help with a specific task. I have a list of integers and I want to find the maximum sum of a contiguous subarray within the list. The subarray can contain both positive and negative numbers. Can someone please provide a solution to this pr... | glaive | [
0.024165192618966103,
0.011132653802633286,
-0.04791365936398506,
-0.022472437471151352,
0.04495878890156746,
-0.013120085000991821,
-0.021957682445645332,
0.040331315249204636,
0.05354251340031624,
-0.02519337460398674,
0.027354538440704346,
0.03751303628087044,
-0.03492419421672821,
-0.0... | 0.823155 | 0.79133 | 0.031825 |
You are required to write a program that calculates the maximum probability of a quantum state and then visualizes the probability function in a 3D plot and a contour plot. The quantum state is represented by the amplitude function, which is a function of two variables x and y. The amplitude function is defined as a co... | glaive | [
0.005660932045429945,
0.03860324248671532,
-0.03555487096309662,
-0.030633769929409027,
0.044982414692640305,
-0.017299912869930267,
-0.02574930526316166,
0.0799485370516777,
0.03736751899123192,
0.007714104373008013,
0.03098069131374359,
0.03732634335756302,
-0.010538979433476925,
-0.0118... | 0.801747 | 0.770727 | 0.03102 |
You are tasked with implementing a function that gathers elements from a source table based on a given gather map, and returns a new table containing the gathered elements. The gather map is a column view that specifies the indices of the elements to be gathered from the source table. The function should handle out-of-... | glaive | [
0.04635895788669586,
0.02561943046748638,
-0.015296117402613163,
-0.02333708107471466,
0.022690730169415474,
-0.03761963173747063,
-0.014659757725894451,
0.10923660546541214,
0.05258195847272873,
0.005557945929467678,
0.013101382181048393,
0.03764725849032402,
-0.018195865675807,
0.0022949... | 0.804962 | 0.784214 | 0.020748 |
You are tasked with creating a program that generates an inverse-distance spatial-weighting matrix. The program should take in coordinate variables and produce a matrix containing the inverse of the distance between the specified points. The program must also allow for various options such as specifying a unique identi... | glaive | [
-0.000565679045394063,
0.03511600196361542,
-0.02308391034603119,
-0.031534843146800995,
0.04646584019064903,
-0.03073043003678322,
-0.02688206546008587,
0.06490138918161392,
0.041824501007795334,
-0.01969762146472931,
0.02581150270998478,
0.025361375883221626,
-0.026451339945197105,
0.008... | 0.799354 | 0.775391 | 0.023963 |
I need help developing a Python function that calculates the minimum number of swaps required to transform one binary number string into another, taking into account the weight of each binary digit. The weight of a binary digit is determined by multiplying its value (0 or 1) by its position in the string (starting from... | glaive | [
-0.010261998511850834,
0.027149593457579613,
-0.038906171917915344,
-0.015334643423557281,
0.04588175192475319,
-0.040977686643600464,
-0.03001314401626587,
0.03265651315450668,
0.02380986511707306,
-0.004184770863503218,
0.014682344160974026,
0.01759590581059456,
-0.0304242055863142,
0.00... | 0.803601 | 0.788544 | 0.015057 |
What is the Java code to find the maximum value in an integer array? | glaive | [
0.01180297415703535,
0.029694590717554092,
-0.042685072869062424,
-0.028459029272198677,
0.02528012916445732,
-0.04005474969744682,
-0.01754867658019066,
0.033221643418073654,
0.03229982405900955,
-0.05454077571630478,
0.03292679414153099,
0.04065627232193947,
-0.03501898795366287,
-0.0090... | 0.796108 | 0.773883 | 0.022225 |
You are tasked with implementing a parallel Summed Area Table (SAT) generation kernel in CUDA. The SAT generation kernel needs to compute the SAT for each tile in a given arena.
The SAT generation kernel takes in the following parameters:
- `dArena`: A pointer to an array of floats representing the input arena
- `pair... | glaive | [
0.02303367666900158,
0.04640990495681763,
-0.034103650599718094,
-0.02301591821014881,
0.02843540720641613,
-0.014094796031713486,
-0.04008820280432701,
0.09157237410545349,
0.04578586667776108,
-0.014250281266868114,
0.044404756277799606,
0.044818222522735596,
-0.018558472394943237,
-0.00... | 0.809492 | 0.785855 | 0.023636 |
You are tasked with implementing a pointer vector in a programming language that supports low-level operations. A pointer vector is a data structure that stores a collection of pointers, where each pointer points to a memory address. Your task is to create a pointer vector and implement the following operations for it:... | glaive | [
0.009143335744738579,
0.034249674528837204,
-0.003298337571322918,
-0.013954823836684227,
0.035150229930877686,
-0.02918943390250206,
0.001296277274377644,
0.07946038991212845,
0.04825279116630554,
-0.009465871378779411,
0.008747028186917305,
0.0448206290602684,
-0.016927121207118034,
-0.0... | 0.812 | 0.783199 | 0.028801 |
How can I create a Java program that sorts an integer array in ascending order? | glaive | [
0.01930038072168827,
0.016025202348828316,
-0.03393232822418213,
-0.027605855837464333,
0.023371387273073196,
-0.03756698593497276,
-0.023727504536509514,
0.043122000992298126,
0.01712491735816002,
-0.04327726736664772,
0.023019656538963318,
0.0143123222514987,
-0.0582670159637928,
-0.0123... | 0.788754 | 0.77438 | 0.014373 |
I am looking to create a program that can analyze a given set of numbers and identify the frequency of each number present in the set. The program should be able to take in the input of the numbers and then output a list that shows each unique number present in the set along with the number of times it appears.
For e... | glaive | [
0.014626214280724525,
0.020055826753377914,
-0.05166095495223999,
-0.01262700092047453,
0.039556264877319336,
-0.01962333358824253,
-0.0014429850270971656,
0.06254279613494873,
0.021752798929810524,
-0.01709975115954876,
0.01927417702972889,
0.028763016685843468,
-0.03260273486375809,
-0.0... | 0.811489 | 0.785656 | 0.025834 |
What is the algorithm to search for a number in a sorted array with a time complexity of O(log n)? | glaive | [
0.010825511068105698,
0.037277594208717346,
-0.04492133855819702,
-0.03216958045959473,
0.014621746726334095,
-0.019765885546803474,
-0.029452089220285416,
0.042855750769376755,
0.020284296944737434,
-0.0366307832300663,
0.02694937214255333,
0.01892799511551857,
-0.027038943022489548,
-0.0... | 0.811731 | 0.778034 | 0.033697 |
You are tasked with implementing a program that evaluates mathematical expressions involving the variables x and y. The expressions are defined using the following data type:
```
type expr =
| VarX
| VarY
| Sine of expr
| Cosine of expr
| Average of expr * expr
| Times of expr * expr
| Thresh of expr * ex... | glaive | [
0.02336234599351883,
0.011403640732169151,
-0.05899971351027489,
-0.048506829887628555,
0.050421617925167084,
-0.01878047175705433,
-0.0142795005813241,
0.09504701942205429,
0.06507277488708496,
-0.013968291692435741,
0.03814520686864853,
0.057248663157224655,
-0.03519318625330925,
-0.0107... | 0.797674 | 0.780663 | 0.017011 |
You are tasked with implementing a genetic algorithm based on decision trees to extract information from stock market signals. The algorithm must be able to classify days as 'Buy', 'Sell', or 'Stop' based on certain conditions, using indicators such as MACD, ATR, ROC, EMA, SMA, and others. The algorithm should be able ... | glaive | [
-0.012809652835130692,
-0.005090753547847271,
-0.0274468045681715,
-0.029443757608532906,
0.026625730097293854,
-0.04330311715602875,
-0.03652496635913849,
0.06481950730085373,
0.026316111907362938,
-0.015769800171256065,
0.007023199927061796,
0.012942374683916569,
-0.017498929053544998,
0... | 0.796236 | 0.769731 | 0.026505 |
You are tasked with implementing a set of elliptic curve operations for the secp256k1 curve in a programming language that supports ACL2. The operations to be implemented include addition, multiplication, negation, and checking for a square root in the prime field. The secp256k1 curve is defined by the equation y^2 = x... | glaive | [
-0.0011837414931505919,
0.04364479333162308,
-0.012981783598661423,
-0.0438256599009037,
0.01841515302658081,
-0.029791047796607018,
-0.022145844995975494,
0.0790913924574852,
0.03210613504052162,
-0.024079225957393646,
0.002750771353021264,
0.01971420831978321,
-0.024629604071378708,
-0.0... | 0.818816 | 0.80188 | 0.016936 |
You are given a 2D board representing a game map, where 0 represents an empty space and 1 represents an obstacle. The task is to find the minimum number of moves required to move a block from the top-left corner to the bottom-right corner of the board. The block can move horizontally or vertically, but it can also rota... | glaive | [
0.025339601561427116,
0.01974882185459137,
-0.035504188388586044,
-0.03844066709280014,
0.043071579188108444,
-0.0022225601132959127,
-0.04442179203033447,
0.04309910535812378,
0.0315626859664917,
-0.02138882875442505,
0.020047079771757126,
0.012990078888833523,
-0.029778700321912766,
-0.0... | 0.846666 | 0.789057 | 0.057609 |
You are studying the genetic variation in two closely related species of fish, red fish and blue fish. You want to estimate the historical relationship between these two species and the time of their divergence. You have collected information about the divergence of a third species, black fish, and the heterozygosity w... | glaive | [
0.009239207953214645,
0.012595382519066334,
-0.05487670376896858,
-0.029232099652290344,
0.017828958109021187,
-0.02560991235077381,
-0.04511825740337372,
0.05935044586658478,
0.05919475108385086,
-0.009228067472577095,
0.015353575348854065,
0.004793909844011068,
-0.029118092730641365,
0.0... | 0.777664 | 0.758243 | 0.019421 |
You are tasked with writing a C/C++ program that reads a natural number n (where n < 100) from the keyboard, followed by n triplets of integers representing the coordinates and radii of n circles. The program should then display the coordinates of the circle centers in ascending order of their radii. | glaive | [
0.02713099867105484,
0.03281422331929207,
-0.032473526895046234,
-0.02684204652905464,
0.03007209487259388,
-0.015774093568325043,
-0.03789711743593216,
0.04365845024585724,
0.0390423983335495,
-0.011883494444191456,
0.028961487114429474,
0.03916246071457863,
-0.040477119386196136,
-0.0182... | 0.824869 | 0.793853 | 0.031016 |
Can you provide a solution to rotate an array by k places? | glaive | [
0.012519961223006248,
0.04152863472700119,
-0.028970642015337944,
-0.01584676094353199,
0.01468572486191988,
-0.03403405845165253,
-0.018617181107401848,
0.03170663118362427,
0.03194417804479599,
-0.027185877785086632,
0.016905684024095535,
0.018748978152871132,
-0.03609811142086983,
-0.02... | 0.798102 | 0.776042 | 0.02206 |
You are tasked with creating a CUDA program that calculates the sum of two large arrays in parallel. The program should define a function that takes in two arrays of integers and their length, and uses CUDA to compute the sum of the corresponding elements in parallel. The function should then return the resulting array... | glaive | [
-0.00037040418828837574,
0.05020734667778015,
-0.03801777586340904,
-0.021479807794094086,
0.02910895086824894,
0.004934508353471756,
-0.041429512202739716,
0.08390919864177704,
0.04647008702158928,
-0.02530599944293499,
0.014223383739590645,
0.04348794370889664,
-0.007375034037977457,
-0.... | 0.804713 | 0.780089 | 0.024625 |
You are required to draw a bar chart showing the number of patients at each of the four locations. Then, determine which location has the fewest patients. | glaive | [
0.020605789497494698,
0.027142174541950226,
-0.05052291601896286,
-0.03342261165380478,
0.0456274040043354,
-0.03571021929383278,
-0.02997378259897232,
0.042270202189683914,
0.05397883057594299,
-0.009311124682426453,
0.01343222800642252,
0.03911134600639343,
-0.004906145855784416,
-0.0076... | 0.777138 | 0.759113 | 0.018024 |
You are tasked with creating a Java program that utilizes Apache Hadoop's Hive SerDe2 Thrift to define and utilize two data structures. The first data structure is called IntString and consists of an integer (myint), a string (myString), and another integer (underscore_int). The second data structure is called Complex ... | glaive | [
0.01027247030287981,
0.012453370727598667,
-0.027499115094542503,
-0.02381909266114235,
0.023485267534852028,
-0.04852370545268059,
-0.013263040222227573,
0.05527600646018982,
0.036147523671388626,
-0.03508765622973442,
0.025630654767155647,
0.015154026448726654,
-0.03597251698374748,
-0.0... | 0.80631 | 0.790979 | 0.01533 |
I have a dataset with three columns A, B, and C, each containing a series of 1s and 0s. I need to find the counts of strings of contiguous numbers that are the same (run-length encoding) for each column. For example, in column C, there is only 1 run of 1s. I need to generate a new dataset showing the counts of contiguo... | glaive | [
0.01112462393939495,
0.0069941747933626175,
-0.05117921158671379,
-0.035230349749326706,
0.03698025271296501,
-0.023587670177221298,
-0.027691194787621498,
0.06260351836681366,
0.030016528442502022,
-0.03251267969608307,
0.005151192657649517,
0.013046841137111187,
-0.024746349081397057,
-0... | 0.81723 | 0.798425 | 0.018806 |
You are required to write a function replNZP_mapcar that takes a list as input and returns a new list with the elements replaced as follows:
- If the element is a list, call the replNZP_mapcar function recursively on the sublist
- If the element is not a number, return the element as is
- If the element is a positive n... | glaive | [
0.02714921161532402,
0.03339335322380066,
-0.005289935041218996,
-0.041417140513658524,
0.04352521896362305,
-0.03209824115037918,
0.013644123449921608,
0.051514800637960434,
0.030652107670903206,
-0.011781754903495312,
0.02325795777142048,
0.035671889781951904,
-0.023389805108308792,
-0.0... | 0.812427 | 0.797337 | 0.01509 |
You are tasked with creating a program to find the maximum value of a complex function over a specified range of input values.
Write a program that takes the input variables β and γ, and uses a nested loop to iterate through the specified range of values for β and γ. For each combination of β and γ, calculate the valu... | glaive | [
0.024283573031425476,
0.03549974039196968,
-0.04260179400444031,
-0.025634679943323135,
0.044292472302913666,
-0.025389693677425385,
-0.024357400834560394,
0.06318053603172302,
0.0388726182281971,
-0.0035198316909372807,
0.025028275325894356,
0.04961381107568741,
-0.04027455672621727,
-0.0... | 0.806586 | 0.771357 | 0.035228 |
You are tasked with creating a Python program that calculates the port diagonal of a given rectangle. The port diagonal is the longest diagonal within the rectangle, connecting two opposite corners. You need to write a function that takes the length and width of the rectangle as input and returns the port diagonal leng... | glaive | [
0.0067874169908463955,
0.0319066122174263,
-0.04601681977510452,
-0.05039745941758156,
0.0041514188051223755,
-0.01867944560945034,
-0.03290455788373947,
0.04607335105538368,
0.037922389805316925,
0.009935317561030388,
0.031125221401453018,
0.05447172373533249,
-0.01925082504749298,
-0.002... | 0.795599 | 0.764601 | 0.030998 |
You are required to create a new table with partitioning and insert data into it based on the given code snippet.
Create a new table named "FVT_COMPRESS_QWER.test_partition_for_null_list" with the following columns: a (integer), b (integer), c (integer), d (integer). The table should be partitioned by the 'a' column, ... | glaive | [
0.05220140516757965,
0.00418939720839262,
-0.03791731968522072,
-0.020044362172484398,
0.03344094753265381,
-0.02350356988608837,
0.027439948171377182,
0.0655422955751419,
0.04757554084062576,
-0.022485194727778435,
0.0008677113219164312,
0.022333145141601562,
-0.004561085719615221,
-0.003... | 0.809966 | 0.785828 | 0.024138 |
You are tasked with implementing a parallel quicksort algorithm using CUDA (GPU) for sorting an array of Hitable objects. The quicksort algorithm should be able to sort the array based on a specific index of the bounding boxes associated with the Hitable objects. The algorithm should make use of stack-based partitionin... | glaive | [
0.006970483809709549,
0.03577445447444916,
-0.0014992909273132682,
-0.006141218822449446,
0.017825284972786903,
-0.014429975301027298,
-0.04792805761098862,
0.07868747413158417,
0.03757947310805321,
-0.01992795057594776,
0.015580577775835991,
0.020540833473205566,
-0.002159661613404751,
0.... | 0.807422 | 0.783365 | 0.024057 |
You are tasked with implementing a function for exact division of a multi-precision number by a single limb. The function should be able to handle division operations of large numbers and should adhere to the GNU MP Library guidelines. The function should take the multi-precision number and the single limb as input and... | glaive | [
0.013961473479866982,
0.040004197508096695,
-0.028557751327753067,
-0.04218116030097008,
0.04162170737981796,
-0.025865469127893448,
-0.02473311498761177,
0.062286023050546646,
0.0288246963173151,
-0.02054842747747898,
0.017871804535388947,
0.03147337958216667,
-0.011904670856893063,
0.000... | 0.807534 | 0.787542 | 0.019992 |
You are tasked with implementing a function that takes in a set of info fields and/or numeric constants, and produces the product of the inputs. Missing INFO fields should be treated as ones unless all parameters are INFO fields and all are missing, in which case the output will be missing. The output field type should... | glaive | [
0.02788960374891758,
0.03200266510248184,
-0.0340314544737339,
-0.022814346477389336,
0.04971751570701599,
-0.01856660284101963,
-0.03708754852414131,
0.0606052465736866,
0.04163592681288719,
0.0009488715440966189,
0.016474146395921707,
0.045421045273542404,
-0.031440939754247665,
-0.02944... | 0.817304 | 0.793624 | 0.02368 |
You have been tasked with implementing a function in C++ that determines whether a given triangle overlaps with an axis-aligned bounding box (AABB). The function should take in the following inputs:
- `boxcenter`: an array of 3 floats representing the center of the box
- `boxhalfsize`: an array of 3 floats representing... | glaive | [
0.02048083022236824,
0.006879022344946861,
-0.018273325636982918,
-0.031118052080273628,
0.03606262430548668,
-0.001437160070054233,
-0.010240782983601093,
0.08379016816616058,
0.03354484587907791,
0.006435127928853035,
0.026007836684584618,
0.03846355155110359,
-0.0018247744301334023,
-0.... | 0.801383 | 0.772389 | 0.028995 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.