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
According to the definition available in CLRS 3rd edition, a singly connected directed graph is the one where for every pair of vertices (u,v) there is at most 1 unique path from u->v. Now most of the answers that I have read, state that we run DFS from every vertex in the graph and if in any case we find a Cross edge ...
glaive
[ -0.031057143583893776, 0.02842649258673191, -0.03570783883333206, -0.046011682599782944, 0.011933865956962109, -0.010617927648127079, -0.012491799890995026, 0.06015042960643768, 0.018984628841280937, 0.009944137185811996, 0.02989164926111698, 0.030441490933299065, -0.008897555060684681, 0....
0.779139
0.762389
0.01675
You are tasked with implementing a Fortran function to calculate the diffractive mass in high mass single/double diffractive events. The function should take in the center-of-mass energy (Ecm), Ib, and Mode as input parameters and return the diffractive mass. The function should consider specific kinematics of diffrac...
glaive
[ 0.023124761879444122, 0.03333055600523949, -0.015798792243003845, -0.0653219223022461, 0.034745216369628906, -0.0225635077804327, -0.026484064757823944, 0.078799769282341, 0.04447191208600998, 0.012767857871949673, -0.005628073588013649, 0.028667256236076355, -0.01913328655064106, -0.00725...
0.781767
0.766727
0.01504
You are tasked with implementing a Bayesian neural network model using the Stan programming language. The model consists of a decoder, an encoder, and parameters for the network. The data includes the size of the latent space (nz) and the batch size, as well as an array of binary values (x) with dimensions 28x28 for ea...
glaive
[ 0.025001056492328644, 0.0018861002754420042, -0.019571524113416672, -0.04081213101744652, 0.029908834025263786, -0.024360230192542076, -0.029769375920295715, 0.06085984781384468, 0.037645746022462845, -0.008604229427874088, 0.01259412057697773, 0.04407810419797897, -0.02494189143180847, 0....
0.78913
0.771134
0.017996
You are tasked with implementing a function that calculates the integral of a given function inside a unit ball (a ball with radius 1 and centered at the origin) in a 3-dimensional space. The function to be integrated is provided as an input and is guaranteed to be continuous over the entire space. Your task is to writ...
glaive
[ 0.014852607622742653, 0.04754484072327614, -0.044577863067388535, -0.03263193368911743, 0.04792867973446846, -0.003933439031243324, -0.030540281906723976, 0.04532938078045845, 0.04129279404878616, -0.0048223561607301235, 0.028219174593687057, 0.04108235985040665, -0.019650712609291077, -0....
0.806945
0.791625
0.015321
You are tasked with creating a SQL function that takes a salary as input and returns the corresponding salary level based on the following criteria: - If the salary is less than 30,000, the function should return 'Low' - If the salary is between 30,000 and 50,000 (inclusive), the function should return 'Average' - If t...
glaive
[ 0.0055988859385252, 0.03348925709724426, -0.0398959144949913, -0.03139283135533333, 0.03288711607456207, -0.021909313276410103, -0.03750498592853546, 0.06846924126148224, 0.04988129809498787, -0.009138324297964573, 0.06046232581138611, 0.042692944407463074, -0.0229021068662405, 0.007989620...
0.770313
0.751871
0.018442
You are tasked with creating a program to simulate a bingo game. The program should be able to generate bingo boards, call out numbers, and determine if a board has achieved a winning row or column. The program should include the following functionalities: 1. Create a function to parse a given board into a 2D array of...
glaive
[ 0.01310449093580246, 0.029306702315807343, -0.04472243785858154, -0.03603831306099892, 0.03228754550218582, -0.04701261594891548, -0.02062728814780712, 0.04924837127327919, 0.02404443547129631, 0.0017061191610991955, 0.012565363198518753, 0.045057762414216995, -0.03685469180345535, 0.01461...
0.80786
0.780518
0.027341
You are given a probability distribution function for the time it takes a financial series to complete a cycle. The probability distribution function ($f(x)$) is defined as $30x^2(1-x)^2$ for $0<x<1$. Your task is to implement the following operations: 1. Verify if the probability distribution function is well defined...
glaive
[ -0.006880760192871094, 0.013664381578564644, -0.05107220634818077, -0.027555430307984352, 0.038029272109270096, -0.018408672884106636, -0.027493037283420563, 0.08444325625896454, 0.03798620402812958, 0.015344889834523201, 0.012860547751188278, 0.024054421111941338, -0.012945917434990406, -...
0.795838
0.765076
0.030762
You are tasked with implementing a program that simulates a biased coin flip using the Bernoulli distribution. The program should generate a random number based on a given probability and output either a success or failure based on the result of the coin flip.
glaive
[ -0.015215697698295116, 0.02279093861579895, -0.02826821058988571, -0.02971736714243889, 0.029832083731889725, -0.01720891147851944, -0.03048834390938282, 0.05832758918404579, 0.035930756479501724, -0.02788025327026844, 0.02337886020541191, 0.0467865876853466, -0.02090691216289997, -0.00179...
0.796589
0.77467
0.021919
You are tasked with implementing a vertex shader in OpenGL (using version 330 core) that takes in the following inputs: - vec3 position - vec2 textureCoord - vec3 normal The shader needs to calculate the following outputs: - fragPos: the position of the vertex in view space - texCoords: the texture coordinates multipl...
glaive
[ 0.023880820721387863, 0.03676937520503998, -0.02066616900265217, -0.051288507878780365, 0.02819862589240074, -0.056062426418066025, -0.033893801271915436, 0.08135096728801727, 0.041039641946554184, -0.01853080838918686, 0.03883421793580055, 0.023238271474838257, 0.002237462904304266, -0.01...
0.784498
0.769615
0.014884
You are tasked with creating a program that calculates the objective value based on a set of variables and their respective values. The objective value should be equal to 15. The variables and their corresponding values are as follows: e11 = 0 e12 = 0 e13 = 0 e14 = 2 e21 = 0 e22 = 0 e23 = 1 e24 = 1 e31 = 1 e32 = 0 e33 ...
glaive
[ 0.01411550585180521, 0.01645997352898121, -0.04669720306992531, -0.03338104486465454, 0.06798569858074188, -0.031753141433000565, -0.022300316020846367, 0.05996129661798477, 0.03193410858511925, -0.01083808671683073, 0.0302437711507082, 0.02346966415643692, -0.0429878756403923, -0.01475638...
0.805715
0.778261
0.027454
You are required to write a program that calculates the probability of a quantum state resulting from a given set of quantum amplitudes. The program should use the provided amplitude function and then find the maximum probability using simulated annealing optimization method. Finally, the program should plot the 3D and...
glaive
[ 0.007068906910717487, 0.03335971757769585, -0.03346578776836395, -0.029407517984509468, 0.03742695972323418, -0.02557484433054924, -0.031010525301098824, 0.07498026639223099, 0.03303590789437294, -0.012438306584954262, 0.019346212968230247, 0.03424948453903198, -0.017771035432815552, -0.01...
0.809323
0.783278
0.026045
You are tasked with implementing a periodically forced system in Fortran. The system is described by the following set of differential equations: F(1) = ( V*(V-A)*(1-V) - W )/EPS F(2) = V - D*W - ( B + R*X ) F(3) = X + BET*Y - X*(X**2 + Y**2) F(4) = -BET*X + Y - Y*(X**2 + Y**2) Where the parameters A, B, R, E...
glaive
[ 0.026398712769150734, 0.017858406528830528, -0.03876269608736038, -0.04242828115820885, 0.03324209898710251, -0.04358310624957085, -0.006760097108781338, 0.08065161108970642, 0.023537689819931984, 0.004963412415236235, 0.01666523888707161, 0.06738005578517914, -0.024595068767666817, -0.016...
0.801655
0.781376
0.020279
You are tasked with implementing a function that accepts another function and a list of numbers. The function should then apply the given function to the list of numbers, and continue applying the function to the results as long as the function returns a number. When the function returns false, the loop should stop. W...
glaive
[ 0.013723527081310749, 0.03244822844862938, -0.037001755088567734, -0.02206568606197834, 0.03312176093459129, -0.014345471747219563, -0.012606825679540634, 0.08209080249071121, 0.020763061940670013, -0.00025365332840010524, 0.02322007156908512, 0.0515570230782032, -0.015153366141021252, -0....
0.823205
0.801076
0.022129
You are tasked with creating a C# program that calculates the area of a rectangle. The program should prompt the user to input the length and width of the rectangle and then calculate and display the area of the rectangle.
glaive
[ 0.010272450745105743, 0.04355423524975777, -0.036838099360466, -0.03764105588197708, 0.012648203410208225, -0.034977108240127563, -0.019546762108802795, 0.07947853207588196, 0.05681586638092995, -0.015462201088666916, 0.0270711537450552, 0.04832741245627403, -0.03731442242860794, -0.033453...
0.775577
0.75842
0.017157
You are tasked with creating a program that reads from a file and parses through the data using delimiters. The delimiters are defined as pairs of start and end characters with corresponding values. The program should calculate a score based on the parsed data and output the median score. The program should open the f...
glaive
[ 0.0044695003889501095, 0.0007468997500836849, -0.05007760971784592, -0.04071066528558731, 0.046963561326265335, -0.031827934086322784, -0.026259029284119606, 0.057254139333963394, 0.03570374846458435, -0.019308650866150856, 0.017831699922680855, 0.01432106178253889, -0.027713831514120102, ...
0.805034
0.776673
0.028361
You are tasked with implementing a CUDA kernel function for finding the index of the maximum value in a given input array along a specified axis. The input array is of type T and has dimensions (count, outside, inside, dim), where count represents the total number of elements, outside and inside represent the outer and...
glaive
[ 0.025707127526402473, 0.058211248368024826, -0.02354872040450573, -0.01686950773000717, 0.030810540542006493, -0.014786851592361927, -0.03752972185611725, 0.07839588075876236, 0.03514936938881874, -0.012712900526821613, 0.02951749972999096, 0.03833756968379021, -0.009424380958080292, 0.010...
0.814031
0.77819
0.035841
You are tasked with implementing a CUDA function to sort the top k elements of an input array in descending order. The function should take in the following parameters: - d_keys_in: Pointer to the input array to be sorted - num_items: Number of elements in the input array - k: Number of top elements to be sorted - d_ke...
glaive
[ 0.033083319664001465, 0.05420851334929466, -0.02015470154583454, -0.014289654791355133, 0.03131366893649101, -0.01763048954308033, -0.030602460727095604, 0.08287742733955383, 0.03037148341536522, -0.002625267021358013, 0.02748420462012291, 0.02696310169994831, -0.01091428566724062, 0.01770...
0.812416
0.784322
0.028093
You are tasked with implementing the quantile normalization method for preprocessing data. Quantile normalization is a non-parametric method that aims to normalize data so that samples containing the data can be compared. The method involves the following steps: 1. Sort the data 2. Calculate the average 3. Reassign ne...
glaive
[ -0.004236407577991486, 0.0071712033823132515, -0.014939656481146812, -0.04580286145210266, 0.03153577446937561, -0.03551691770553589, 0.0012297633802518249, 0.0483304001390934, 0.04375264421105385, -0.01720072329044342, 0.022335298359394073, 0.01134719792753458, -0.03672393783926964, -0.01...
0.786381
0.769807
0.016574
You are working with the `int` data type in a programming language. You need to implement two functions `succ` and `pred` to calculate the successor and predecessor of an integer, respectively. The `succ` function should add 1 to the given integer, while the `pred` function should subtract 1 from the given integer. You...
glaive
[ 0.020243555307388306, 0.03176555037498474, -0.029075803235173225, -0.03995604068040848, 0.04514075815677643, -0.02818240597844124, -0.024642227217555046, 0.0813208669424057, 0.04332525655627251, -0.02952839620411396, 0.034195441752672195, 0.04450486600399017, -0.025350678712129593, -0.0056...
0.833125
0.80355
0.029575
You are tasked with writing a program that calculates the shortest distances from a given starting node to all other nodes in an undirected graph. The graph is represented as an adjacency matrix, where a value of 1 at m[i][j] indicates an edge between nodes i and j. The distance between connected nodes is 6. The progra...
glaive
[ 0.015451265498995781, 0.02414902113378048, -0.03230554610490799, -0.030042603611946106, 0.05171753466129303, -0.01432885229587555, -0.041279565542936325, 0.043597668409347534, 0.044651955366134644, -0.02444099634885788, 0.03554418310523033, 0.019276442006230354, -0.014371940866112709, -0.0...
0.830244
0.774028
0.056216
You are tasked with creating a function in Kotlin that takes in a list of integers and returns the sum of all the even numbers in the list. The function should be named "calculateEvenSum" and should be placed in a separate file called "MathUtils.kt". The function should take a list of integers as input and return the s...
glaive
[ 0.015412775799632072, 0.018431425094604492, -0.019226888194680214, -0.06577970087528229, 0.04841925576329231, -0.016887258738279343, -0.007757881656289101, 0.036065999418497086, 0.02949577569961548, -0.021819904446601868, 0.01226251944899559, 0.042245958000421524, -0.03553507849574089, -0....
0.8062
0.77431
0.03189
You are tasked with implementing a CUDA kernel that generates random values according to the Poisson distribution. The kernel should take in an array of floats representing the mean of the distribution and an array of integers to store the generated Poisson-distributed values. Additionally, the kernel should utilize th...
glaive
[ 0.004889517556875944, 0.039788950234651566, -0.010227693244814873, -0.03400018438696861, 0.020235532894730568, -0.020337412133812904, -0.021432435140013695, 0.08651597797870636, 0.03513694927096367, -0.01639227755367756, 0.03132662922143936, 0.04479021206498146, -0.004494525026530027, -0.0...
0.800269
0.779361
0.020908
You are tasked with creating a PowerShell script that can determine whether a given number is prime or not. Your script should take a single integer input and output a message indicating whether the number is prime or not.
glaive
[ 0.021476807072758675, 0.016736933961510658, -0.0060239736922085285, -0.030987901613116264, 0.020718662068247795, -0.033620163798332214, 0.02611294761300087, 0.08536868542432785, 0.04246113821864128, -0.010986307635903358, 0.027277624234557152, 0.016528766602277756, -0.027714742347598076, -...
0.798761
0.781156
0.017604
You are tasked with implementing a CUDA kernel that calculates the depth of a given dataset using the multigpuBD2 function. The function takes in the number of rows, number of columns, the dataset, and an array to store the depth values. The depth of a dataset is calculated based on the number of pairs of rows where al...
glaive
[ 0.002151960739865899, 0.031112249940633774, -0.03454224020242691, -0.029031243175268173, 0.025273505598306656, -0.015753023326396942, -0.027532748878002167, 0.06757527589797974, 0.037749819457530975, -0.025365125387907028, 0.03133130446076393, 0.0419066920876503, -0.006974535062909126, 0.0...
0.801215
0.781647
0.019568
Write a program to calculate the sequence defined by the following recurrence relation: a(n) = a(n-1) * 2 - a(n-2) with initial values a(0) = -2 and a(1) = 0. Your program should take an input n and output the value of a(n).
glaive
[ 0.025270001962780952, 0.03295885771512985, -0.0321020744740963, -0.024502737447619438, 0.02808510512113571, -0.015258947387337685, -0.02082451991736889, 0.08643839508295059, 0.03309877589344978, -0.02254643850028515, 0.022920044139027596, 0.035075269639492035, -0.0400816984474659, -0.01593...
0.833901
0.789446
0.044455
Write a function to implement a list_to_integer and string:to_integer function. The function should take a string as input and return the integer value of the string if it represents a valid integer. If the string does not represent a valid integer, the function should return an error. For example, if the input string ...
glaive
[ 0.02441312000155449, 0.030551183968782425, -0.006251361221075058, -0.06093825027346611, 0.04773058742284775, -0.03933625668287277, -0.008922687731683254, 0.03310595825314522, 0.025400051847100258, -0.006687484215945005, 0.02867637760937214, 0.034321002662181854, -0.017441635951399803, -0.0...
0.806495
0.782746
0.023749
You are tasked with implementing a clustering algorithm using the PAM (Partitioning Around Medoids) method in Common Lisp. The PAM algorithm requires the following parameters to be set: - Medoids count - Distance matrix - Split threshold - Merge threshold - Select medoids attempts count - Split-merge attempts count Yo...
glaive
[ 0.023149292916059494, 0.012809940613806248, -0.019869033247232437, -0.037937551736831665, 0.034428589046001434, -0.008827406913042068, -0.01630229875445366, 0.04958895593881607, 0.033184804022312164, 0.008965273387730122, 0.01768626645207405, 0.03732835128903389, -0.022284097969532013, -0....
0.813406
0.797019
0.016388
You are tasked with creating a program that multiplies two matrices using CUDA for GPU and OpenMP for CPU parallel processing. The matrices are of size MATRIXSIZE x MATRIXSIZE, and the multiplication process involves both regular matrix multiplication and matrix multiplication with tiles. The program should use CUDA to...
glaive
[ 0.016160424798727036, 0.04986538365483284, -0.01920972391963005, -0.02338506281375885, 0.03198277950286865, -0.008335685357451439, -0.03973037376999855, 0.08988195657730103, 0.03366513550281525, -0.0371130146086216, 0.012546881102025509, 0.022825242951512337, -0.010609971359372139, -0.0118...
0.798104
0.775058
0.023046
You are tasked with implementing a Lie algebra extension and restriction of scalars for a given Lie algebra `L` over a commutative ring `R` and an algebra `A` over `R`. The goal is to define the Lie bracket on the extension of `L` over `R` by `A` and the Lie bracket on the restriction of `L` to an algebra `A` over `R`....
glaive
[ 0.03653540089726448, 0.04419800639152527, -0.02678060159087181, -0.032742999494075775, 0.03048628382384777, -0.017619149759411812, -0.010741724632680416, 0.08642812818288803, 0.04624018445611, -0.009987174533307552, -0.006184552796185017, 0.02678055875003338, -0.04595717787742615, -0.00614...
0.785682
0.768325
0.017357
You are tasked with implementing a function that computes the derivatives for a given set of source points and their corresponding covariance matrices in a CUDA environment. The function should take in the following parameters: - src_points: A device vector of Eigen::Vector3f representing the source points - src_covs: ...
glaive
[ -0.007565720938146114, 0.03922256454825401, -0.03391546383500099, -0.03199135884642601, 0.04107825458049774, -0.016632698476314545, -0.027904123067855835, 0.08949624747037888, 0.05510173738002777, -0.006745775695890188, 0.011550542898476124, 0.04169517382979393, -0.007413854356855154, -0.0...
0.789539
0.774491
0.015048
You are tasked with implementing a two-dimensional cellular automaton based on the 5-celled von Neumann neighborhood. The automaton follows "Rule 1" and at each stage of growth, you need to calculate the decimal representation of the x-axis from the left edge to the origin. The output for the first few stages of growth...
glaive
[ 0.005362647119909525, 0.01644960790872574, -0.03856021910905838, -0.040806811302900314, 0.01643715798854828, -0.019568979740142822, -0.041133083403110504, 0.08447761088609695, 0.021381618455052376, -0.015151405707001686, 0.027814457193017006, 0.030826369300484657, -0.043115995824337006, -0...
0.825309
0.787005
0.038304
You are tasked with implementing a periodic boundary conditions function for a 2-dimensional Ising model. The function should choose the correct grid index with periodic boundary conditions. You will need to create a function that takes in a base index, the highest "legal" index, and a number to add or subtract from th...
glaive
[ 0.016987605020403862, 0.028830165043473244, -0.032756317406892776, -0.016239862889051437, 0.023090748116374016, -0.040608733892440796, -0.04070615768432617, 0.08308073878288269, 0.020692043006420135, 0.014757368713617325, 0.009927102364599705, 0.034269873052835464, -0.008719239383935928, 0...
0.804689
0.785223
0.019466
How can I add a function to find the maximum number among a given set of numbers?
glaive
[ 0.036962058395147324, 0.025384947657585144, -0.0300673209130764, -0.019389942288398743, 0.05295218154788017, -0.012007630430161953, -0.02089633233845234, 0.032881490886211395, 0.018466506153345108, -0.017091818153858185, 0.00600021006539464, 0.0458640493452549, -0.04614768922328949, -0.011...
0.795809
0.772305
0.023504
How can I create an algorithm that returns the index of the maximum value in an array?
glaive
[ 0.02739826589822769, 0.02894156239926815, -0.030849969014525414, -0.022301247343420982, 0.027938978746533394, -0.03391830623149872, -0.04293541610240936, 0.05279793590307236, 0.020307768136262894, -0.038917385041713715, 0.030608858913183212, 0.025594213977456093, -0.029633529484272003, -0....
0.80149
0.781029
0.02046
You are tasked with creating a program that calculates the number of vectors of length `n` that are symmetric about the middle, where each element is drawn from a set of `n` distinct elements. The program should take an input `n` and output the number of such symmetric vectors. For example, if `n = 3`, the program sho...
glaive
[ 0.03398741036653519, 0.026775097474455833, -0.05191214382648468, -0.022796209901571274, 0.026505064219236374, -0.002101261168718338, -0.03782783821225166, 0.06232539191842079, 0.042270563542842865, -0.02758655697107315, 0.0030166914220899343, 0.03596068173646927, -0.027157898992300034, -0....
0.837798
0.779138
0.058661
You are tasked with creating a TNumberBox in Delphi that includes specific features and functionalities. The TNumberBox should have the following properties and behaviors: - Accept Expressions: The TNumberBox should be able to accept mathematical expressions as input. - AutoSize: The TNumberBox should automatically adj...
glaive
[ 0.021181566640734673, 0.02081828936934471, -0.03377891331911087, -0.04747820273041725, 0.06313233077526093, -0.025991059839725494, -0.007508127950131893, 0.06975698471069336, 0.046897634863853455, 0.004473534412682056, 0.03543473780155182, 0.04396829754114151, -0.022545021027326584, -0.005...
0.793932
0.778152
0.015779
You are tasked with creating a program that reads a file containing a list of numbers and performs calculations based on those numbers. The file contains a single line with comma-separated numbers. The program should calculate the "globally closest" numbers based on two different fuel cost functions and determine the m...
glaive
[ 0.013844508677721024, 0.03727442026138306, -0.021688276901841164, -0.03441815823316574, 0.028429558500647545, -0.04147830232977867, -0.02370259165763855, 0.05448751151561737, 0.03315199539065361, -0.019477298483252525, 0.023932907730340958, 0.03291650116443634, -0.009493891149759293, 0.001...
0.816408
0.784186
0.032221
I need to create a program that simulates two buckets of different sizes being filled, emptied, and poured into each other until a specific target amount of liquid is reached in one of the buckets. The buckets are represented as two types: One and Two. Each bucket has a contents and a size, and can be either filled, em...
glaive
[ 0.011182902380824089, 0.02060248889029026, -0.03571734204888344, -0.03095436468720436, 0.0407242514193058, -0.036524467170238495, -0.032223936170339584, 0.06788510829210281, 0.021044675260782242, -0.04167516529560089, 0.04154285043478012, 0.055080968886613846, -0.03270123526453972, -0.0117...
0.808128
0.790201
0.017926
You are tasked with writing a program in version 6.0 that takes two arguments, A and B, and performs a specific operation on the matrix defined by A. The program should first check if A and B are not empty and if there are no additional arguments provided. If so, the program should proceed to convert the matrix defined...
glaive
[ 0.03653782606124878, 0.03390305116772652, -0.03005298599600792, -0.012744499370455742, 0.04802205041050911, -0.019367974251508713, -0.006994002498686314, 0.07420910149812698, 0.03205826133489609, -0.03258321061730385, 0.008230259642004967, 0.037362705916166306, -0.014486945234239101, -0.01...
0.81171
0.793501
0.01821
You are tasked with implementing a Prolog module that provides various predicates for checking the occurrence of terms and variables in other terms. The module should include the following predicates: - contains_term/2: Succeeds if Sub is contained in Term (=, deterministically) - contains_var/2: Succeeds if Sub is con...
glaive
[ 0.012377291917800903, 0.013686638325452805, -0.030807971954345703, -0.022966668009757996, 0.033333420753479004, -0.01900908164680004, -0.004359363578259945, 0.06120561808347702, 0.026514679193496704, -0.010638323612511158, 0.010122482664883137, 0.04249031841754913, 0.002333092736080289, 0....
0.812627
0.79394
0.018686
You are tasked with creating a program that involves the following components: - A type T with an allocatable integer array acc - An integer variable n - Three integer variables: lb, ub, and vec(9) - Two instances of type T: o1 and o2 - An array vec with values from 1 to 9 - Allocating o1%acc with the values from vec -...
glaive
[ 0.026706984266638756, 0.03612460941076279, -0.040697481483221054, -0.023221330717206, 0.03439611196517944, -0.033153433352708817, -0.022073248401284218, 0.07400014251470566, 0.031625986099243164, -0.018963972106575966, 0.02430654503405094, 0.03581451252102852, -0.031623441725969315, -0.005...
0.83834
0.793808
0.044533
You are tasked with writing a program to generate a sequence of numbers according to the following rules: - The sequence starts with 1, 1 - For any even index n (starting from 2), the value at that index is 0 - For any odd index n (starting from 3), the value at that index is the factorial of n, except for when n = 2, ...
glaive
[ 0.01852487586438656, 0.02531139925122261, -0.0183725543320179, -0.030405547469854355, 0.02479715645313263, -0.022705797106027603, -0.030854035168886185, 0.054861731827259064, 0.02876807190477848, -0.04650043323636055, 0.032668326050043106, 0.04882705956697464, -0.050967756658792496, -0.001...
0.825989
0.780722
0.045267
You are tasked with implementing a package in Go for geometric calculations. The package should include functions to find the minimum distance between a set of points using both brute force and divide and conquer algorithms, as well as to find the extreme points of the convex hull of a set of points. Write a function ...
glaive
[ 0.0166925061494112, 0.040498849004507065, -0.02052486315369606, -0.04137149080634117, 0.03241179883480072, -0.023328199982643127, -0.028112133964896202, 0.04785711318254471, 0.05424122512340546, -0.01597493886947632, 0.01839006505906582, 0.03236841782927513, -0.02810394950211048, -0.001635...
0.817724
0.791555
0.026168
How can I classify the following instruction - "Identify all users in the users table by their status"?
glaive
[ 0.0364905521273613, 0.032069165259599686, -0.024098990485072136, -0.025754576548933983, 0.01627986505627632, -0.02754449099302292, -0.0007564660627394915, 0.027234647423028946, 0.04117607697844505, -0.018571989610791206, 0.02222953923046589, 0.022190695628523827, -0.011338390409946442, -0....
0.776503
0.752253
0.02425
You are tasked with implementing a quicksort algorithm in Scheme. Quick sort is a sorting algorithm that uses a divide-and-conquer strategy to sort an array. It works by selecting a 'pivot' element from the array and partitioning the other elements into two sub-arrays according to whether they are less than or greater ...
glaive
[ 0.027464736253023148, 0.021343283355236053, -0.0020778777543455362, -0.022876877337694168, 0.03182727098464966, -0.0334896445274353, -0.034230973571538925, 0.06477144360542297, 0.028071166947484016, -0.002162463264539838, 0.02408052235841751, 0.026731882244348526, -0.023761069402098656, 0....
0.807819
0.77911
0.028708
You have been tasked with analyzing weighted survey data using the SAS programming language. The dataset "wdc02.sas7bdat" contains information on participants' smoking habits, including the variable "smoke100" which indicates whether a participant has smoked at least 100 cigarettes in their lifetime. Your task is to us...
glaive
[ -0.0011243491899222136, 0.013757435604929924, -0.05139641463756561, -0.060204748064279556, 0.026529882103204727, -0.016801176592707634, 0.01234249584376812, 0.07024246454238892, 0.0542767234146595, 0.00685584731400013, 0.030044658109545708, 0.031328991055488586, 0.002667197724804282, -0.00...
0.788965
0.774386
0.014578
You are given a set of chains and their respective reads, along with a list of MEMs (Maximal Exact Matches) for a chunk of reads. You need to write a CUDA kernel to compute the coverage for each chain in the set based on the MEMs. The coverage for a chain is defined as the total length covered by its MEMs. You also nee...
glaive
[ 0.014673150144517422, 0.03397411108016968, -0.02639741078019142, -0.0273605789989233, 0.03067929670214653, -0.031899262219667435, -0.027187529951334, 0.06953936070203781, 0.025542818009853363, -0.020846212282776833, 0.02890404500067234, 0.03215169161558151, -0.001246628351509571, -0.008071...
0.81535
0.799761
0.015589
You are tasked with implementing a CUDA kernel to perform stream compaction on a given bitmap. The bitmap contains a set of 32-bit registers, each representing a set of 32 bits. Your goal is to extract the IDs of the set bits from the bitmap and store them in a compaction buffer. The compaction buffer should contain al...
glaive
[ -0.0012031099759042263, 0.047501325607299805, -0.02179289609193802, -0.010891557671129704, 0.03468099609017372, -0.012706602923572063, -0.019938673824071884, 0.09864570200443268, 0.055404920130968094, -0.010206010192632675, 0.031842898577451706, 0.008138221688568592, -0.010433968156576157, ...
0.80692
0.78825
0.018669
You are tasked with creating a function in the same framework and technology as the given code snippet. The function, named "countdown", should take in a positive integer parameter "countdown" and print a countdown from that number to 1, with each number printed on a new line. After the countdown is complete, the funct...
glaive
[ 0.03143174946308136, 0.04564165696501732, -0.02711203694343567, -0.04233509302139282, 0.031768132001161575, -0.01875486597418785, -0.019939584657549858, 0.05906272307038307, 0.05456140264868736, -0.017740391194820404, 0.02253243327140808, 0.04613746330142021, -0.014674540609121323, 0.01518...
0.796733
0.776303
0.02043
How can I write a Java code to find the maximum number from two input numbers?
glaive
[ 0.012093523517251015, 0.015162525698542595, -0.03396886587142944, -0.018395250663161278, 0.023968888446688652, -0.02370642125606537, -0.010786019265651703, 0.02853121981024742, 0.0317189022898674, -0.0471828319132328, 0.02738908678293228, 0.04591098427772522, -0.041001494973897934, -0.0072...
0.798546
0.781903
0.016643
You are tasked with implementing a program to calculate the sequence defined by the following recursive formula: a(n) = ((1+4*sqrt(2))*(2+2*sqrt(2))^n + (1-4*sqrt(2))*(2-2*sqrt(2))^n)/2 Your program should take an input n and output the corresponding value of a(n) in the sequence.
glaive
[ 0.028198808431625366, 0.04682886227965355, -0.026189209893345833, -0.03292445093393326, 0.025176826864480972, -0.020259123295545578, -0.04102042689919472, 0.0753079205751419, 0.03580155968666077, -0.015564042143523693, 0.026634223759174347, 0.04092854633927345, -0.03803813084959984, -0.016...
0.833392
0.778536
0.054855
You are tasked with creating a program that utilizes the following data structures and functions: - An integer variable, d_int - A matrix of size d_int by d_int, d_matrix - A vector of size d_int, d_vector - A row vector of size d_int, d_row_vector - A function int_step() that takes an integer input and returns an inte...
glaive
[ 0.019067198038101196, 0.024745561182498932, -0.031070517376065254, -0.051017746329307556, 0.04486541450023651, -0.014350722543895245, -0.023587007075548172, 0.08185085654258728, 0.0330970324575901, -0.0018347932491451502, 0.010986896231770515, 0.031989891082048416, -0.031020119786262512, -...
0.819581
0.788618
0.030963
You are tasked with implementing a CUDA kernel that performs reduction on an array of elements. The reduction operation combines all the elements of the input array to produce a single output value. The input array is of type T and has a length of n. The output array is also of type T and has a single element. The redu...
glaive
[ 0.005469211842864752, 0.05975044146180153, -0.026095114648342133, -0.014388322830200195, 0.04481417313218117, -0.004346252419054508, -0.02131584659218788, 0.11373808979988098, 0.055296555161476135, -0.002588191069662571, 0.02280944027006626, 0.03163716197013855, -0.006312503479421139, 0.00...
0.811203
0.781863
0.02934
You are tasked with creating a function that determines whether a given number 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 function should take an input integer `n` and return true if `n` is a prime number, and false otherwise.
glaive
[ 0.02715391479432583, 0.02264431305229664, -0.014119638130068779, -0.03374408185482025, 0.0368427038192749, -0.03189511597156525, 0.014889013022184372, 0.06742236018180847, 0.026971979066729546, -0.001326383207924664, 0.014045425690710545, 0.024076038971543312, -0.03118767775595188, -0.0267...
0.801643
0.759537
0.042106
You are tasked with implementing a method to find the difference between two maps in a given programming language. The method should take two maps as input and return a new map containing the elements that are present in the first map but not in the second map. For example, given the following two maps: Map 1: {"one":...
glaive
[ 0.03772813081741333, 0.025838375091552734, -0.01478563155978918, -0.024501988664269447, 0.03864322230219841, -0.021396806463599205, -0.011448904871940613, 0.0833880677819252, 0.04467210918664932, -0.030029816552996635, 0.034945543855428696, 0.01592901721596718, -0.01989971660077572, -0.003...
0.804606
0.788708
0.015899
You are tasked with creating a program that calculates the probability and visualizes the results of a quantum system with a given number of qubits and states. The program should include functions to calculate the amplitude and probability of the system, as well as to find the maximum probability and display 3D and con...
glaive
[ 0.009182623587548733, 0.02511250600218773, -0.03491664305329323, -0.021228555589914322, 0.04917169734835625, -0.03199831768870354, -0.03381664678454399, 0.06480033695697784, 0.0363394133746624, -0.0032394183799624443, 0.02747942879796028, 0.041982464492321014, -0.010119319893419743, -0.019...
0.797888
0.774856
0.023033
You are tasked with creating a program that calculates the probability of a quantum state for a given set of quantum parameters. The program should also include a function to visualize the probability distribution in a 3D plot and a contour plot. Create a function that takes two input variables x and y and calculates ...
glaive
[ -0.003916145768016577, 0.03759249299764633, -0.03286021947860718, -0.018751515075564384, 0.04604526609182358, -0.0186616238206625, -0.02138500101864338, 0.07796162366867065, 0.04147852957248688, 0.010400045663118362, 0.025197679176926613, 0.04533854126930237, -0.01939757540822029, -0.01047...
0.792151
0.764535
0.027616
Can an AI classify the given statement as either True or False?
glaive
[ 0.03388210013508797, 0.025083232671022415, -0.01169152744114399, -0.03562833368778229, 0.035041987895965576, -0.04399386793375015, 0.003509158967062831, 0.09700513631105423, 0.03775864094495773, -0.03394380956888199, 0.010002067312598228, 0.024501295760273933, -0.005433565471321344, -0.024...
0.77596
0.759314
0.016646
You are tasked with implementing a Python program that works with complex numbers as C structures. You need to create functions that perform various operations on complex numbers using the C representation provided. Specifically, you need to implement the following functions: - A function that returns the sum of two co...
glaive
[ 0.020268317312002182, 0.03758373111486435, -0.03645007312297821, -0.028957156464457512, 0.03712370619177818, -0.03472234308719635, -0.009488897398114204, 0.06409383565187454, 0.04870719462633133, -0.008543802425265312, 0.024804100394248962, 0.04846925288438797, -0.028901847079396248, -0.00...
0.795615
0.777998
0.017617
You are tasked with creating a program that calculates the probability of a quantum state using a given amplitude function. The amplitude function takes in two parameters, x and y, and is defined as follows: amplitude[x_,y_] := (big long function here) You need to write a probability function that takes in the same x...
glaive
[ 0.007786673028022051, 0.028508882969617844, -0.03573833405971527, -0.020190438255667686, 0.04061445593833923, -0.020863667130470276, -0.00917070358991623, 0.07039102911949158, 0.036704689264297485, 0.008064314723014832, 0.029968393966555595, 0.03832496702671051, -0.009715251624584198, -0.0...
0.793004
0.765724
0.02728
You are required to implement a subroutine for leap-frog advection using a fourth order centered in space algorithm. The subroutine should be able to compute the advection of U, V, and W by U, V, and W, respectively, at the current time level. The subroutine should also update statistical arrays with the fluxes derived...
glaive
[ -0.013529752381145954, 0.030990520492196083, -0.007690384518355131, -0.029813919216394424, 0.033362291753292084, -0.01682588830590248, -0.052758295089006424, 0.0690377876162529, 0.03360968828201294, 0.008727124892175198, 0.012833025306463242, 0.03489646688103676, -0.0012903105234727263, -0...
0.801491
0.782281
0.01921
You have been tasked with creating a program that can read and manipulate binary data. Specifically, you need to implement a function that takes a binary string and converts it to a sequence of bytes. Your function should be able to handle various types of binary data and accurately convert it to bytes without losing a...
glaive
[ -0.0024630040861666203, 0.04434278979897499, -0.007595923729240894, -0.03250303864479065, 0.031375396996736526, -0.06049823760986328, -0.013940134085714817, 0.05161600559949875, 0.044483501464128494, -0.012099117040634155, 0.013088800944387913, 0.038791459053754807, -0.02321823313832283, 0...
0.777782
0.761803
0.015979
You are tasked with implementing a model of biomolecule conformational variability and underlying free-energy landscape. The data is derived from a set of N cryo-EM images x[n], each of which is assumed to arise from a conformation z[n] in 1:M. The data is an N x M (right) stochastic matrix with entries Pmat[n, m] prop...
glaive
[ 0.0047860038466751575, 0.0009308869484812021, -0.02193651907145977, -0.04298947751522064, 0.030400924384593964, -0.016280829906463623, -0.021670827642083168, 0.053360629826784134, 0.02537086233496666, -0.01642160303890705, 0.012022115290164948, 0.030140208080410957, -0.02294256165623665, 0...
0.796775
0.778238
0.018538
You are tasked with implementing a CUDA function that calculates the distance matrix using the euclidean metric for a given data matrix. The function should take the data matrix as input and return a triangular matrix containing the pairwise distances. Additionally, you need to implement a test function that executes a...
glaive
[ 0.004363062791526318, 0.03911130875349045, -0.025590764358639717, -0.039254337549209595, 0.035472672432661057, -0.017440682277083397, -0.03474836051464081, 0.08776061981916428, 0.04795919731259346, -0.006251749116927385, 0.01987398974597454, 0.03336166962981224, 0.0054267412051558495, 0.00...
0.798773
0.780042
0.018732
You are tasked with implementing a CUDA kernel to compute homographies using the given code snippet as a reference. The goal is to create a function that takes in a set of coordinates and random points, and computes the homographies for each set of points. The input parameters for the function are: - `coord`: A pointer...
glaive
[ 0.003872098634019494, 0.04929603263735771, -0.008281396701931953, -0.013313550502061844, 0.020359912887215614, -0.01658516190946102, -0.024580148980021477, 0.0685049444437027, 0.05988185480237007, -0.011034143157303333, 0.022317171096801758, 0.04550072178244591, 0.00046835746616125107, 0.0...
0.80501
0.779633
0.025377
You are tasked with implementing a floating-point multiply-add function (fma) using the Zig programming language. The function fma takes three parameters x, y, and z and returns the result of x * y + z with a single rounding error. The function should support both 32-bit and 64-bit floating-point numbers. Additionally,...
glaive
[ 0.015704313293099403, 0.0344366729259491, -0.009232254698872566, -0.036615271121263504, 0.062347762286663055, -0.009183293208479881, -0.01460921112447977, 0.06779365241527557, 0.022121895104646683, -0.00913513358682394, 0.021823007613420486, 0.05011798068881035, -0.022910531610250473, -0.0...
0.800735
0.784795
0.015941
You are given a task to implement a program that processes a series of commands and calculates the distance and depth based on the given input. The input will consist of a series of lines, each representing a command in the following format: "<direction> <value>". The direction can be one of the following: "up", "down"...
glaive
[ 0.002815811662003398, 0.041764721274375916, -0.03804828226566315, -0.024220796301960945, 0.0424579493701458, -0.03506345674395561, -0.03756777569651604, 0.04833429306745529, 0.04003148898482323, -0.028262712061405182, 0.028482411056756973, 0.04854956269264221, -0.03122994489967823, -0.0204...
0.818492
0.7906
0.027893
You are tasked with implementing a function that interpolates a curve at a given point using a periodic spline under tension. The function should take in the following parameters: - A real value to be mapped onto the interpolating curve (T) - The number of points which were specified to determine the curve (N) - Arrays...
glaive
[ 0.011937513947486877, 0.017806701362133026, -0.031378746032714844, -0.03957771509885788, 0.03774666041135788, -0.04615691304206848, -0.00012265800614841282, 0.06605124473571777, 0.012811957858502865, 0.010697871446609497, 0.028041092678904533, 0.040478192269802094, -0.03087604232132435, 0....
0.780424
0.762428
0.017995
You are given the following problem: Given two polynomials a(x) and b(x) over a finite field GF(2), and a point P, you are asked to find the remainder when a(x) and b(x) are divided by (x - P) raised to the power i. Your task is to write a function that takes a, b, P, and i as input and returns the remainders ra and rb...
glaive
[ 0.041774000972509384, 0.0428941436111927, -0.027206428349018097, -0.05158400908112526, 0.02834080532193184, -0.039402641355991364, -0.01430209819227457, 0.05426592752337456, 0.05569431930780411, -0.013175907544791698, 0.007278934121131897, 0.04354770481586456, -0.03707295283675194, -0.0053...
0.806335
0.765626
0.040708
Write a program to create a list of alphabets based on the given criteria. The program should take the following parameters: - `Capitals`: A flag indicating whether to include capital letters in the list. - `Underscore`: A flag indicating whether to include an underscore in the list. - `Global(str)`: A global variable ...
glaive
[ 0.025019697844982147, 0.03122110478579998, 0.010782149620354176, -0.034832388162612915, 0.03779607638716698, -0.05435189977288246, -0.005159475840628147, 0.037514302879571915, 0.01733175292611122, -0.023194974288344383, 0.01802389696240425, 0.04227738827466965, -0.03091767616569996, -0.040...
0.787847
0.772709
0.015139
You are tasked with implementing a function to detect collision between a circle and a rectangle in a 2D space. The function should take the coordinates and dimensions of the rectangle, as well as the center and radius of the circle, and return true if a collision is detected, and false otherwise. The collision detecti...
glaive
[ -0.00002303715154994279, 0.04933576285839081, -0.017270363867282867, -0.031368035823106766, 0.03926554322242737, 0.014796864241361618, -0.02461952716112137, 0.06681019067764282, 0.047354187816381454, -0.009604747407138348, 0.028149431571364403, 0.029927821829915047, 0.008192508481442928, -...
0.783962
0.760761
0.023201
You are tasked with creating a program that can evaluate the exact mass of a chemical formula. Given a chemical formula as a string, you need to write a function that will calculate the exact mass of the formula. The chemical formula will consist of elements and their counts, for example "C6H12O6" represents glucose, w...
glaive
[ 0.032429445534944534, 0.029907546937465668, -0.02082698792219162, -0.06124693527817726, 0.05798589810729027, -0.07644037902355194, -0.002468046499416232, 0.07402032613754272, 0.03816871717572212, -0.010237671434879303, 0.01831982284784317, 0.01836281083524227, -0.02708662860095501, -0.0121...
0.773573
0.75434
0.019233
You are tasked with creating a program that checks if a given number is a prime number. A prime number is a natural number greater than 1 that is not a product of two smaller natural numbers. Your program should take an input integer and determine if it is a prime number or not. If the input is a prime number, the prog...
glaive
[ 0.030613325536251068, 0.013554723933339119, -0.01652848906815052, -0.03375217691063881, 0.03664974123239517, -0.036706648766994476, 0.019033273681998253, 0.07235401123762131, 0.03498123586177826, -0.019750207662582397, 0.021330907940864563, 0.02229520119726658, -0.029566440731287003, -0.02...
0.798718
0.762766
0.035951
Can you provide a solution to generate a program that prints all the pairs of elements from two lists, where each pair consists of elements at the same index?
glaive
[ 0.020079180598258972, 0.018817827105522156, -0.03164488077163696, -0.03356773406267166, 0.03401007503271103, -0.03483910486102104, -0.005215722136199474, 0.050102975219488144, 0.04706364497542381, -0.04857588931918144, 0.02274795062839985, 0.04189717769622803, -0.027987342327833176, -0.019...
0.810317
0.795755
0.014562
What is the Java code to take two integers as input and output the sum of them?
glaive
[ 0.002977126045152545, 0.023362156003713608, -0.04344142600893974, -0.03652054816484451, 0.027128471061587334, -0.02609339915215969, -0.018693648278713226, 0.0421479158103466, 0.036203525960445404, -0.047901395708322525, 0.027850273996591568, 0.04805022478103638, -0.03780941292643547, -0.03...
0.791352
0.776174
0.015178
You are tasked with simulating the behavior of an experimental coprocessor that is running a program with different instructions. The program is made up of the following instructions: * `set X Y` sets register `X` to the value of `Y`. * `sub X Y` decreases register `X` by the value of `Y`. * `mul X Y` sets register `X`...
glaive
[ 0.010945996269583702, 0.015685439109802246, -0.0260908380150795, -0.018548287451267242, 0.023644832894206047, -0.021705342456698418, -0.01958596333861351, 0.0967801958322525, 0.03855505585670471, -0.009667491540312767, 0.016328925266861916, 0.04301339015364647, -0.028225818648934364, -0.00...
0.824616
0.798663
0.025953
You are tasked with implementing a function in C++ that calculates the thread index for a GPU kernel using the given grid and block dimensions, and thread indices. The function should take into account the start index and return the final thread index. You need to create a function that satisfies the following signatur...
glaive
[ 0.015389898791909218, 0.049748316407203674, -0.0025610693264752626, -0.029268380254507065, 0.02534271404147148, -0.005363470874726772, -0.046463124454021454, 0.10490863770246506, 0.03370370715856552, -0.009682775475084782, 0.024976057931780815, 0.034022215753793716, -0.013149112462997437, ...
0.807607
0.784607
0.023
How can I create a recursive function in C++ that calculates the sum of the first N natural numbers?
glaive
[ 0.0008275605505332351, 0.023634282872080803, -0.020345663651823997, -0.03875758871436119, 0.04269839823246002, -0.0042626322247087955, -0.005992052145302296, 0.07990090548992157, 0.027037488296628, -0.020700603723526, 0.031429681926965714, 0.023155895993113518, -0.04456530511379242, -0.022...
0.799244
0.781849
0.017396
You are tasked with implementing a function that generates a sequence of numbers based on the following formula: a(n) = (9*n^3 + 5*n)/2. The function should take an input n and return the corresponding value of a(n). For example, for n = 1, the function should return 7; for n = 2, the function should return 41; and so ...
glaive
[ 0.0354815311729908, 0.03138295188546181, -0.03826908767223358, -0.03695741295814514, 0.029624180868268013, -0.027928076684474945, -0.04651602730154991, 0.07451725006103516, 0.027259429916739464, -0.009784466587007046, 0.029192322865128517, 0.04912899062037468, -0.049382638186216354, 0.0100...
0.82394
0.772227
0.051714
You are tasked with implementing a function to calculate the log density of the Clayton Bivariate Copula. The probability density function is defined as: c(u, v) = (θ + 1)(uv)^-(θ + 1)(u^-θ + v^-θ - 1)^(-2θ + 1/θ) Your task is to implement the clayton_copula_lpdf function, which takes in three parameters: u (a real n...
glaive
[ -0.014188171364367008, 0.022592997178435326, -0.05825265496969223, -0.03613264486193657, 0.03700836002826691, -0.015278968960046768, -0.019552432000637054, 0.07872803509235382, 0.02384420856833458, -0.012324117124080658, 0.014657757245004177, 0.041716210544109344, -0.019073134288191795, 0....
0.791331
0.774452
0.016879
Write a function in the programming language of your choice that takes a natural number as input and returns a boolean value. The function should check if the input number is equal to zero or not. If the number is zero, the function should return true, otherwise, it should return false.
glaive
[ 0.014090288430452347, 0.01999729312956333, -0.039695631712675095, -0.025676198303699493, 0.03758362680673599, -0.026317691430449486, 0.0030484595336019993, 0.06858985871076584, 0.032594311982393265, -0.020164020359516144, 0.010484150610864162, 0.03557402268052101, -0.023232482373714447, -0...
0.812336
0.793703
0.018633
You are tasked with creating a program that takes an integer input representing a year and determines whether it is a leap year. A leap year is a year that is evenly divisible by 4, unless it is also divisible by 100. However, if a year is divisible by 400, it is considered a leap year regardless. If the input year is ...
glaive
[ 0.004381121136248112, 0.002975285518914461, -0.00993078388273716, -0.03122696466743946, 0.044849589467048645, -0.03210156783461571, -0.0366704948246479, 0.07373349368572235, 0.03822900354862213, 0.0015762465773150325, 0.031579021364450455, 0.019192364066839218, -0.03330063819885254, -0.029...
0.791319
0.761317
0.030001
You are tasked with implementing a function that checks the symmetry of a Compressed Sparse Row (CSR) adjacency matrix. The function should take in two parameters: a vector representing the CSR row offsets and a vector representing the CSR column indices. The algorithm outline is as follows: - Set a flag to true - For ...
glaive
[ 0.02098512463271618, 0.017536576837301254, -0.04549583047628403, -0.026385292410850525, 0.03478686884045601, -0.00427804421633482, -0.013064222410321236, 0.0757703185081482, 0.02099747397005558, -0.01882961578667164, 0.01591615192592144, 0.018423166126012802, -0.012755422852933407, -0.0019...
0.818856
0.77992
0.038936
You are tasked with creating a Python program that allows users to input a string and then reverses the string using a recursive function. The program should take a string as input and return the reversed string as output. The program should be implemented using Python with a recursive function approach.
glaive
[ 0.004649649374186993, 0.03544832393527031, -0.01577858440577984, -0.03743491694331169, 0.03018867038190365, -0.032376233488321304, -0.0011658446164801717, 0.04764297977089882, 0.0353158675134182, -0.00366605119779706, 0.02312203124165535, 0.031729649752378464, -0.03409213572740555, -0.0059...
0.802948
0.787862
0.015086
What is the algorithm to determine the number of distinct words in a given list of words?
glaive
[ 0.018760647624731064, 0.01807185262441635, -0.012314234860241413, -0.03179614245891571, 0.03980157896876335, -0.0390925407409668, -0.03480358049273491, 0.04437733441591263, 0.03612349182367325, -0.026057742536067963, -0.003285739803686738, 0.026451321318745613, -0.026303406804800034, -0.01...
0.795622
0.767198
0.028424
You are tasked with sorting and removing duplicate records from a dataset in SAS. The dataset contains information about individuals, including their first name, last name, and a numerical identifier. Your goal is to sort the dataset by the last name in descending order and the numerical identifier in ascending order. ...
glaive
[ 0.024174170568585396, 0.01789979822933674, -0.031234456226229668, -0.040547046810388565, 0.02498014271259308, -0.02088778465986252, -0.0036332819145172834, 0.05470344051718712, 0.05359738692641258, 0.014480260200798512, 0.027999848127365112, -0.0040253945626318455, -0.027655085548758507, -...
0.792857
0.773059
0.019798
You are tasked with implementing a class in a programming language that will handle the mapping of symbolic names to integers and vice versa. The class, called AcAsmMap, should contain the following functionalities: - It should be able to initialize from a collection of lines, which represents a map body, and create a ...
glaive
[ 0.0447813905775547, 0.02304881252348423, -0.013097960501909256, -0.02350611239671707, 0.026130318641662598, -0.04176974296569824, 0.005607344210147858, 0.04566243663430214, 0.04353552684187889, -0.0198518093675375, 0.0310185756534338, 0.0440138503909111, -0.02217164635658264, 0.00168904231...
0.819112
0.802675
0.016438
I want to create a function that calculates the size of a given list recursively. The size of a list is the total number of elements it contains. The function should take a list of any type as input and return the size of the list as an integer. Implement the function in the language of your choice.
glaive
[ 0.013778111897408962, 0.030324652791023254, -0.04223693534731865, -0.057612478733062744, 0.06274211406707764, -0.033197350800037384, -0.016732897609472275, 0.04505501314997673, 0.042680852115154266, -0.02169669046998024, 0.02543557435274124, 0.05238427221775055, -0.032288409769535065, -0.0...
0.803926
0.781638
0.022288
You are tasked with creating a program that generates a random 10x10 matrix of integers and visualizes it using a heatmap. The heatmap should use a color gradient to represent the values in the matrix, with higher values being represented by a darker color and lower values by a lighter color. Your program should use th...
glaive
[ 0.010809510014951229, 0.020148281008005142, -0.017823752015829086, -0.037580378353595734, 0.03090890683233738, -0.061678070574998856, -0.04974627494812012, 0.06858142465353012, 0.0367162711918354, -0.03360380977392197, 0.0219029039144516, 0.025426415726542473, -0.025449009612202644, 0.0030...
0.796121
0.780269
0.015852
You are tasked with implementing a CUDA kernel to perform matrix multiplication using tiling. Tiling is a technique that improves memory access patterns by dividing the matrices into smaller blocks and loading them into shared memory. The given matrices A and B are of size N x N, and you need to write a CUDA kernel to ...
glaive
[ 0.015886858105659485, 0.05053979530930519, -0.01385735534131527, -0.015306768007576466, 0.04109271243214607, -0.004973565693944693, -0.02603227272629738, 0.09902293980121613, 0.027064373716711998, -0.011192000471055508, 0.0209646075963974, 0.02843550778925419, -0.018430432304739952, -0.000...
0.802217
0.776592
0.025626
You are tasked with creating a function that takes in an array of data items and an array of column keys to group by. The goal is to output an associate array of key: array of data, with the appropriate grouping. The `key` should be a string of format "columnKey:value;colunmKey2:value2;...". Create a function that can...
glaive
[ 0.02891908772289753, 0.039106935262680054, -0.046489421278238297, -0.03612207621335983, 0.03198297321796417, -0.04333898797631264, -0.023384200409054756, 0.06576041877269745, 0.04405910521745682, 0.0008652606629766524, 0.02702230215072632, -0.003003604244440794, -0.018933797255158424, 0.01...
0.785043
0.770418
0.014625
You are tasked with implementing a CUDA function to compute the offset for batched convolution bias in a deep neural network. The function should take in an array of integers as input and the convolution parameters, and it should compute the offset based on the given parameters. You need to implement the `compute_offs...
glaive
[ 0.024943958967924118, 0.037205569446086884, -0.009958941489458084, -0.01544708851724863, 0.02678666077554226, -0.0056815422140061855, -0.034892164170742035, 0.10159352421760559, 0.045482609421014786, -0.021945444867014885, 0.04518888518214226, 0.033245086669921875, -0.021620018407702446, -...
0.804096
0.786982
0.017114
I am trying to implement a k-means clustering algorithm using CUDA and the Thrust library in C++. I need to take a set of data points and find the clusters that these data points belong to. The input data consists of a graph represented in edgelist format, where each row represents the edge between <i, j>. The data als...
glaive
[ 0.004157667048275471, 0.03451152518391609, -0.03053511679172516, -0.032093510031700134, 0.030958890914916992, -0.006518030073493719, -0.02356587164103985, 0.10229726880788803, 0.04640406742691994, -0.0060682035982608795, 0.021125158295035362, 0.020556088536977768, -0.002418763702735305, 0....
0.791202
0.775653
0.01555
Is there a way in C# to find two elements in an array that add up to a given number?
glaive
[ 0.008040500804781914, 0.020517127588391304, -0.04359947517514229, -0.03279919922351837, 0.03363019600510597, -0.044648677110672, -0.009420485235750675, 0.07844904065132141, 0.02498757466673851, -0.022649819031357765, 0.017760567367076874, 0.023625817149877548, -0.04508400708436966, -0.0165...
0.793819
0.776151
0.017668
You are tasked with implementing a program that can calculate the distance between two points on a sphere given their longitude and latitude coordinates. The formula for calculating the distance between two points on a sphere given their longitude and latitude coordinates is as follows: distance = radius * arccos(sin(...
glaive
[ -0.004587071947753429, 0.042296115309000015, -0.03379550948739052, -0.04167846962809563, 0.03643219172954559, -0.03168834000825882, -0.042570143938064575, 0.022647976875305176, 0.06203993037343025, -0.02310805581510067, 0.01772375963628292, 0.05278872698545456, -0.014109908603131771, 0.003...
0.785911
0.761868
0.024043
You are tasked with creating a program that calculates the row sums of Pascal's triangle modulo 10. The program should generate the row sums up to a specified number of rows and output the results. The row sums should be calculated using the following rules: - The first row of Pascal's triangle is 1. - Each subsequent ...
glaive
[ 0.024860521778464317, 0.03166758269071579, -0.02049894817173481, -0.029450029134750366, 0.03085075318813324, -0.03701777756214142, -0.02011515013873577, 0.04480811953544617, 0.040548212826251984, -0.010909007862210274, 0.02110155113041401, 0.029122862964868546, -0.05311714857816696, -0.013...
0.810998
0.763466
0.047532
You are given a programming task to implement a function that will create a custom array structure with specific operations. The array should have the ability to store data and perform various operations like element retrieval, element modification, and more. The array has a specific shape and rank, and the operations ...
glaive
[ 0.023601368069648743, 0.03678324446082115, -0.02080952562391758, -0.019451607018709183, 0.04045141860842705, -0.04133031144738197, -0.028389789164066315, 0.06922367960214615, 0.035421762615442276, -0.012684072367846966, 0.021234560757875443, 0.029505819082260132, -0.029969872906804085, -0....
0.80152
0.780796
0.020723
You are required to implement a CUDA program to perform a parallel prefix sum operation on a given array of unsigned long integers. The program should include the following components: - A kernel function `prefix_sum_kernel` to calculate the prefix sum of the input array. - Another kernel function `copy_kernel` to copy...
glaive
[ -0.007872052490711212, 0.04345393925905228, -0.020233621820807457, -0.027265826240181923, 0.024246538057923317, 0.0016343282768502831, -0.020445937290787697, 0.09213182330131531, 0.03536340966820717, -0.02436123974621296, 0.024662895128130913, 0.03458329662680626, -0.004750507418066263, -0...
0.814534
0.787635
0.026899
You are tasked with implementing a function that takes a list of numbers and returns the median value. The median is the middle value in a list of numbers sorted in ascending order. If the list has an odd number of elements, the median is the middle number. If the list has an even number of elements, the median is the ...
glaive
[ 0.03573698550462723, 0.010228256694972515, -0.045461636036634445, -0.04812786728143692, 0.04413749277591705, -0.01100902259349823, -0.030836960300803185, 0.056200671941041946, 0.03070402704179287, -0.019158368930220604, 0.029878951609134674, 0.02497207745909691, -0.025851428508758545, -0.0...
0.786847
0.745081
0.041765
You are tasked with implementing a set of CUDA functions for performing various mathematical operations on different types of data. The functions are to be implemented within the cplVectorOpers namespace. The functions to be implemented are: - Copy: for copying data from one array to another - SetMem: for setting all ...
glaive
[ 0.01943393237888813, 0.04835284873843193, -0.03320423886179924, -0.03131791204214096, 0.03679273650050163, -0.016015123575925827, -0.032162465155124664, 0.1024390384554863, 0.05459217727184296, -0.009298927150666714, 0.02419322356581688, 0.031055182218551636, 0.003121444955468178, -0.00746...
0.803298
0.779775
0.023523