instruction_seed
stringlengths
43
8.03k
source
stringclasses
1 value
embeddings
listlengths
1.02k
1.02k
mean_positive_score
float64
0.73
0.85
mean_negative_score
float64
0.71
0.82
difference_score
float64
0.01
0.07
You are required to implement a function that performs aggregation operations on a table with or without groupby. The function should take the following inputs: - `table`: A BlazingTableView containing the data to be aggregated. - `aggregation_types`: A vector of strings representing the aggregation types to be perform...
glaive
[ 0.03683483973145485, 0.02135257050395012, -0.0209625456482172, -0.025731787085533142, 0.03789909556508064, -0.045291174203157425, -0.011428730562329292, 0.0625406876206398, 0.04242131486535072, 0.004413641057908535, 0.005362271331250668, 0.01580379344522953, -0.017180996015667915, 0.012050...
0.800669
0.780622
0.020047
You are tasked with implementing a function to calculate the smootherstep interpolation value. The function should take in three parameters: edge0, edge1, and x. The function should return a float value representing the interpolation between edge0 and edge1 based on the value of x. The function should use the following...
glaive
[ 0.02021334320306778, 0.04755114018917084, -0.03212985768914223, -0.038223858922719955, 0.05866092070937157, -0.014285372570157051, -0.03589502349495888, 0.09317225962877274, 0.03976447880268097, -0.012166689150035381, 0.050346676260232925, 0.032779622822999954, -0.021115461364388466, -0.01...
0.800025
0.785007
0.015018
You are tasked with implementing a program that generates a sequence of numbers that are congruent to 3 or 18 mod 22. The program should start with the number 3 and continue generating the sequence based on the given congruence condition. The sequence should have a length of 100 numbers.
glaive
[ 0.031064888462424278, 0.018379276618361473, -0.026005476713180542, -0.045279134064912796, 0.02849915623664856, -0.01773972064256668, -0.03719177842140198, 0.059667281806468964, 0.01968305930495262, -0.029765591025352478, 0.01836453191936016, 0.029176626354455948, -0.05170149356126785, -0.0...
0.817532
0.779878
0.037654
You are tasked with creating a program that allows users to calculate the square of a given number. The program should take an input number and then output the square of that number. You need to create a function or method that takes the input number and returns its square.
glaive
[ 0.03355898708105087, 0.03664398565888405, -0.047447867691516876, -0.03727603703737259, 0.05610484257340431, -0.02453182451426983, -0.01710866205394268, 0.06406590342521667, 0.043367717415094376, -0.014885928481817245, 0.030015859752893448, 0.039908576756715775, -0.04777390882372856, -0.036...
0.796562
0.778511
0.018051
How can I create an algorithm to optimize the number of workers required for a given number of tasks?
glaive
[ 0.012225344777107239, 0.02165217511355877, -0.03615792095661163, -0.010333546437323093, 0.02984662912786007, -0.01652137003839016, -0.04996786266565323, 0.025809945538640022, 0.014017237350344658, -0.02139705792069435, 0.0074252113699913025, 0.01926383376121521, -0.011568799614906311, -0.0...
0.785049
0.761154
0.023895
You are tasked with solving the Zebra Puzzle. The puzzle is a logic puzzle that provides a list of clues that describe the characteristics of each of five houses, such as their color, nationality, pet, drink, and smoke. The objective is to determine the specific characteristics of each house based on the given constrai...
glaive
[ 0.010319371707737446, 0.023015566170215607, -0.02464183047413826, -0.02076287567615509, 0.04232208430767059, -0.015594051219522953, -0.009700476191937923, 0.033477894961833954, 0.05022420734167099, -0.029704546555876732, 0.022914959117770195, 0.03027241863310337, -0.0381743423640728, -0.01...
0.803206
0.781019
0.022187
You are tasked with creating a quantum probability distribution visualization for a given number of qubits, states, and amplitudes. Your task is to write a program that takes the number of qubits (nqubits), the name of the distribution (name), the number of states (nstates), and the amplitudes amplitude[x,y], amplitude...
glaive
[ -0.0013669891050085425, 0.020974352955818176, -0.036249157041311264, -0.025173423811793327, 0.028940031304955482, -0.02549641579389572, -0.027552831918001175, 0.06819745898246765, 0.04615151509642601, 0.0032652593217790127, 0.030490005388855934, 0.033885542303323746, -0.011124822311103344, ...
0.802544
0.778128
0.024416
You are tasked with creating a SQL query to count the number of records in a table where a GUID field is less than a specific value. The GUID field is a string in the format 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', where each x is a hexadecimal digit (0-9, a-f). Your query should return the count of records where the GU...
glaive
[ -0.015630509704351425, 0.017033031210303307, -0.018771449103951454, -0.04092578589916229, 0.034195128828287125, -0.022616107016801834, -0.03724091872572899, 0.04878894239664078, 0.05504043027758598, 0.004565621260553598, 0.019882524386048317, 0.03397389501333237, -0.020957984030246735, -0....
0.796031
0.766968
0.029063
How can I write an algorithm in Java to find the number of subarrays that have a given sum?
glaive
[ -0.010407175868749619, 0.020578516647219658, -0.049776338040828705, -0.014083672314882278, 0.027383124455809593, -0.01205919124186039, -0.026228545233607292, 0.03559621796011925, 0.01862809993326664, -0.02714787982404232, 0.02436779998242855, 0.0274500772356987, -0.03354556858539581, -0.02...
0.807495
0.779254
0.02824
You are tasked with creating a program that generates a sequence of numbers based on the following formula: 11^n + n^11, where n starts at 1 and increases by 1 for each subsequent number in the sequence. Your program should be able to calculate and output the first 28 numbers in this sequence.
glaive
[ 0.03078296408057213, 0.013953912071883678, -0.011558834463357925, -0.06641053408384323, 0.034864604473114014, -0.03127235174179077, -0.031164556741714478, 0.07489063590765, 0.028198162093758583, -0.012255615554749966, 0.030377089977264404, 0.04640740901231766, -0.07113537937402725, -0.0139...
0.824627
0.781339
0.043287
You are tasked with creating a function that takes a string as input and returns the same string reversed. For example, if the input is "hello", the output should be "olleh".
glaive
[ 0.021309848874807358, 0.04337811470031738, 0.008072265423834324, -0.04677697271108627, 0.01759304292500019, -0.01681271381676197, -0.007277441211044788, 0.05791567638516426, 0.045343801379203796, -0.018770582973957062, 0.00451255077496171, 0.02346857264637947, -0.044459909200668335, -0.012...
0.786149
0.761606
0.024543
You are tasked with implementing a CUDA kernel to rearrange the spins of a lattice so that they match the temperature order. The spins are to be rearranged such that the least significant bit corresponds to the lowest temperature, and the higher order bits correspond to higher temperatures. The lattice is represented b...
glaive
[ 0.01352017279714346, 0.034616876393556595, -0.01615329459309578, -0.019614726305007935, 0.016064167022705078, 0.0016509073320776224, -0.030660206452012062, 0.0705789178609848, 0.0331883430480957, -0.009604205377399921, 0.02111460454761982, 0.023486826568841934, -0.020834406837821007, 0.003...
0.805947
0.789167
0.01678
You are tasked with implementing a subroutine in Fortran called "dorot" that can perform a rotation transformation on a set of 3D or 2D coordinates. The subroutine takes as input the number of dimensions (ndim), the number of points (numnp), the arrays of x, y, and z coordinates (xn, yn, zn), a 3x3 rotation matrix (rot...
glaive
[ 0.017840364947915077, 0.035323403775691986, -0.0032445350661873817, -0.03517398238182068, 0.009442904032766819, 0.004064085427671671, -0.02030448243021965, 0.0395742803812027, 0.03526768833398819, 0.0020594990346580744, 0.0017040676902979612, 0.03664873540401459, -0.034582458436489105, 0.0...
0.797616
0.775657
0.021958
You are tasked with creating a program that calculates the average of a list of numbers. You need to write a function that takes in a list of numbers as input and returns the average of those numbers. If the input list is empty, the function should return 0. Write a Python function called `calculate_average` that take...
glaive
[ 0.013598022051155567, 0.0281052365899086, -0.04618210345506668, -0.035626232624053955, 0.06921446323394775, -0.024770932272076607, -0.027932092547416687, 0.04542383551597595, 0.02047613076865673, -0.010147446766495705, 0.009462743066251278, 0.027472836896777153, -0.023119298741221428, -0.0...
0.78443
0.76553
0.0189
You are tasked with creating a program that generates a sequence of numbers based on the following formula: a(n+2) = 18*a(n+1) - a(n) + 8, where a(0) = 0 and a(1) = 2. Your program should take an input n and output the corresponding value of a(n).
glaive
[ 0.03237098082900047, 0.031156597658991814, -0.0276993028819561, -0.043902438133955, 0.02127634733915329, -0.025557657703757286, -0.04579271748661995, 0.07490440458059311, 0.023877447471022606, -0.030977165326476097, 0.03390244022011757, 0.04971678927540779, -0.04939562454819679, -0.0035837...
0.830557
0.778667
0.05189
You are tasked with writing an XSLT template to count the number of occurrences of a specific character in a given string. The template should take two parameters: the string to be analyzed and the character to count. The output should be the total count of the specified character in the string.
glaive
[ 0.0065091559663414955, 0.007720692083239555, -0.03759941831231117, -0.03454279899597168, 0.0437532439827919, -0.03399656340479851, -0.005746117793023586, 0.060325682163238525, 0.03339413180947304, -0.012177039869129658, 0.0094408318400383, 0.03516903147101402, -0.03600892797112465, -0.0070...
0.796476
0.778181
0.018295
You are tasked with implementing a function to add pair data into a data structure, with the following specifications: - The function should take in two unsigned integers `a` and `b`, an array of `int2` pairs, a pointer to an `unsigned int` index, and a constant `MAX_PAIR_NUM`. - If the index is less than `MAX_PAIR_NUM...
glaive
[ 0.01663476787507534, 0.03655434027314186, -0.020003465935587883, -0.019159037619829178, 0.0501745268702507, 0.010647195391356945, -0.004815901629626751, 0.08578994870185852, 0.03894124925136566, -0.017070187255740166, 0.013698234222829342, 0.0428907535970211, -0.024325884878635406, -0.0220...
0.82079
0.774963
0.045827
I am working on a program that involves defining a relationship between different items. Each item has a unique identifier and can have a relationship with one or more other items. The relationship is defined as "great_rsd(item1, item2)" where item1 has a "great_rsd" relationship with item2. I need to write a function ...
glaive
[ 0.030780760571360588, 0.02915964275598526, -0.05620580539107323, -0.041481394320726395, 0.03212646767497063, -0.007514520548284054, -0.028015753254294395, 0.05153147876262665, 0.04142626374959946, -0.007708082441240549, 0.012708302587270737, 0.043522488325834274, -0.008717881515622139, 0.0...
0.811985
0.784059
0.027926
You are given an array A of integers and a value K. For each integer A[i] in the array, you need to choose either to add x = -K or x = K to A[i] (only once). After this process, you will have a new array B. Your task is to return the smallest possible difference between the maximum value of B and the minimum value of B...
glaive
[ 0.03645534813404083, 0.02512715384364128, -0.021519389003515244, -0.025935208424925804, 0.04377918317914009, -0.02683510072529316, -0.03267538920044899, 0.06969258189201355, 0.05387385934591293, -0.020980212837457657, 0.04052095487713814, 0.02391032874584198, -0.025534681975841522, 0.00911...
0.832614
0.774262
0.058352
You are tasked with implementing a Cholesky decomposition using CUDA and cuBLAS. The Cholesky decomposition is a method for solving linear equations involving positive definite matrices. The CUDA and cuBLAS libraries are used to parallelize the computation and optimize performance on NVIDIA GPUs. Your task is to write...
glaive
[ 0.013711782172322273, 0.048587922006845474, -0.047919150441884995, -0.029999172315001488, 0.03832969069480896, -0.007693535648286343, -0.024206215515732765, 0.08651391416788101, 0.04107140377163887, -0.02126772701740265, 0.01845620758831501, 0.02032974176108837, 0.014826682396233082, 0.005...
0.793904
0.77673
0.017174
You are tasked with creating a program to calculate the area of a circle. Your program should take the radius of the circle as input and output the area. You are not allowed to use any built-in functions to calculate the area of a circle. You must implement the formula for calculating the area of a circle using the val...
glaive
[ 0.0019308158662170172, 0.041868288069963455, -0.03632465377449989, -0.022684020921587944, 0.042217615991830826, -0.022673070430755615, -0.029720470309257507, 0.03806155174970627, 0.039990030229091644, -0.016695091500878334, 0.02224312722682953, 0.04139750823378563, -0.02157939225435257, -0...
0.783668
0.760567
0.0231
You are tasked with implementing a persistent queue data structure in a functional programming language. A persistent queue is a data structure that supports adding elements to the end of the queue, removing elements from the front of the queue, and accessing elements at any position in the queue. Additionally, the que...
glaive
[ 0.03207223117351532, 0.009151333943009377, -0.008795688860118389, -0.03070739097893238, 0.03895827382802963, -0.02868502587080002, -0.010591942816972733, 0.07303663343191147, 0.04445900768041611, -0.014343071728944778, 0.029207881540060043, 0.03151644766330719, -0.00801018439233303, 0.0206...
0.80319
0.785358
0.017832
You are tasked with analyzing a dataset that contains information about X, Y, TStamp, Pres., and EndPts. The dataset has a DataSize of 664 and includes multiple rows of data. Each row consists of 5 values: X, Y, TStamp, Pres., and EndPts. Your goal is to write a program that reads the dataset, analyzes the values, and ...
glaive
[ 0.01938474550843239, 0.008137928321957588, -0.05104789510369301, -0.04318857192993164, 0.03784598037600517, -0.05397070571780205, -0.019014058634638786, 0.07597481459379196, 0.0541950948536396, -0.003923304844647646, 0.034730568528175354, 0.02287992276251316, -0.024219220504164696, 0.00141...
0.799975
0.78235
0.017625
You are tasked with creating a module in the Vector language that initializes an array of integers, converts it into a vector, and then modifies a specific index in the vector. After the modification, the module should display the elements of the vector and then terminate.
glaive
[ 0.043762002140283585, 0.03788699954748154, -0.014758573845028877, -0.032162997871637344, 0.03444047272205353, -0.04460381343960762, -0.03828611597418785, 0.05762191861867905, 0.04049386829137802, -0.025349875912070274, 0.02145449072122574, 0.025273878127336502, -0.02876630797982216, -0.003...
0.818343
0.799468
0.018875
You are tasked with implementing a program that uses the Sidewinder algorithm to generate a maze. The program should take in the following inputs: - RNG seed: an optional integer for the random number generator seed. If none is provided, a random seed should be chosen. - First direction: an optional direction (Top, Rig...
glaive
[ 0.022235823795199394, 0.016408396884799004, -0.003968256060034037, -0.026269622147083282, 0.021547706797719002, -0.005201347637921572, -0.031249532476067543, 0.05943535640835762, 0.03363552317023277, 0.0025606786366552114, 0.03879225626587868, 0.02543039433658123, -0.019160021096467972, -0...
0.806586
0.772662
0.033924
You are tasked with analyzing a dataset containing five columns: X, Y, TStamp, Pres., and EndPts. The dataset has a size of 166 entries. Your goal is to write a program that reads in this dataset and performs the following operations: 1. Calculate the average value of the "TStamp" column. 2. Find the maximum value in t...
glaive
[ 0.019608018919825554, 0.005257644224911928, -0.053378816694021225, -0.044005099684000015, 0.045584507286548615, -0.04493103548884392, -0.022578055039048195, 0.07653948664665222, 0.03905046358704567, -0.002572979312390089, 0.03716351464390755, 0.020876966416835785, -0.027357472106814384, 0....
0.81021
0.786634
0.023576
You are tasked with implementing a rank 1 update of Cholesky decomposition algorithm. The goal is to update the Cholesky decomposition of a matrix A' after adding a row and column to matrix A. The input will include the Cholesky decomposition of matrix A, the new row and column to be added to matrix A, and the matrix l...
glaive
[ 0.029374634847044945, 0.03315908461809158, -0.024422112852334976, -0.037306495010852814, 0.04877115786075592, -0.017436813563108444, -0.006413468159735203, 0.0697566494345665, 0.03649269789457321, -0.036848630756139755, 0.018561579287052155, 0.0007289346540346742, -0.010371936485171318, -0...
0.804563
0.777002
0.027561
You are tasked with implementing a program that utilizes Kokkos with CUDA backend to perform matrix multiplication. You need to create a C++ program that defines two 2D arrays, A and B, and multiplies them to produce a resulting matrix C. The size of the matrices should be specified by the user, and the program should ...
glaive
[ 0.026759536936879158, 0.03965378552675247, -0.027195053175091743, -0.02900722622871399, 0.03224886581301689, 0.0018956697313115, -0.02298555336892605, 0.10995634645223618, 0.04293633624911308, -0.02936946041882038, 0.006435243412852287, 0.04813753813505173, -0.004972309805452824, -0.010229...
0.794647
0.775983
0.018664
You are tasked with creating a program that generates the sequence A128093. This sequence consists of the smallest multiple of n which is greater than or equal to 2^n. Your program should take an input n and output the corresponding value in the sequence. For example: Input: 5 Output: 35
glaive
[ 0.0288535226136446, 0.03682231530547142, -0.022608794271945953, -0.024194708094000816, 0.02258867770433426, -0.018060659989714622, -0.018602320924401283, 0.06228456273674965, 0.01566079445183277, -0.03318759426474571, 0.02498490735888481, 0.040798891335725784, -0.04029630124568939, -0.0169...
0.829331
0.770106
0.059224
You are tasked with creating a program that can efficiently test and report prime numbers within a given range. The program should be able to calculate the elapsed time for each prime test and report the prime numbers along with their respective elapsed times. Additionally, the program should be able to skip even numbe...
glaive
[ 0.03262278437614441, 0.010284371674060822, -0.034407712519168854, -0.038649413734674454, 0.02844879776239395, -0.02030830830335617, -0.022938083857297897, 0.06667212396860123, 0.03502208739519119, -0.010513092391192913, 0.018451841548085213, 0.03687095269560814, -0.02550138346850872, -0.00...
0.811597
0.793845
0.017752
You are tasked with implementing a function to determine whether two sets are equal, regardless of the order of their elements. The sets are represented as lists of integers. Your function should return true if the sets are equal and false if they are not.
glaive
[ 0.0334242545068264, 0.01523596327751875, -0.044653549790382385, -0.03388437256217003, 0.04416574910283089, -0.024856336414813995, 0.004749953746795654, 0.06407608836889267, 0.043069809675216675, -0.03424118459224701, 0.019711632281541824, 0.01533494982868433, -0.027810128405690193, -0.0184...
0.815596
0.775381
0.040215
How can I find the 'k' closest numbers to a given number in Python? For example, if I have a list [1,2,3,4,5,6,7] and I want to find the 3 closest numbers to 6.5, the returned value should be [5,6,7]. I am able to find one closest number using `min(myList, key=lambda x:abs(x-myNumber))`, but I am struggling to find a w...
glaive
[ 0.02713455818593502, 0.04458431154489517, -0.042017288506031036, -0.02171999402344227, 0.05737264081835747, -0.04108903557062149, -0.012471797876060009, 0.023074204102158546, 0.009374884888529778, -0.02131478115916252, 0.031298983842134476, 0.04004151374101639, -0.021199341863393784, 0.010...
0.795883
0.776753
0.01913
You are tasked with implementing a CUDA kernel function that performs a series of mathematical operations on arrays of double and float values. The function signature is as follows: ```cpp extern "C" __global__ void my_fancy_kernel(int n, float a, double b, int c, unsigned int d, double * out1, float * out2) ``` The fu...
glaive
[ 0.012443669140338898, 0.05382752791047096, -0.022091306746006012, -0.023743651807308197, 0.034575771540403366, -0.012083244509994984, -0.03642087057232857, 0.09715019166469574, 0.04607992246747017, -0.01591053232550621, 0.02930295467376709, 0.05403537303209305, -0.012408941052854061, -0.00...
0.800996
0.774795
0.026201
You are tasked with writing a function in R to estimate the value of π using the Monte Carlo method. The function should take a single argument, trials, which represents the number of random points to be generated for the estimation. The function should then return the estimated value of π. Additionally, the code shoul...
glaive
[ -0.010619908571243286, 0.029615283012390137, -0.02532205358147621, -0.03852688893675804, 0.04609612002968788, -0.014201804995536804, -0.03297078609466553, 0.05987274646759033, 0.048817552626132965, 0.012784323655068874, 0.014336836524307728, 0.03574923798441887, -0.019122298806905746, 0.00...
0.793432
0.777841
0.01559
You are tasked with creating a program that calculates the probability of a quantum system being in a specific state. The system has 13 qubits, and the amplitude of each state is given by the amplitude function. The program should find the maximum probability of the system being in a specific state and visualize the pr...
glaive
[ 0.006731151603162289, 0.029411399737000465, -0.030767129734158516, -0.019153987988829613, 0.051042474806308746, -0.020245587453246117, -0.022146685048937798, 0.07219946384429932, 0.03356081619858742, 0.0035721929743885994, 0.024603914469480515, 0.03351318836212158, -0.005972010549157858, -...
0.804724
0.770814
0.03391
You are tasked with implementing a CUDA kernel function to sum the elements of a float array efficiently using thread cooperation and reduction techniques. You are given the following information: - The CUDA kernel function `sum_floats` should take in a global memory array of floats `array`, the length of the array `n...
glaive
[ -0.005884926300495863, 0.05690668895840645, -0.02076590619981289, -0.025084925815463066, 0.040083032101392746, -0.007766256108880043, -0.036103762686252594, 0.0796017274260521, 0.03426414728164673, 0.0016329486388713121, 0.01772380620241165, 0.03785843029618263, -0.009488990530371666, 0.02...
0.801602
0.771615
0.029987
You have been tasked with creating a program to calculate the probability of a quantum system being in a certain state. The system is described by a function `amplitude[x, y]` that takes two input parameters `x` and `y`. The probability of the system being in a certain state is given by the absolute square of the ampli...
glaive
[ 0.0031486894004046917, 0.030404571443796158, -0.03237956389784813, -0.016590166836977005, 0.04616578668355942, -0.020838625729084015, -0.017774634063243866, 0.07180683314800262, 0.04549654200673103, 0.010919277556240559, 0.016871385276317596, 0.033333294093608856, -0.016703758388757706, -0...
0.804097
0.768105
0.035992
You are tasked with creating a Spider Solitaire game solver in Clojure. The game consists of a deck of cards, with the goal being to arrange the cards in descending order by suit and in a sequential order. The game has the following functionalities: - Generating a deck of cards with two sets of playing cards (ranks 1-1...
glaive
[ 0.013028059154748917, 0.026862025260925293, -0.030471395701169968, -0.03355368226766586, 0.02053549513220787, -0.031750235706567764, -0.024168532341718674, 0.03863038867712021, 0.05733171105384827, -0.021048253402113914, 0.02347566932439804, 0.03739852458238602, -0.031186655163764954, -0.0...
0.815554
0.791999
0.023555
You are tasked with implementing a pattern matching extension in a programming language, similar to the given code snippet. The goal is to define various patterns and their corresponding values using the provided programming language framework. Your task is to create a program that includes the following types of patt...
glaive
[ 0.013757864013314247, 0.012855848297476768, -0.020845120772719383, -0.02025085873901844, 0.05138234421610832, -0.039543770253658295, -0.008980455808341503, 0.0529148243367672, 0.043485794216394424, -0.011500556021928787, 0.015557807870209217, 0.02991870790719986, -0.020537201315164566, -0....
0.821858
0.800315
0.021544
You are tasked with implementing a subroutine to allocate arrays for use in eigenvalue extraction. The subroutine should take in the array name, number of rows and columns, and the name of the calling subroutine. It should then allocate memory for the specified array and initialize the elements to zero if the allocatio...
glaive
[ 0.020465567708015442, 0.018117766827344894, -0.02970026433467865, -0.028339801356196404, 0.024009298533201218, -0.014836522750556469, -0.007925402373075485, 0.06194169074296951, 0.041632235050201416, -0.006090367212891579, 0.003417441388592124, 0.041115861386060715, -0.01144806481897831, 0...
0.796697
0.782317
0.01438
You are required to write a Common Lisp function zuni2 that implements a specific mathematical algorithm. The function should take in multiple input parameters including zr, zi, fnu, kode, n, yr, yi, nz, nlast, fnul, tol, elim, and alim. The zuni2 function is expected to perform a series of mathematical calculations an...
glaive
[ 0.025583695620298386, 0.055639080703258514, -0.028334762901067734, -0.04752226546406746, 0.02464163303375244, -0.021758463233709335, -0.013445882126688957, 0.03744826465845108, 0.02905651181936264, -0.015439479611814022, 0.026048708707094193, 0.04199064150452614, -0.015931880101561546, 0.0...
0.804868
0.78486
0.020009
I need to write a function mmcuda that can allocate memory on the GPU for a 2D array of a given size and data type. The function mmcuda should take the following parameters: - rp: a pointer to a pointer to the array - r: the number of rows in the array - c: the number of columns in the array - s: the size of the data t...
glaive
[ 0.0057947165332734585, 0.05501830205321312, -0.02638956904411316, -0.02769898809492588, 0.03535115718841553, -0.04065871983766556, -0.0472567155957222, 0.08864133059978485, 0.038258302956819534, -0.016565071418881416, 0.008897289633750916, 0.033785704523324966, 0.0023379800841212273, -0.01...
0.791544
0.766686
0.024859
You are tasked with implementing a simple programming language interpreter using C- compiler version C-F15. The language includes functions for inputting integers, outputting integers, inputting booleans, outputting booleans, inputting characters, outputting characters, and outputting a newline. Additionally, it includ...
glaive
[ 0.028770040720701218, 0.04583567753434181, 0.0058629498817026615, -0.030464518815279007, 0.05253315716981888, -0.0330723375082016, -0.017501192167401314, 0.079300157725811, 0.04255443438887596, -0.015200411900877953, 0.02611413225531578, 0.03380516543984413, -0.025705909356474876, -0.00793...
0.803034
0.783434
0.0196
You are tasked with creating a program to calculate the probability distribution of a quantum system with a given number of qubits and states. The program should use the provided `amplitude` and `probability` functions to calculate the probability of each state for a given set of parameters. It should then use the `NMa...
glaive
[ -0.003709613811224699, 0.022743023931980133, -0.033262401819229126, -0.01327420212328434, 0.04818287119269371, -0.024654455482959747, -0.022426806390285492, 0.06440714001655579, 0.03760019689798355, 0.0017606038600206375, 0.02323807403445244, 0.04547829180955887, -0.010658967308700085, -0....
0.797811
0.769216
0.028596
You have been tasked with creating a program that processes a series of beats and notes data to produce a musical score. The beats and notes data are provided in the form of a code snippet. Each "Beat" entry represents a beat in the music, with the first number indicating the time in milliseconds and the second number...
glaive
[ 0.030245451256632805, 0.019677236676216125, -0.0468718446791172, -0.011820926330983639, 0.0334935337305069, -0.04013725370168686, -0.029567651450634003, 0.06219494715332985, 0.03596783056855202, -0.020503593608736992, 0.04770682007074356, 0.026561906561255455, -0.03975085914134979, -0.0021...
0.797604
0.77877
0.018834
You are tasked with implementing a function to prepare and store data in memory using x86 assembly language. The function must perform the following operations: 1. Load data from addresses_A_ht+0x115eb and store it in the destination specified by addresses_UC_ht+0x12eeb. 2. Load data from addresses_UC_ht+0x16ddb and st...
glaive
[ 0.023294445127248764, 0.012610931880772114, -0.018517881631851196, -0.028333883732557297, 0.031923189759254456, -0.047713231295347214, -0.02825069986283779, 0.07210095971822739, 0.04641077294945717, -0.007607524283230305, 0.024906309321522713, 0.040130615234375, -0.017367003485560417, -0.0...
0.807816
0.787688
0.020129
You are tasked with implementing a parallel k-means clustering algorithm using CUDA in C++. The goal is to segment a dataset into k clusters based on their features, with the intention of minimizing the variance within each cluster. The dataset consists of 100,000 elements, each with 4 dimensions, and the number of clu...
glaive
[ 0.005925653036683798, 0.0411570779979229, -0.015299981459975243, -0.02654547244310379, 0.024806015193462372, 0.0014170351205393672, -0.03877634555101395, 0.09426312148571014, 0.05045021325349808, -0.01097509078681469, 0.01910465583205223, 0.02956215851008892, 0.010493041947484016, 0.023999...
0.794647
0.766716
0.027931
You are tasked with implementing a function to find the maximum subarray within a given array. The maximum subarray is defined as the contiguous subarray (slice) of the input array that has the largest sum. You should write a function called `find_max_subarray` that takes in an array `arr` of integers and the indices `...
glaive
[ 0.02620612643659115, 0.0466676726937294, -0.025862960144877434, -0.01930738054215908, 0.03294869884848595, 0.00045756870531477034, -0.034425679594278336, 0.04431327432394028, 0.041638780385255814, -0.01100129634141922, 0.026965467259287834, 0.02787093259394169, -0.02987823449075222, 0.0045...
0.823125
0.770646
0.052479
You are tasked with creating a program to simulate a loaded die. A loaded die is a type of dice that is weighted to favor certain numbers over others. Your program should be able to create a loaded die with a specified number of faces, initialize it with the number of faces, and roll the die to return a face value. The...
glaive
[ 0.03277328982949257, 0.015735125169157982, -0.023821081966161728, -0.03140896186232567, 0.04646765813231468, -0.036913782358169556, 0.00039777092752046883, 0.07633619755506516, 0.023138223215937614, -0.009903021156787872, 0.04116222262382507, 0.04077770188450813, -0.041743870824575424, -0....
0.786035
0.771511
0.014524
You are tasked with processing and analyzing a dataset containing five columns: X, Y, TStamp, Pres., and EndPts. The dataset has a total size of 456 entries and each entry contains numeric values. Your goal is to write a program to perform the following tasks: 1. Read the dataset from a file or input source. 2. Calcul...
glaive
[ 0.004642748273909092, 0.012112836353480816, -0.048280443996191025, -0.047814298421144485, 0.04835838824510574, -0.04623156040906906, -0.017086422070860863, 0.06599052250385284, 0.044436678290367126, -0.010847787372767925, 0.0415114127099514, 0.02486342191696167, -0.02923743799328804, 0.003...
0.812506
0.791599
0.020907
You are tasked with creating a program that performs a specific operation on a list of numbers. The program should take a list of integers as input and return a new list that contains only the even numbers from the original list, in the same order as they appear in the original list. Write a function that accepts a li...
glaive
[ 0.03689531236886978, 0.02746807597577572, -0.02808993123471737, -0.04139845445752144, 0.030942192301154137, -0.020768826827406883, -0.01954803057014942, 0.053594961762428284, 0.03584412485361099, -0.030683020129799843, 0.0080559765920043, 0.03887614607810974, -0.027062319219112396, -0.0244...
0.808997
0.769014
0.039983
You are tasked with creating a Java program that takes in user input for a number and then calculates the square of that number. You should then display the result to the user.
glaive
[ 0.02649589814245701, 0.03899594396352768, -0.048571694642305374, -0.05148638039827347, 0.04593072086572647, -0.02060399018228054, -0.0038030711002647877, 0.04293094947934151, 0.047185059636831284, -0.033816639333963394, 0.03952888771891594, 0.029546592384576797, -0.05940873548388481, -0.03...
0.793269
0.764101
0.029168
You are required to create a Stan program that performs various operations on matrices and real numbers. The program should define a real number x with a value of 3.3, a 2x2 matrix z with values [[1, 2], [4, 5]], and an identity matrix ident with values [[1, 0], [0, 1]]. The program should then perform the following op...
glaive
[ 0.07211927324533463, 0.04916025325655937, -0.027476182207465172, -0.04050958529114723, 0.03681999817490578, -0.01017976924777031, -0.010685121640563011, 0.06093713641166687, 0.041273538023233414, -0.01748579740524292, 0.01057447213679552, 0.03249958157539368, -0.04161301627755165, -0.01803...
0.820413
0.780554
0.039859
You are tasked with creating a program that calculates the probability of a quantum state for a given set of parameters and then visualizes the probability distribution in a 3D plot and a contour plot. The quantum state is defined by the amplitude functions `amplitude[x, y]` and `amplitude2[x, y]`. The probability of t...
glaive
[ -0.0031856894493103027, 0.03567850589752197, -0.030939815565943718, -0.030400393530726433, 0.038173675537109375, -0.019874079152941704, -0.013864786364138126, 0.07610073685646057, 0.04088148847222328, 0.009008938446640968, 0.0270148366689682, 0.03712455555796623, -0.015238689258694649, -0....
0.791442
0.764659
0.026783
You are tasked with creating a program that simplifies a given expression by applying the rule of disequality. The program should take an input expression and simplify it by applying the disequality rule, which states that if a != b, then the expression can be simplified to b != a. You need to implement a function that...
glaive
[ 0.016473427414894104, 0.014333046041429043, -0.0322335809469223, -0.0346076563000679, 0.06394030153751373, -0.01122918538749218, -0.01582329161465168, 0.09149561822414398, 0.04724520072340965, -0.02679463103413582, 0.009208844974637032, 0.019877417013049126, -0.027568288147449493, -0.02276...
0.806546
0.784307
0.022239
You are required to implement a CUDA kernel that calculates ORB descriptors for a given set of keypoints on an input image. The input image is represented as a 2D array of unsigned characters. The ORB descriptors are computed using a predefined pattern and angles associated with each keypoint. The kernel should utilize...
glaive
[ 0.004568238276988268, 0.0506943017244339, -0.025621911510825157, -0.02126353047788143, 0.037892650812864304, -0.006974963936954737, -0.034727584570646286, 0.09398187696933746, 0.05451146885752678, -0.007499638944864273, 0.03194793686270714, 0.02303701639175415, 0.004529295954853296, 0.0041...
0.799421
0.783206
0.016215
I need to write a program that takes in a string representing the result of a Boolean satisfiability problem in Conjunctive Normal Form (CNF) and a list of integers representing the variable assignments. The string will start with "s SATISFIABLE" if the problem is satisfiable, followed by a line starting with "v" and a...
glaive
[ 0.0210955198854208, 0.013512201607227325, -0.04874792695045471, -0.024445418268442154, 0.0496046282351017, -0.04836210235953331, 0.006837006192654371, 0.058616697788238525, 0.02800958976149559, -0.018710767850279808, 0.016703635454177856, 0.04248847812414169, -0.020269906148314476, -0.0127...
0.828671
0.798555
0.030115
You are tasked with creating a function in Wolfram Mathematica that calculates the Dice Similarity between two vectors for a given class. The function should take in two vectors, x and y, and an optional class parameter. If the class parameter is not provided, the default class should be 1. The function should return t...
glaive
[ 0.004935683216899633, 0.015032636001706123, -0.03103983774781227, -0.03526919707655907, 0.05216824263334274, -0.009599781595170498, 0.0014371086144819856, 0.052017662674188614, 0.04883212596178055, -0.0011591301299631596, 0.022133372724056244, 0.028356429189443588, -0.030856944620609283, -...
0.799463
0.76979
0.029673
You are tasked with implementing a set of functions to calculate thermodynamic properties of moist air based on the equations provided in a given paper. The functions to be implemented include calculating the first and second virial coefficients, compressibility factor, molar volume, specific volume, molar enthalpy, an...
glaive
[ 0.047726962715387344, 0.030231129378080368, -0.024337517097592354, -0.04254353046417236, 0.03157735988497734, -0.06008151173591614, -0.031148605048656464, 0.06160220876336098, 0.022764340043067932, 0.01804169826209545, 0.009271902963519096, 0.027250146493315697, -0.024683093652129173, -0.0...
0.779561
0.762038
0.017523
You are tasked with implementing a function in the cuarma library that performs a matrix-matrix product. The function cuarmagemm should take in a host scalar alpha, a matrix A, a matrix B, a host scalar beta, and a matrix C. The function should perform the matrix-matrix product C = alpha * op(A) * op(B) + beta * C, whe...
glaive
[ 0.04312010854482651, 0.038985058665275574, -0.04495234414935112, -0.046844612807035446, 0.046882741153240204, -0.012985024601221085, -0.026008885353803635, 0.09634597599506378, 0.02114715985953808, -0.019338268786668777, 0.012803642079234123, 0.04046723246574402, -0.023015577346086502, -0....
0.802819
0.786257
0.016562
You are tasked with creating a program that calculates the reverse factorial of a given number. The reverse factorial of a number n is the largest integer k such that k! = n. Your program should take an input n and output k if it exists, or "NONE" if there is no such k. For example, if the input is 120, the output sho...
glaive
[ 0.016403738409280777, 0.034342121332883835, -0.027022061869502068, -0.033735547214746475, 0.026292776688933372, -0.020628010854125023, 0.00007430753612425178, 0.056667082011699677, 0.0454048253595829, -0.012621254660189152, 0.012605476193130016, 0.04188639670610428, -0.04940153658390045, -...
0.816964
0.777377
0.039588
I have a three-dimensional array in R, and I need to find the position and value of the maximum value in the array. The array is defined as follows: ```R %let ary=%str(array(c(1:3,9,5:8), dim=c(2,2,2))); ``` I want to find the maximum value in the array and its position in the form of (dim1, dim2, dim3).
glaive
[ 0.017355572432279587, 0.03042842075228691, -0.044688258320093155, -0.04565955698490143, 0.03494172543287277, -0.02010001614689827, -0.029120637103915215, 0.04542167857289314, 0.032440848648548126, -0.0055984980426728725, 0.02518334612250328, 0.04637640714645386, -0.059516631066799164, -0.0...
0.789825
0.771629
0.018196
You are tasked with creating a program that takes an input number and based on its value, prints a specific message. If the input number is 1, the program should print "one". If the input number is 2 or 3, the program should print "two or three". For any other input number, the program should print "other".
glaive
[ 0.032895684242248535, 0.02722712978720665, -0.035622548311948776, -0.02978993020951748, 0.041791681200265884, -0.021166231483221054, -0.022533763200044632, 0.048474084585905075, 0.04172791913151741, -0.022314539179205894, 0.02895878627896309, 0.041311170905828476, -0.027627110481262207, -0...
0.813465
0.781491
0.031974
You are tasked with implementing a CUDA kernel that calculates the quantiles of a given array of sorted data. The kernel should take in the sorted data, the maximum number of bins, and the number of rows as input, and output the calculated quantiles and the number of bins. The kernel should use interpolation to determi...
glaive
[ -0.010361723601818085, 0.030944760888814926, -0.02763008326292038, -0.015636960044503212, 0.014841639436781406, -0.018409578129649162, -0.017874402925372124, 0.07052510231733322, 0.04687974601984024, -0.009721240028738976, 0.032929737120866776, 0.030860168859362602, -0.02443711645901203, 0...
0.815267
0.784949
0.030319
You are tasked with writing a program that calculates the total number of items in two different categories of products in a business. The program should take in the number of rows and columns for each category of products and output the total number of items. For example, if the business has 3 rows and 4 columns of b...
glaive
[ 0.0178684014827013, 0.0027889686170965433, -0.06116780266165733, -0.023353584110736847, 0.054134778678417206, -0.015247177332639694, -0.048599980771541595, 0.0717715471982956, 0.04332466796040535, -0.011933634988963604, 0.002424241043627262, 0.04949391260743141, -0.02825055457651615, -0.01...
0.800151
0.771611
0.02854
You are tasked with creating a priority multiplexer (Mux) in a hardware description language (HDL) that enforces a specific rule. When constructing the priority mux, two rules that share the same value must be separated into different arms if their priority is different. You need to implement a module that includes thr...
glaive
[ 0.01396985910832882, 0.01123235933482647, -0.030258920043706894, -0.01500687189400196, 0.019843533635139465, -0.0014539518160745502, -0.035996440798044205, 0.07021793723106384, 0.027169013395905495, -0.024392277002334595, 0.015571573749184608, 0.04493904113769531, -0.008106304332613945, -0...
0.807618
0.790256
0.017362
You are tasked with implementing a CUDA-accelerated algorithm for computing the Sum of Squared Differences (SSD) similarity measure for medical image registration. The algorithm should be able to handle 2D and 3D images and input data in the form of nifti_image structures. The input for the algorithm consists of: - A ...
glaive
[ -0.017577072605490685, 0.025024887174367905, -0.034410011023283005, -0.015347875654697418, 0.039267174899578094, -0.013869675807654858, -0.028680121526122093, 0.09446574002504349, 0.054108429700136185, -0.025622179731726646, 0.028927650302648544, 0.023729300126433372, -0.012034518644213676, ...
0.806879
0.784852
0.022027
Can you provide an algorithm to calculate the binomial coefficient of two given numbers, n and k?
glaive
[ 0.014074048027396202, 0.020533354952931404, -0.04164407402276993, -0.029569361358880997, 0.0203915573656559, -0.029206478968262672, -0.014694004319608212, 0.032001134008169174, 0.03670211881399155, -0.010356132872402668, 0.036021679639816284, 0.04609210044145584, -0.038484182208776474, 0.0...
0.805533
0.77205
0.033483
You are tasked with creating a vertex shader in GLSL (OpenGL Shading Language) that takes in the following inputs: - A UniformBufferObject with matrices for model, view, and projection - An input vector of 3D positions (inPosition) - An input vector of colors (inColor) - An input vector of 2D texture coordinates (inTex...
glaive
[ 0.023966524749994278, 0.03399251773953438, -0.014828149229288101, -0.05935553088784218, 0.03286168351769447, -0.05555430054664612, -0.03228938952088356, 0.07125604152679443, 0.040146440267562866, -0.03499282896518707, 0.04111870750784874, 0.033023737370967865, -0.004773447290062904, -0.002...
0.787234
0.768787
0.018447
You are tasked with implementing a function that takes a list of integers and returns a new list containing only the elements with the same parity as the first element of the input list. For example, given the input list (1 2 3 4 5), the output should be (1 3 5), as the first element (1) is odd and the remaining eleme...
glaive
[ 0.04466099664568901, 0.02054218389093876, -0.027138179168105125, -0.04500420019030571, 0.039466433227062225, -0.007305471692234278, 0.000018043527234112844, 0.07188250869512558, 0.02908700704574585, -0.024487772956490517, 0.011059711687266827, 0.01578236185014248, -0.01524601224809885, -0....
0.8217
0.780417
0.041283
You are tasked with implementing a program that solves the harmonic oscillator differential equations using the `integrate_ode_adams` function in a probabilistic programming language such as Stan. The harmonic oscillator differential equations are given by: dy/dt = x[1] * y[2] d^2y/dt^2 = -y[1] - theta[1] * y[2] You a...
glaive
[ 0.023803696036338806, 0.03465493395924568, -0.036734845489263535, -0.039667584002017975, 0.03905962035059929, -0.024175427854061127, -0.008497015573084354, 0.07071147859096527, 0.04456346482038498, -0.006656363606452942, 0.018398061394691467, 0.03541615605354309, -0.0214938223361969, -0.00...
0.805908
0.787105
0.018803
You are given a set of observed values and a set of expected proportions. Your task is to calculate the goodness of fit using the Chi-Square test and determine the p-value. Write a program that takes the observed values and expected proportions as input and calculates the Chi-Square statistic and the p-value using the...
glaive
[ -0.006965115200728178, 0.009633896872401237, -0.05004989728331566, -0.0381905660033226, 0.04307779669761658, -0.024873070418834686, -0.010516440495848656, 0.05985560268163681, 0.04618198797106743, -0.014340597204864025, 0.005829809233546257, 0.039560467004776, -0.037608612328767776, 0.0061...
0.801634
0.777505
0.024129
You are tasked with creating a JavaScript array manipulation library that provides an immutable version of native JavaScript arrays. The library should include various functions for array creation, manipulation, and transformation, such as initializing an array, getting the length of an array, pushing elements onto an ...
glaive
[ 0.02507167123258114, 0.043957505375146866, -0.016990434378385544, -0.02800704725086689, 0.053295936435461044, -0.05241838097572327, -0.00963667593896389, 0.0461052767932415, 0.02965591289103031, -0.03926229476928711, 0.011830192059278488, 0.007731979247182608, -0.031208030879497528, -0.014...
0.792228
0.777681
0.014547
You are tasked with creating a data structure in the c_glib namespace for the TTest program. The data structure should include the following fields: - nan (double) - inf (double) - neginf (double) - repeating (double) - big (double) - tiny (double) - zero (double) - negzero (double) Design the struct and initialize it...
glaive
[ -0.006350344512611628, 0.01345495693385601, -0.046937257051467896, -0.058912843465805054, 0.06398940831422806, -0.04013756290078163, -0.011984928511083126, 0.07229093462228775, 0.027209661900997162, -0.01846596784889698, 0.014532945118844509, 0.027841875329613686, -0.03423468396067619, -0....
0.808902
0.78817
0.020731
Can you provide a function that determines whether a given number is prime or not?
glaive
[ 0.03217768296599388, 0.015888255089521408, -0.018614623695611954, -0.03207307681441307, 0.023324694484472275, -0.04102705046534538, 0.009989465586841106, 0.06326884776353836, 0.03711347281932831, -0.01681470312178135, 0.022587375715374947, 0.020966995507478714, -0.030265655368566513, -0.03...
0.791527
0.77168
0.019847
You are tasked with creating a program that processes and analyzes data related to the COVID-19 outbreak. You have been provided with a dataset containing information about the number of confirmed cases, deaths, and recoveries in various regions. Each entry in the dataset includes the following fields: - confirmed: the...
glaive
[ 0.030224865302443504, 0.023181810975074768, -0.05257747322320938, -0.0439751073718071, 0.031400397419929504, -0.03464614599943161, -0.015472733415663242, 0.08258488774299622, 0.03156634420156479, -0.0031489499378949404, 0.03121977113187313, 0.04893533140420914, -0.003419153857976198, 0.015...
0.805822
0.788126
0.017695
You are tasked with writing a kernel function for a GPU program that performs GROUP BY operation on input data. The kernel processes input keys and values, adds new keys to a hash table, and aggregates the values. The hash table is implemented using key and value buffers along with a key occurrence count buffer. The in...
glaive
[ 0.016276346519589424, 0.048347797244787216, -0.024607602506875992, -0.024068066850304604, 0.026544783264398575, -0.023571697995066643, -0.028292203322052956, 0.07745277136564255, 0.034113559871912, -0.005264383740723133, 0.029366450384259224, 0.016901010647416115, 0.004253071267157793, 0.0...
0.798168
0.781437
0.016731
How can I write a function that finds the smallest missing positive integer in a given list?
glaive
[ 0.007923174649477005, 0.030561110004782677, -0.025412950664758682, -0.0492161400616169, 0.058050110936164856, -0.02515813335776329, -0.026429327204823494, 0.03005972132086754, 0.04458238556981087, -0.013099374249577522, 0.01912604458630085, 0.03580118715763092, -0.01709100417792797, -0.022...
0.808386
0.793634
0.014753
You are tasked with implementing a function to add two matrices together using CUDA in C++. The function should take in three arguments: the result matrix, and the two matrices to be added. The matrices will be represented as structs with the following definition: ```c++ struct Matrix { std::size_t height; std...
glaive
[ 0.014358382672071457, 0.025390636175870895, -0.013341451063752174, -0.026701368391513824, 0.043070901185274124, 0.007288191933184862, -0.021805938333272934, 0.12249621748924255, 0.05571509525179863, -0.011353337205946445, 0.006919426843523979, 0.03818599507212639, -0.009289667010307312, -0...
0.791578
0.766289
0.025289
You are tasked with creating a program that generates a sequence of numbers based on the following formula: Interleave n*(3*n - 2), 3*n^2 + n - 1, n=0,0,1,1, ... Implement a function or method that takes an input 'n' and returns the nth number in the sequence. The sequence should start with 0,-1,1,3,8,13,21,29,40,5...
glaive
[ 0.035495106130838394, 0.040314190089702606, -0.01619359478354454, -0.06772475689649582, 0.02830479107797146, -0.026238540187478065, -0.04017627239227295, 0.0575396865606308, 0.027914373204112053, -0.021477224305272102, 0.04442625865340233, 0.03859277814626694, -0.06130339205265045, -0.0151...
0.824832
0.772366
0.052467
You are tasked with creating a shader program that takes in uniform variables and performs various operations on them. The shader program should include a main function that returns a PS_OUTPUT struct, with the color of the pixel set as 1.0. The shader program should perform the following operations on the uniform var...
glaive
[ 0.010746285319328308, 0.03367617353796959, -0.034295838326215744, -0.027524640783667564, 0.0373428575694561, -0.052321821451187134, -0.019116105511784554, 0.098490409553051, 0.04949473217129707, -0.005102812312543392, 0.036486994475126266, 0.017059680074453354, -0.006856256164610386, -0.00...
0.802497
0.787457
0.01504
I need help with a programming problem related to calculating the power level of fuel cells in a grid. Each fuel cell has a coordinate ranging from 1 to 300 in both the X (horizontal) and Y (vertical) direction. In X,Y notation, the top-left cell is 1,1, and the top-right cell is 300,1. The power level in a given fuel ...
glaive
[ 0.00846709031611681, 0.045198507606983185, -0.04366889223456383, -0.05546407774090767, 0.02094007469713688, -0.04610272869467735, -0.014389777556061745, 0.06451474130153656, 0.024445975199341774, -0.022964540868997574, 0.026669366285204887, 0.035156119614839554, -0.05763412266969681, -0.01...
0.812556
0.787324
0.025232
You are tasked with creating a program that generates a sequence of chimes made by a clock striking the hour and half-hour. The sequence should be in the format 1,1,1,2,1,3,1,4,1,5,1,6,1,7,1,8,1,9,1,10,1,11,1,12,1,1,1,2,1,3,1,4,1,5,1,6,1,7,1,8,1,9,1,10,1,11,1,12,1,1,1,2,1,3,1,4,1,5,1,6,1,7,1,8,1,9,1,10,1,11,1,12. You s...
glaive
[ 0.028169136494398117, 0.033307626843452454, -0.013592594303190708, -0.024224676191806793, 0.016014594584703445, -0.02839212492108345, -0.03772638738155365, 0.07918489724397659, 0.023084530606865883, -0.020163409411907196, 0.04077056050300598, 0.03812185302376747, -0.045754287391901016, -0....
0.807217
0.769125
0.038092
You are tasked with implementing a C++ function that initializes a PROPVARIANT structure based on a specified vector of 16-bit integer values. The function should take in a source vector of SHORT values, the number of elements in the vector, and a pointer to the initialized PROPVARIANT structure. If the source vector p...
glaive
[ 0.007758069317787886, 0.026057103648781776, -0.01556013710796833, -0.022978825494647026, 0.05695454031229019, -0.01626371219754219, -0.012848371639847755, 0.12381699681282043, 0.04304187372326851, -0.023167984560132027, 0.0065109822899103165, 0.0509926937520504, 0.0038155298680067062, -0.0...
0.808604
0.792058
0.016546
You are tasked with writing a function that sums the elements of an integer array. The function should take two parameters: the integer array (IVEC) and the number of elements in the array (NELMNT). The function should return the sum of all the elements in the array.
glaive
[ 0.022668469697237015, 0.02303565852344036, -0.036777008324861526, -0.03855208680033684, 0.05476357042789459, -0.034082841128110886, -0.020293554291129112, 0.04607471078634262, 0.02198302187025547, 0.0022395544219762087, 0.017054319381713867, 0.04198393225669861, -0.0467379204928875, -0.020...
0.80256
0.763911
0.03865
You are tasked with implementing a function to calculate the multiplier on the rows of a contact matrix over time for a specific country. The function takes multiple parameters and returns a matrix of impact_intv. You need to write the function country_impact that takes in vector beta, real upswing_rdeff_local, int N2,...
glaive
[ 0.030842525884509087, 0.03676997870206833, -0.041663046926259995, -0.036599837243556976, 0.05639495328068733, -0.01560659147799015, -0.025705844163894653, 0.07875330001115799, 0.03074038401246071, -0.00020672670507337898, 0.021162409335374832, 0.04369111731648445, -0.0314016230404377, 0.00...
0.798485
0.781327
0.017158
You are tasked with creating a program that calculates the probability of a quantum state in a given range using a quantum amplitude function. The program should also find the maximum probability within a specified range and plot the probability function in both 3D and contour plots. Create a program that: - Defines a...
glaive
[ 0.008791746571660042, 0.03661918267607689, -0.0340789370238781, -0.023799244314432144, 0.04210539162158966, -0.02716773748397827, -0.023058079183101654, 0.07703309506177902, 0.03136787936091423, 0.01042851060628891, 0.02838926389813423, 0.03890836611390114, -0.027635153383016586, -0.023040...
0.788313
0.762049
0.026264
You are tasked with implementing a program to estimate the number of deaths by age and country based on reported deaths and various input parameters. The program should use a Bayesian approach to model the expected number of deaths, taking into account factors such as the number of initial days for which to estimate in...
glaive
[ 0.023260997608304024, 0.00895980466157198, -0.04771067574620247, -0.040107861161231995, 0.04020047187805176, -0.011893132701516151, -0.03199253976345062, 0.06825362890958786, 0.038665685802698135, -0.01922081597149372, 0.00612555630505085, 0.05030834302306175, -0.004736331757158041, 0.0403...
0.785839
0.768051
0.017789
You are required to implement a C++ program that utilizes the vec3 struct to perform various vector operations. The program should include the following functionalities for the vec3 struct: - Addition, subtraction, multiplication, and division of two vec3 instances. - Addition, subtraction, multiplication, and division...
glaive
[ 0.019456051290035248, 0.022578205913305283, -0.02103179320693016, -0.029199691489338875, 0.03485001251101494, -0.004828774370253086, -0.03878556936979294, 0.1003490462899208, 0.029639577493071556, -0.009210309945046902, 0.02344604954123497, 0.036072634160518646, -0.005626059137284756, -0.0...
0.796416
0.772209
0.024208
What is the code to find the maximum integer value in an array of integers?
glaive
[ 0.024577148258686066, 0.033805962651968, -0.03109888918697834, -0.033214885741472244, 0.030788995325565338, -0.03559408336877823, -0.02384467050433159, 0.03506842628121376, 0.030958984047174454, -0.05031644552946091, 0.029474681243300438, 0.04168396443128586, -0.03503990173339844, -0.01039...
0.805559
0.778305
0.027254
I need to rearrange a list of natural numbers so that every partial sum is composite. A composite number is a positive integer that has at least one positive divisor other than 1 and itself. I need to write a program that can rearrange the numbers in the list to meet this condition.
glaive
[ 0.020517652854323387, 0.01426131185144186, -0.016608068719506264, -0.04103800281882286, 0.03686276450753212, -0.010308529250323772, -0.011229936964809895, 0.04256003722548485, 0.03522196784615517, -0.010767671279609203, 0.028342334553599358, 0.04365229979157448, -0.04739278554916382, -0.02...
0.817076
0.794884
0.022192
You are tasked with implementing a program that involves manipulating and transforming various data types in a specific manner. The program must take input in the form of different data types, such as integers, arrays, vectors, and row vectors. Additionally, the program is expected to perform transformations on the inp...
glaive
[ -0.0016830109525471926, 0.015602651983499527, -0.03773239254951477, -0.0405048206448555, 0.038213565945625305, -0.018472522497177124, -0.00816840585321188, 0.062404535710811615, 0.04793059080839157, -0.014933914877474308, 0.004852076061069965, 0.047978874295949936, -0.006946469657123089, 0...
0.802809
0.786006
0.016803
I have a sorted array and I need to check if it contains any duplicate numbers. Can someone help me with a solution?
glaive
[ 0.010821633040904999, 0.00887362938374281, -0.041312746703624725, -0.025381144136190414, 0.021743662655353546, -0.03230254352092743, -0.004596744664013386, 0.06445623934268951, 0.022998150438070297, -0.025994034484028816, 0.010649117641150951, -0.004289872478693724, -0.03769468888640404, -...
0.800771
0.778625
0.022146
You are working on a project that involves creating a function in Python to calculate the roots of a quadratic equation. The function should take the coefficients of the quadratic equation as input and return the roots as output. The quadratic equation is of the form ax^2 + bx + c = 0. Write a Python function to calcu...
glaive
[ 0.032841604202985764, 0.0478200763463974, -0.06319597363471985, -0.033387668430805206, 0.034510184079408646, -0.038474176079034805, 0.004658553749322891, 0.06332138180732727, 0.03283417597413063, -0.014671877026557922, 0.005554455332458019, 0.02498847432434559, -0.03127094730734825, -0.017...
0.779569
0.76386
0.015709
You are tasked with creating a program to calculate the probability distribution of a quantum state using a given set of amplitudes. The amplitudes are defined by the functions `amplitude[x_,y_]` and `amplitude2[x_,y_]`. Your program should use the `probability[x, y]` function to calculate the probability distribution ...
glaive
[ -0.0008444024133495986, 0.030558975413441658, -0.026205768808722496, -0.022480890154838562, 0.04055386781692505, -0.022681303322315216, -0.018613530322909355, 0.06903410702943802, 0.043074995279312134, 0.0064939954318106174, 0.02155282348394394, 0.03372453898191452, -0.018477877601981163, ...
0.795728
0.763346
0.032382
You are required to implement a function that performs sparse matrix-vector multiplication (spmv) using the compressed sparse row (CSR) format. You are given the following parameters: - `nnz`: the number of nonzeros in the matrix - `num_lines`: the maximum round of each warp - `val`: the value array of the matrix - `co...
glaive
[ 0.0065656122751533985, 0.04110931605100632, -0.029857106506824493, -0.038490913808345795, 0.04967312514781952, -0.012506355531513691, -0.024282267317175865, 0.07833635807037354, 0.02834484912455082, -0.012586989440023899, 0.015185653232038021, 0.028726628050208092, -0.008952019736170769, -...
0.796588
0.776716
0.019872
You are tasked with creating a program that calculates the ideal weight for both men and women based on their height. The formula for calculating ideal weight for a man is (height - 100) * 1.15, and for a woman is (height - 110) * 1.15. Write a Java program that includes a class called "Fit" with the following methods...
glaive
[ 0.014581054449081421, 0.018025005236268044, -0.04634444788098335, -0.04205028712749481, 0.04620577394962311, -0.032464515417814255, -0.013865848071873188, 0.032053858041763306, 0.04063313081860542, -0.04318305104970932, 0.03465503826737404, 0.03574233874678612, -0.027727993205189705, -0.01...
0.793956
0.770054
0.023902
You are tasked with writing a program that will print a specific pattern of tiles to the screen. The pattern is represented by a 2D array of hexadecimal values, which need to be copied to a specific memory location in order to be displayed. Additionally, the program should include a function to wait for a specific numb...
glaive
[ 0.009106836281716824, 0.041568953543901443, -0.017744868993759155, -0.014926685951650143, 0.033727046102285385, -0.03793958202004433, -0.032212913036346436, 0.0794973149895668, 0.049038127064704895, -0.013939319178462029, 0.035767607390880585, 0.04679408669471741, -0.029235677793622017, -0...
0.811372
0.790856
0.020516
You are tasked with creating a program that reads a list of integers and calculates the sum of all the numbers in the list that are divisible by 3 or 4. Write a program that takes in a list of integers and returns the sum of all the numbers in the list that are divisible by 3 or 4.
glaive
[ 0.019349653273820877, 0.021189697086811066, -0.029944786801934242, -0.044516682624816895, 0.06802880764007568, -0.038039062172174454, -0.02800392173230648, 0.027855362743139267, 0.03549550101161003, -0.005982100963592529, 0.031902819871902466, 0.04521722346544266, -0.044113557785749435, -0...
0.809601
0.776854
0.032747
You are tasked with creating a program that generates a sequence of numbers based on the denominator of the sum of a specific formula. The formula is the sum of the reciprocals of the squares of natural numbers up to a certain limit. The output should be a sequence of numbers that represent the denominators of these su...
glaive
[ 0.013794935308396816, 0.023027576506137848, -0.039952222257852554, -0.04505031183362007, 0.044452160596847534, -0.011367385275661945, -0.021296314895153046, 0.07191504538059235, 0.03477729484438896, -0.03613085672259331, 0.012890186160802841, 0.05195428431034088, -0.05284876003861427, -0.0...
0.816468
0.772464
0.044004