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 tasked with finding circular primes below one million. A circular prime is a number that remains prime when its digits are rotated in all possible ways. For example, 197 is a circular prime because 197, 971, and 719 are all prime. Your task is to write a Julia program to count the number of circular primes b...
glaive
[ -0.011303610168397427, 0.038544803857803345, -0.0212235227227211, -0.03976023569703102, 0.02724936604499817, -0.02450847439467907, -0.027882864698767662, 0.05085770785808563, 0.03809242695569992, 0.003965822979807854, 0.017853068187832832, 0.0220564603805542, -0.02432226948440075, -0.01599...
0.803426
0.766126
0.0373
You have been given three point pattern objects: `p_poisson`, `p_cluster`, and `p_regular`. Your task is to perform the following operations on each of these point patterns: 1. Calculate the nearest-neighbor distances for each point in the point pattern. 2. Plot a histogram of the nearest-neighbor distances. 3. Estimat...
glaive
[ 0.014260517433285713, 0.03275512531399727, -0.037594106048345566, -0.03652438521385193, 0.030175240710377693, -0.03808431699872017, -0.02372872456908226, 0.04492374509572983, 0.05458085238933563, 0.015639357268810272, 0.01090284250676632, 0.037552330642938614, -0.010013831779360771, 0.0090...
0.812821
0.779278
0.033543
You are tasked with implementing a C++ class named `CudaMesh` that represents a two-dimensional mesh, which will be used for various mathematical operations. The class should have the following functionalities: 1. Constructor that takes a `VectorSpec` object and creates a mesh with a default shape. 2. Constructor that ...
glaive
[ 0.028867866843938828, 0.04260651767253876, -0.010782222263514996, -0.02964896149933338, 0.03817276656627655, -0.010834917426109314, -0.02894233725965023, 0.10628928989171982, 0.043151721358299255, -0.018355507403612137, 0.029059113934636116, 0.06164739280939102, -0.008854091167449951, -0.0...
0.785667
0.766724
0.018942
Write a program to calculate the number of length-6 arrays with no repeated value greater than or equal to the previous repeated value. The array can contain values from 0 to n. You need to implement a function that takes an integer n as input and returns the count of such arrays. For example, when n=2, the count of s...
glaive
[ 0.009715312160551548, 0.02381880395114422, -0.04175984486937523, -0.01835397072136402, 0.04151825234293938, -0.0331382155418396, -0.040834713727235794, 0.059889599680900574, 0.014191540889441967, -0.03231533244252205, 0.01829701103270054, 0.024050148203969002, -0.03272998705506325, -0.0331...
0.834287
0.787355
0.046932
You are tasked with creating a program that analyzes custom features of an image and calculates various statistics based on the features. The features include area_mean, area_variance, contour_count, distance_mean, largest_contour_area, largest_contour_circularity, largest_contour_convexity, largest_contour_eccentricit...
glaive
[ 0.00317300483584404, 0.02265581488609314, -0.0483766607940197, -0.03634288161993027, 0.027473708614706993, -0.009686357341706753, -0.020617425441741943, 0.06979948282241821, 0.037556521594524384, -0.0062654148787260056, 0.02518288791179657, 0.025585202500224113, -0.040171004831790924, 0.02...
0.795856
0.772735
0.023121
You are tasked with creating a program that will take a list of integers as input and perform the following operations: - Remove all duplicate elements from the list - Sort the list in ascending order - Calculate the sum of all the elements in the list - Print the modified list and the sum of the elements Write a func...
glaive
[ 0.037360213696956635, 0.02582778036594391, -0.020862257108092308, -0.03595256432890892, 0.05750112980604172, -0.04655597731471062, -0.01162577886134386, 0.05542214214801788, 0.05407014489173889, -0.022335253655910492, 0.012129632756114006, 0.025276964530348778, -0.04354211688041687, -0.032...
0.819446
0.786212
0.033235
How can I create an array of N zeros in Python?
glaive
[ 0.006365507375448942, 0.030851423740386963, -0.029349589720368385, -0.012717860750854015, 0.03325628861784935, -0.027322379872202873, -0.0217598807066679, 0.02742994762957096, 0.02095903642475605, -0.032285094261169434, 0.00994346383959055, 0.020188897848129272, -0.03595402091741562, -0.02...
0.799734
0.785131
0.014603
You are tasked with writing a program that validates a list of passwords based on their respective password policies. Each line in the input file contains a password policy and password, separated by a colon. The password policy specifies the position of a given character in the password, and the character itself. The ...
glaive
[ 0.018050527200102806, 0.01673275977373123, -0.0079349959269166, -0.036191217601299286, 0.02610139362514019, -0.032927948981523514, -0.010095195844769478, 0.040026336908340454, 0.020578185096383095, -0.015139921568334103, 0.00972244143486023, 0.016828114166855812, -0.03156876564025879, -0.0...
0.816084
0.78438
0.031704
You are given an array of integers, nums. You need to determine if it is possible to make one change to the array, such that the resulting array is non-decreasing. Write a function checkPossibility that takes in the array nums and returns true if and only if it is possible to make one change to the array to make it no...
glaive
[ 0.01708918996155262, 0.0486501045525074, -0.009123331867158413, -0.01785694807767868, 0.045404013246297836, -0.032248858362436295, -0.0031678543891757727, 0.08620807528495789, 0.02990376390516758, -0.02382616326212883, 0.01623641513288021, 0.011550419963896275, -0.0453622080385685, -0.0266...
0.825935
0.788078
0.037858
You are tasked with creating a program that calculates the probability distribution of a quantum state amplitude and then maximizes the probability using a simulated annealing method. The program should then generate a 3D plot of the probability distribution and a contour plot for visualization.
glaive
[ 0.011446237564086914, 0.02905278466641903, -0.03466947376728058, -0.03682556375861168, 0.031725648790597916, -0.025539958849549294, -0.02720678225159645, 0.07340952008962631, 0.03502475842833519, -0.011342356912791729, 0.023388640955090523, 0.037665318697690964, -0.019873345270752907, -0.0...
0.803465
0.783464
0.020001
I need to create a program that can transform data using a specific mathematical operation. The transformed data consists of a real number array `y` with dimensions 2x3, and a single real number `x`. The program should perform a transformation operation where the value of `x` is assigned the value located at index (1,2...
glaive
[ 0.020336110144853592, 0.0474424846470356, -0.054007478058338165, -0.0410359725356102, 0.03310776129364967, -0.017037903890013695, -0.021096710115671158, 0.07756011188030243, 0.03558380901813507, -0.023174447938799858, 0.0116093335673213, 0.028108492493629456, -0.028632061555981636, -0.0170...
0.813568
0.792857
0.020711
You are tasked with creating a program that extracts specific strings from a given input based on a provided regular expression pattern. The program should allocate memory for the extracted strings and output the results. Your program should be able to: - Accept a regular expression pattern as input - Extract specifie...
glaive
[ 0.029512176290154457, 0.02165081910789013, -0.0279393307864666, -0.021944168955087662, 0.028100037947297096, -0.05829927325248718, -0.01765589974820614, 0.05286065861582756, 0.04507895186543465, -0.02124139294028282, 0.011331315152347088, 0.03431222587823868, -0.03184656798839569, -0.02012...
0.81332
0.798473
0.014847
You are tasked with implementing a Verilog module that calculates the Numerically Controlled Oscillator (NCO) value based on the given baud rate, NCO width, and clock frequency. The Verilog module should define a parameterized macro `CALC_NCO` that takes in the baud rate, NCO width, and clock frequency as input and out...
glaive
[ 0.01929563283920288, 0.049040187150239944, -0.039439644664525986, -0.02859117090702057, 0.026640284806489944, -0.026566125452518463, -0.022910771891474724, 0.076211117208004, 0.02284948155283928, 0.006988112814724445, 0.029277648776769638, 0.048069585114717484, -0.019914718344807625, -0.00...
0.798184
0.781738
0.016447
You are tasked with implementing a function to solve a harmonic oscillator ordinary differential equation (ODE) using the Runge-Kutta method in a programming language that supports Stan, such as R or Python. The function should take in the initial state `y0`, a matrix of initial times `t0`, an array of solution times `...
glaive
[ 0.015736272558569908, 0.046809278428554535, -0.03013347089290619, -0.04804177209734917, 0.032681189477443695, -0.02394109033048153, -0.01466443482786417, 0.07292385399341583, 0.04109374061226845, -0.009856351651251316, 0.020545169711112976, 0.030921678990125656, -0.017071321606636047, -0.0...
0.802067
0.787429
0.014638
You are required to write a program that creates a matrix using the given input variables. The program should take into account the specified options and conditions and produce the desired matrix as output. The program should handle different cases, including scenarios where specific variables are specified, as well as...
glaive
[ 0.014479734003543854, 0.012147421948611736, -0.043597061187028885, -0.02606799080967903, 0.05308979004621506, -0.03265902027487755, -0.03454931452870369, 0.08554122596979141, 0.04486580938100815, -0.020408950746059418, 0.02222321182489395, 0.03031337633728981, -0.019438153132796288, -0.017...
0.794813
0.776012
0.018801
You are tasked with implementing a program that works with range sets. A range set is a sorted set of nonempty, disconnected ranges, all using the same comparator. Your program needs to be able to perform various operations on these range sets, such as determining the number of ranges, checking if a value is contained ...
glaive
[ 0.04593672603368759, 0.02198127843439579, -0.03951280564069748, -0.015830520540475845, 0.04030478373169899, -0.029376881197094917, -0.023010313510894775, 0.06832685321569443, 0.048922862857580185, -0.019168073311448097, 0.024848030880093575, 0.0341348797082901, -0.04461446404457092, -0.008...
0.802347
0.777815
0.024532
You are tasked with creating a program that takes an integer input `d_int` and performs a series of transformations on it. The transformations involve logical operations with both `int` and `real` data types. After the transformations, the program should calculate a new parameter `transformed_param_real` based on the t...
glaive
[ 0.020801667124032974, 0.031675588339567184, -0.03202925622463226, -0.04599272459745407, 0.029543889686465263, -0.01998005621135235, -0.00879210140556097, 0.06768970936536789, 0.03866301104426384, -0.014343909919261932, 0.015757372602820396, 0.04156283289194107, -0.027992822229862213, 0.002...
0.810871
0.790143
0.020728
You are tasked with creating a program that models a system of locations and movements within those locations. The system consists of 9 locations (loc1, loc2, ..., loc9) and various movements between them. Each movement is defined by an operator, such as move-forward or move-backward, and is associated with specific lo...
glaive
[ 0.019879557192325592, 0.02081017941236496, -0.04501383751630783, -0.027313588187098503, 0.032612208276987076, -0.03266368433833122, -0.04750329628586769, 0.055865801870822906, 0.049609147012233734, -0.0268121138215065, 0.03127194195985794, 0.047189850360155106, -0.028403110802173615, -0.00...
0.80619
0.790233
0.015957
You are tasked with creating a CUDA C++ program that demonstrates the use of block reduce, specifically for a single thread block, using the CUB library. The program should include a kernel for finding the block-wide maximum over float values and another kernel for finding the block-wide sum over float values. Your ta...
glaive
[ 0.01050323061645031, 0.052253205329179764, -0.026391886174678802, -0.012025510892271996, 0.0411127470433712, -0.005400745198130608, -0.030287642031908035, 0.10076937079429626, 0.049077071249485016, -0.010931789875030518, 0.004466988146305084, 0.031131014227867126, -0.0055372267961502075, 0...
0.801487
0.782052
0.019436
You are tasked with creating a C++ program that implements an inverted file index for a set of vectors. The program should be able to add vectors to the index, search for the nearest neighbors of a query vector, and reclaim memory when necessary. Your program should include the following functionalities: - Initialize ...
glaive
[ 0.01414434053003788, 0.03787928447127342, -0.004138624761253595, -0.00667149294167757, 0.025900278240442276, -0.006825623102486134, -0.022147946059703827, 0.09112342447042465, 0.027747150510549545, -0.006809312850236893, 0.025040382519364357, 0.02034837193787098, -0.02667970582842827, 0.00...
0.806921
0.781349
0.025572
You are tasked with writing a program to perform batch operations on a set of points in a 2D plane. The set of points is provided as a list of coordinates, and the operations to be performed include creating a polygon and quitting the program. You need to implement the operationsBatch function to execute these operatio...
glaive
[ 0.04265981167554855, 0.03751799836754799, -0.05249603092670441, -0.01922200620174408, 0.02844594605267048, -0.017260806635022163, -0.02600797265768051, 0.06609591841697693, 0.05785079672932625, 0.0011589154601097107, 0.00905581098049879, 0.039409078657627106, -0.03088734857738018, -0.00627...
0.807906
0.790329
0.017578
You are required to write a CUDA C++ program that concatenates multiple arrays into a single array using both sequential and parallel methods. The input to the program is a vector of arrays, and the output is a single concatenated array. The program should be able to handle different types of arrays, such as char, doub...
glaive
[ 0.008076806552708149, 0.05372312664985657, 0.001023668679408729, -0.01730145886540413, 0.030303262174129486, 0.0036043471191078424, -0.030060792341828346, 0.09651560336351395, 0.04634174332022667, -0.02598591148853302, 0.009757197462022305, 0.03984556347131729, -0.0021567095536738634, -0.0...
0.796269
0.767236
0.029033
You are tasked with implementing a stack data structure in Common Lisp. The stack should support the following operations: 1. `make-stack`: Create an empty stack. 2. `stack-push`: Push an item onto the stack. 3. `stack-pop`: Remove and return the top item from the stack. 4. `stack-top`: Return the top item from the sta...
glaive
[ 0.03194800391793251, 0.01820993423461914, -0.026375126093626022, -0.03674588352441788, 0.04276398569345474, -0.04319518432021141, -0.01525839976966381, 0.07411836087703705, 0.036614853888750076, -0.010376923717558384, 0.029636802151799202, 0.03690921142697334, -0.034133318811655045, -0.007...
0.799174
0.784593
0.014581
Can you provide a function that can find the lengths of the longest common substrings in two given strings?
glaive
[ 0.0065553802996873856, 0.023832567036151886, -0.04476171359419823, -0.0338510200381279, 0.028052546083927155, -0.042541347444057465, -0.02052449621260166, 0.03046790324151516, 0.024937056005001068, -0.02989213541150093, 0.0191583801060915, 0.020872056484222412, -0.02289412170648575, -0.008...
0.808905
0.789751
0.019154
You are tasked with creating a program that generates a hexadecimal color code based on a given level. The color code should be calculated following the formula: color = 0xd53feb * level & 0xffffff | 0x808080. Your program should take the level as input and output the corresponding hexadecimal color code. For example,...
glaive
[ 0.00556706078350544, 0.02757995016872883, -0.019156083464622498, -0.04693029448390007, 0.030656985938549042, -0.04856781288981438, -0.033985234797000885, 0.08165735751390457, 0.03327169269323349, -0.03309425339102745, 0.03613247722387314, 0.029819997027516365, -0.0264250747859478, -0.00671...
0.791295
0.773579
0.017716
You are tasked with implementing a Fortran subroutine to solve a generalized linear least squares problem. The subroutine should take input parameters M, N, P, A, LDA, B, LDB, C, D, X, WORK, LWORK, and INFO, where M, N, and P are integers representing the dimensions of the problem, A and B are real arrays of size (LDA,...
glaive
[ -0.016194984316825867, 0.029322952032089233, -0.02986450307071209, -0.06749226897954941, 0.04393943026661873, -0.01612796261906624, -0.011144394986331463, 0.05813109129667282, 0.03348269686102867, -0.007849829271435738, 0.018173888325691223, 0.03900719806551933, -0.022694524377584457, 0.00...
0.805852
0.78434
0.021512
You are tasked with creating a Stan program to define a simple model that simulates a vector of values 'y' as normally distributed with mean 'mu' and standard deviation 'sigma'. The input data consists of a vector 'y' of length 'N', with additional variables 'K', 'NK', 'M', 'y', 'w', 'x', 'lag1_w', 'lag1_x', 'worig', a...
glaive
[ 0.015936383977532387, 0.011534275487065315, -0.03410142660140991, -0.056390561163425446, 0.04602966457605362, -0.034581974148750305, -0.036166712641716, 0.0630161464214325, 0.030722638592123985, -0.023022174835205078, 0.011584249325096607, 0.04982200637459755, -0.037352122366428375, 0.0165...
0.790288
0.773239
0.017048
You are tasked with identifying households that have more than 2 children of any age. You have been given a dataset with information on households, including the number of children in each age range. Your goal is to create a program that will output the households where the calculated number of dependents (based on top...
glaive
[ 0.02087823487818241, 0.018383951857686043, -0.028744643554091454, -0.026516174897551537, 0.03307098522782326, -0.0033085981849581003, 0.001765199238434434, 0.06270001083612442, 0.03664670139551163, -0.0013402680633589625, 0.04516652971506119, 0.024544864892959595, -0.021623769775032997, -0...
0.798946
0.774393
0.024553
You are tasked with creating a program to calculate the probability amplitudes of a quantum system and then visualize the results. The program should take into account a given number of qubits, states, and a specific name for the system. The program should calculate the probability amplitudes using the provided formul...
glaive
[ 0.0057550775818526745, 0.03314801678061485, -0.019734647125005722, -0.014230849221348763, 0.039326369762420654, -0.04193520545959473, -0.01904132030904293, 0.06690791994333267, 0.039183393120765686, 0.003958460874855518, 0.02221686765551567, 0.036434274166822433, -0.018039172515273094, -0....
0.798885
0.77027
0.028615
You are tasked with implementing a Tetris game using the provided SML code snippet as a reference. The goal is to create a functional Tetris game interface with the ability to move, rotate, and drop shapes within the game grid. The game should also include features such as clearing completed rows, keeping track of the ...
glaive
[ 0.009411711245775223, 0.01838529482483864, -0.03248622640967369, -0.0507805272936821, 0.045179665088653564, -0.028208328410983086, -0.034299999475479126, 0.05910683795809746, 0.036871399730443954, -0.028330808505415916, 0.0314471498131752, 0.029501749202609062, -0.01537251751869917, 0.0023...
0.796013
0.778419
0.017593
What is a C++ program that takes three integers and calculates their sum?
glaive
[ 0.008882187306880951, 0.016596248373389244, -0.04572466388344765, -0.047771185636520386, 0.04821561649441719, -0.009045034646987915, -0.014424942433834076, 0.07518396526575089, 0.021183397620916367, -0.03357430920004845, 0.02672632783651352, 0.058971282094717026, -0.04577578976750374, -0.0...
0.782851
0.766455
0.016396
You are tasked with creating a program that calculates the probability of a quantum state. The program should utilize the given amplitude and probability functions, and use the NMaximize function to find the maximum probability. After that, the program should produce a 3D plot of the probability function and a contour ...
glaive
[ 0.002124168910086155, 0.028766361996531487, -0.03480222448706627, -0.02346411533653736, 0.04644399136304855, -0.018896276131272316, -0.020014898851513863, 0.07563239336013794, 0.037249960005283356, 0.006583599839359522, 0.027932865545153618, 0.03759642317891121, -0.019535882398486137, -0.0...
0.792906
0.771155
0.021752
You are tasked with implementing a Caratheodory measurable space using an outer measure `μ`. The Caratheodory measurable space is defined such that a set `s` is measurable if for every set `t`, the measure of `t` is equal to the measure of the intersection of `t` and `s`, plus the measure of the set difference of `t` a...
glaive
[ 0.018845247104763985, 0.01898866891860962, -0.03218920901417732, -0.03640468046069145, 0.057650573551654816, -0.015094068832695484, -0.057290591299533844, 0.07714568823575974, 0.05898227542638779, -0.0027477226685732603, 0.009649127721786499, 0.034399453550577164, -0.027973247691988945, -0...
0.797556
0.77706
0.020496
You are tasked with implementing a function that takes an input array and performs a reduction operation on it. The reduction operation should sum the elements of the array and return the resulting value. The function should be designed to work in a CUDA environment and should make use of warp-level and block-level red...
glaive
[ 0.0007198875537142158, 0.05011993274092674, -0.031344424933195114, -0.02316725254058838, 0.04876040294766426, -0.012278364039957523, -0.018512556329369545, 0.1149640753865242, 0.06454794108867645, 0.0008699058089405298, 0.017704039812088013, 0.04028332233428955, -0.0036406521685421467, 0.0...
0.810192
0.792532
0.01766
You are tasked with creating a program that calculates the probability of a quantum system being in a certain state, based on the given amplitudes. The program should then find the maximum probability and plot the 3D and contour graphs of the probability distribution.
glaive
[ 0.009986677207052708, 0.01956837624311447, -0.04083331674337387, -0.02686259336769581, 0.047034140676259995, -0.02814444713294506, -0.024783868342638016, 0.0698748230934143, 0.0427761934697628, -0.00906724389642477, 0.028345583006739616, 0.03792351484298706, -0.016161127015948296, -0.01665...
0.805403
0.781504
0.023899
You are tasked with creating a set of functions that manipulate strings based on the position of a specified substring within the string. You need to implement the following functions: 1. substringBefore_(text, key): This function should return the portion of the "text" that precedes the first occurrence of the "key" ...
glaive
[ 0.03435545042157173, 0.038139160722494125, -0.01655605249106884, -0.04121366888284683, 0.03235376626253128, -0.05226771906018257, -0.00783491600304842, 0.06304621696472168, 0.014237068593502045, 0.0013301066355779767, 0.028754401952028275, 0.01729058101773262, -0.03648699074983597, -0.0053...
0.811599
0.791836
0.019762
You are tasked with creating a program to calculate and visualize the probability distribution for a quantum system. The system is defined by a set of quantum states and amplitudes, which are given by the functions amplitude[x_,y_], amplitude2[x_,y_], and probability[x_,y_]. The goal is to use the NMaximize function to...
glaive
[ 0.0024162617046386003, 0.024935565888881683, -0.031013095751404762, -0.02514944039285183, 0.03970900923013687, -0.025885313749313354, -0.01964631862938404, 0.07194025069475174, 0.05176939442753792, 0.010416180826723576, 0.022122088819742203, 0.03485969826579094, -0.014134271070361137, -0.0...
0.792507
0.762257
0.03025
I need help completing the following code. We have an array 'arr' consisting of N integers, including arr[1], arr[2], ..., arr[N]. The numbers in the array are randomly arranged. I need to perform the following operation to ensure that each element is within the multiples of the elements preceding it: - We can perform...
glaive
[ 0.023072654381394386, 0.04181350767612457, -0.019225655123591423, -0.021984707564115524, 0.041516903787851334, -0.01354946382343769, -0.021668430417776108, 0.053809620440006256, 0.026399970054626465, -0.013212268240749836, -0.007919415831565857, 0.006659059319645166, -0.02875589206814766, ...
0.84316
0.787644
0.055515
You are tasked with creating a program that implements the I32_lt_s opcode for comparing two 32-bit signed integers. The program should take two integer values as input and determine if the first value is less than the second value. The program should then return 1 if the first value is less than the second, and 0 othe...
glaive
[ -0.0025848159566521645, 0.02412240579724312, -0.023587537929415703, -0.019918009638786316, 0.039116021245718, -0.017378613352775574, -0.017570052295923233, 0.09065287560224533, 0.03402183577418327, -0.02480214461684227, 0.03985850512981415, 0.041289910674095154, -0.042010486125946045, -0.0...
0.808323
0.790964
0.017359
You are tasked with implementing a function to fetch SRTM (Shuttle Radar Topography Mission) heights. The function should take in a list of tile IDs and return the corresponding height array if at least one tile is found, or None if no tiles are found. The tile IDs are represented as a tuple (zoom level, x coordinate, ...
glaive
[ 0.02378355711698532, 0.03270312026143074, -0.0445556715130806, -0.04562054201960564, 0.04912593215703964, -0.023916194215416908, -0.033799540251493454, 0.06417703628540039, 0.03499181941151619, -0.0059214201755821705, 0.025604471564292908, 0.021493278443813324, -0.02939670905470848, -0.001...
0.800214
0.783635
0.016579
You are tasked with creating a function in the `function` namespace of a programming language that takes two sets `s` and `t` as input and returns an embedding function `f` that maps elements from set `s` to set `t`. The embedding function `f` should preserve the injective property, meaning that distinct elements in se...
glaive
[ 0.051187146455049515, 0.03531992807984352, -0.02084844559431076, -0.017560526728630066, 0.06018770858645439, -0.03656527027487755, -0.008903306908905506, 0.06632671505212784, 0.04436467960476875, -0.013493791222572327, 0.025895509868860245, 0.02853555418550968, 0.0009097260772250593, -0.00...
0.825843
0.8025
0.023343
I am trying to calculate information gain in the context of a game show, similar to "Deal or No Deal." In this game, a contestant selects a suitcase from a set of 24, one of which contains a $1 million prize. In each round, the contestant must choose a suitcase to eliminate, after which the host makes an offer based on...
glaive
[ 0.016448162496089935, 0.014561095274984837, -0.055329982191324234, -0.029548488557338715, 0.01872066967189312, -0.029190929606556892, -0.033450886607170105, 0.04600836709141731, 0.02315179444849491, -0.02368425950407982, 0.022603843361139297, 0.016282957047224045, -0.0376235768198967, -0.0...
0.780115
0.750812
0.029303
You are tasked with creating a function called `substrings` that takes a string as input and returns a list of all possible substrings of the input string. A substring is a contiguous sequence of characters within the string. The output list should include the empty string as well. For example, calling `substrings` wit...
glaive
[ 0.02599872462451458, 0.028468381613492966, -0.004191703628748655, -0.027431156486272812, 0.043187085539102554, -0.048894256353378296, -0.0040201907977461815, 0.03268105909228325, 0.03936220705509186, -0.007684221025556326, 0.026631461456418037, 0.03275388479232788, -0.029800670221447945, -...
0.804039
0.76421
0.039829
You are tasked with creating a function that calculates the average proportion of cells in a raster layer that meet a certain condition. The function should take three input parameters: x (the raster layer), y (the condition), and p (the threshold value). The function should then calculate the proportion of cells in th...
glaive
[ 0.006417069584131241, 0.026495419442653656, -0.04752059280872345, -0.036928318440914154, 0.03671097010374069, -0.019994616508483887, -0.01258966512978077, 0.07710903882980347, 0.029443440958857536, 0.024255333468317986, 0.0050398604944348335, 0.031282924115657806, -0.03952730819582939, 0.0...
0.777143
0.760309
0.016834
You have been tasked with implementing a CUDA program to perform one-dimensional and two-dimensional convolutions. The program should be able to handle both input and filter vectors/arrays, and produce the convolution vector/array as output. The one-dimensional convolution should take in the input vector size, filter v...
glaive
[ 0.0051174950785934925, 0.057993657886981964, -0.02002362348139286, -0.016919901594519615, 0.026116404682397842, 0.008248783648014069, -0.041544876992702484, 0.09318120032548904, 0.04886883124709129, -0.02266737073659897, 0.023664532229304314, 0.03314080461859703, 0.001685268129222095, -0.0...
0.797315
0.781134
0.016182
You are tasked with implementing a subroutine in Fortran called STERN, which generates the start of a reciprocal vector G. The subroutine takes in several input parameters and produces several output parameters. The inputs include: - G(3): an array representing a reciprocal vector - iz(3,3,iord): a 3x3 matrix for group...
glaive
[ 0.02022668533027172, 0.03026457317173481, -0.007839199155569077, -0.06043004244565964, 0.025991560891270638, -0.027264732867479324, -0.022293437272310257, 0.08957763016223907, 0.0416819304227829, 0.0006908458890393376, 0.026978936046361923, 0.041225604712963104, -0.031146349385380745, -0.0...
0.809232
0.784354
0.024878
You are tasked with implementing a function to calculate the payoff for an Exotic Option Linked to the performance of multiple underlying assets (ELS3). The function takes in three sets of option data, including initial stock price, volatility, risk-free rate, time step, and other parameters, as well as arrays for stoc...
glaive
[ 0.004129461478441954, 0.03112010285258293, -0.026237215846776962, -0.024726273491978645, 0.02439041994512081, -0.022160228341817856, -0.03704681992530823, 0.07008735090494156, 0.035066623240709305, -0.002864955458790064, 0.022835837677121162, 0.047396715730428696, -0.02512388862669468, -0....
0.813234
0.79167
0.021563
You are tasked with creating a Tetris game in Lua. One important aspect of the game is defining the shapes of the different Tetris pieces. Each piece is represented by a table with a color and an array of blocks, where each block is represented by a 4x4 grid with 1s and 0s. Your task is to create a Lua table with the p...
glaive
[ 0.012039082124829292, 0.0442817360162735, -0.0377553291618824, -0.04379768297076225, 0.04731909558176994, -0.021127501502633095, -0.02366108074784279, 0.04982428997755051, 0.027809107676148415, -0.02672320231795311, 0.03729618340730667, 0.02310282178223133, -0.04190178960561752, 0.00112641...
0.793768
0.772573
0.021195
You are tasked with creating a Python program to calculate the differences between certain values and then print the results. The values are represented by the variables u1, u2, u3, and u4. You need to calculate the differences according to the following formula: x = (u3 - u1) - (u2 - u1) y = (u3 - u1) - (u4 - u1) Fina...
glaive
[ -0.0036234459839761257, 0.044520072638988495, -0.04191611334681511, -0.029995469376444817, 0.06534601002931595, -0.03559065982699394, -0.029373327270150185, 0.06259049475193024, 0.07218334078788757, -0.012545273639261723, 0.03623579442501068, 0.046867672353982925, -0.0384223572909832, 0.00...
0.80402
0.779941
0.024079
You are tasked with creating a program that checks whether function composition is associative. Given three functions f, g, and h of type int->int, the program should determine if the following equation holds true for any given input x: (f o (g o h)) x = ((f o g) o h) x In other words, the program should verify if func...
glaive
[ 0.0484570637345314, 0.018075700849294662, -0.03709637001156807, -0.019218487665057182, 0.04660303145647049, -0.0337083600461483, 0.028172949329018593, 0.07332158833742142, 0.026481587439775467, 0.004928722511976957, 0.018699197098612785, 0.019090402871370316, -0.006421184167265892, -0.0299...
0.804693
0.7834
0.021293
You are tasked with implementing a ray tracing algorithm using OptiX SDK. The program should trace primary rays and handle exceptions. The algorithm should involve casting rays from the camera position, with the direction determined by the camera's orientation and jittered samples. The final result should be accumulate...
glaive
[ 0.016613850370049477, 0.044383496046066284, -0.022544661536812782, -0.01288584340363741, 0.0273430272936821, -0.01223473809659481, -0.0316942073404789, 0.09454286843538284, 0.05145813897252083, -0.011500376276671886, 0.025758810341358185, 0.019855642691254616, -0.009985393844544888, -0.010...
0.787862
0.773029
0.014834
How can I use JavaScript to find the minimum and maximum numbers in an array of numbers?
glaive
[ 0.01437471155077219, 0.021822407841682434, -0.02670343406498432, -0.023916572332382202, 0.04301099851727486, -0.021719535812735558, -0.019900521263480186, 0.028491703793406487, 0.020848259329795837, -0.028949197381734848, 0.020862461999058723, 0.030965959653258324, -0.04967952147126198, -0...
0.793316
0.776138
0.017178
You are tasked with creating a program that implements a Num class with various mathematical operations. The Num class should have the following functionalities: 1. Addition of two Num objects 2. Finding the mean fold default value 3. Negating a Num object 4. Dividing a Num object by a scalar value 5. Multiplying two N...
glaive
[ 0.02580791525542736, 0.02255188673734665, -0.02045048400759697, -0.02992926724255085, 0.038495440036058426, -0.00985473208129406, -0.029595782980322838, 0.056268006563186646, 0.04621829092502594, -0.012374567799270153, 0.02237832173705101, 0.03730662167072296, -0.038874492049217224, -0.021...
0.799793
0.768189
0.031604
You are tasked with implementing a CUDA kernel function for voxelizing 3D meshes. The problem involves writing four CUDA kernel functions to perform different operations on the voxel grid. The first kernel function, voxelize_sub1_kernel, takes as input a tensor of 3D mesh faces and a tensor representing the voxel grid...
glaive
[ 0.013794703409075737, 0.05189590901136398, -0.0006519992020912468, -0.026362432166934013, 0.03323154151439667, 0.0012908732751384377, -0.025228550657629967, 0.08449482917785645, 0.03113502636551857, -0.003012714209035039, 0.03680422157049179, 0.03737883269786835, 0.0018489487702026963, -0....
0.794679
0.776775
0.017904
You are tasked with creating a module in Elixir that includes a function to calculate the factorial of a given number. The function should take an integer as input and return the factorial of that number. The factorial of a non-negative integer n is the product of all positive integers less than or equal to n. Create ...
glaive
[ 0.0382608138024807, 0.03372718393802643, -0.01866183802485466, -0.03846411779522896, 0.03784644976258278, -0.046589843928813934, -0.025397831574082375, 0.03480127453804016, 0.04229428991675377, -0.022618576884269714, 0.016668815165758133, 0.04916983097791672, -0.03235353156924248, -0.01739...
0.806439
0.788838
0.017601
You are tasked with creating a Java program that calculates the factorial of a given number. The factorial of a non-negative integer n is the product of all positive integers less than or equal to n. For example, the factorial of 5 (denoted as 5!) is 5 x 4 x 3 x 2 x 1 = 120. Your program should take a non-negative inte...
glaive
[ 0.01690402254462242, 0.016855111345648766, -0.03852766752243042, -0.025598278269171715, 0.048906899988651276, -0.03440990298986435, -0.016429534181952477, 0.03818424791097641, 0.04299629479646683, -0.028582246974110603, 0.014571547508239746, 0.04089485853910446, -0.05911170691251755, -0.02...
0.801806
0.760826
0.04098
You are tasked with implementing a class in a programming language that supports object-oriented programming. The class, called "ArrayLiteralNode", should represent an array literal node in an abstract syntax tree (AST) for a compiler. This class should have the following functionalities: - A method "comparing" that co...
glaive
[ 0.015080086886882782, 0.037372566759586334, -0.009867669083178043, -0.021926552057266235, 0.03690279275178909, -0.05496110022068024, 0.000011637102943495847, 0.0755419209599495, 0.043477099388837814, -0.015940824523568153, 0.03787906467914581, 0.016675306484103203, -0.042840585112571716, 0...
0.808914
0.794281
0.014633
You are tasked with implementing a set of functions for working with a zipper data structure in Clojure. The zipper data structure is a way to efficiently and flexibly navigate and modify nested data structures. Your task is to implement the following functions for the zipper data structure: 1. stay - a function that t...
glaive
[ 0.021503949537873268, 0.03365897387266159, -0.012245484627783298, -0.027727210894227028, 0.04627631604671478, -0.012961084954440594, -0.003880574367940426, 0.03601518273353577, 0.026511723175644875, -0.009982215240597725, 0.03274181857705116, 0.024264855310320854, -0.02669820748269558, -0....
0.810128
0.792532
0.017597
You are tasked with creating a function in Mathematica that performs dictionary minimization of data y. The function should take two parameters: vals and y. The vals parameter is a list of lists with the structure {{T1muscle, T1fat, T2fat}, {Necho, echoSpace, angle}}, and the y parameter is the data to be minimized. Th...
glaive
[ 0.017956046387553215, 0.011805322021245956, -0.0430026613175869, -0.0500732846558094, 0.07277815788984299, -0.023716485127806664, 0.0002170579246012494, 0.061669331043958664, 0.05700394883751869, -0.00676623685285449, 0.0008622983586974442, 0.04702535271644592, -0.02852427400648594, 0.0034...
0.797255
0.778621
0.018634
You are tasked with implementing a CUDA kernel function that performs element-wise addition of two arrays and stores the result in a third array. The function should take in the size of the arrays `n`, as well as pointers to the arrays `a`, `b`, and `c`. The function should be able to handle large arrays efficiently by...
glaive
[ 0.0007406205404549837, 0.05771426111459732, -0.016824528574943542, -0.024889640510082245, 0.032236162573099136, 0.0024225811939686537, -0.021844753995537758, 0.0965680405497551, 0.04349476471543312, -0.006941932253539562, 0.020951543003320694, 0.042478565126657486, -0.008203740231692791, -...
0.800301
0.77327
0.027031
You are tasked with implementing a Fortran subroutine that performs the rank 1 operation `A := alpha*x*y**T + A`, where `alpha` is a scalar, `x` is an m-element vector, `y` is an n-element vector, and `A` is an m by n matrix. Your subroutine should have the following signature: ```fortran SUBROUTINE CGERU(M,N,ALPHA,X,...
glaive
[ 0.022153303027153015, 0.04037439823150635, -0.016706056892871857, -0.04636106640100479, 0.03182326629757881, -0.018927812576293945, -0.00767583167180419, 0.06993136554956436, 0.04414043575525284, -0.01493810210376978, 0.013942875899374485, 0.04058423265814781, -0.03062581643462181, -0.0119...
0.814089
0.785376
0.028713
You are tasked with writing a program to calculate the number of Weyl group elements that do not contain an s_r factor, and contribute nonzero terms to Kostant's weight multiplicity formula when computing the multiplicity of the zero-weight in the adjoint representation for the Lie algebra of type B and rank n. Write ...
glaive
[ 0.011953218840062618, 0.022251781076192856, -0.02978193759918213, -0.04406626895070076, 0.032400038093328476, -0.02120850421488285, -0.024585217237472534, 0.060847822576761246, 0.03607165440917015, -0.010022586211562157, 0.012606616131961346, 0.0362958200275898, -0.02821495570242405, -0.03...
0.814117
0.789242
0.024875
You are tasked with creating a program that deals with numerical representation and operations in computer arithmetic. Your program should include functionalities for representing integers and real numbers, performing operations on floating-point numbers, handling numerical algorithms, and addressing the numerical stab...
glaive
[ 0.03856697678565979, 0.020522786304354668, -0.03289567679166794, -0.027667522430419922, 0.057554617524147034, -0.008716654032468796, -0.01425554696470499, 0.05460062250494957, 0.041654009371995926, -0.016675211489200592, 0.029217423871159554, 0.028765829280018806, -0.02152557112276554, -0....
0.788502
0.763938
0.024563
You are tasked with analyzing a dataset containing five columns: X, Y, TStamp, Pres., and EndPts. The dataset has a DataSize of 399. Your goal is to perform a specific data analysis task on this dataset using the given information.
glaive
[ 0.0019951900467276573, -0.003982361871749163, -0.06192130967974663, -0.05225968360900879, 0.031889449805021286, -0.04058968648314476, -0.01166711375117302, 0.06348055601119995, 0.0515139102935791, 0.011455422267317772, 0.04358280450105667, 0.023615065962076187, -0.02181774005293846, 0.0086...
0.78606
0.770761
0.0153
You are tasked with implementing a binary operation for a custom programming language. The operation can be a logical, arithmetic, or comparison function and is represented by the `baseOp` struct. The `NodeParams` struct describes the types of nodes used for binary operations, including whether the left and right nodes...
glaive
[ 0.016640396788716316, 0.00948608759790659, -0.03320989012718201, -0.0007314821123145521, 0.03485843166708946, -0.021445492282509804, -0.005636650137603283, 0.09402542561292648, 0.060632169246673584, -0.005946515593677759, 0.01644871197640896, 0.025113236159086227, -0.00497900927439332, -0....
0.813188
0.798468
0.01472
You have been tasked with implementing a GPU scan based on the BPLG library LF. The goal is to develop a CUDA kernel for parallel prefix sum (scan) computation. The kernel should be able to perform an inclusive scan on an array of float4 elements. The size of the array is denoted by N, and the scan should be performed ...
glaive
[ -0.009029652923345566, 0.05111081525683403, -0.032520972192287445, -0.04462949186563492, 0.03475884348154068, -0.01372973807156086, -0.023221084848046303, 0.054531536996364594, 0.03810519725084305, -0.007225182373076677, 0.021989375352859497, 0.033700376749038696, -0.010496777482330799, 0....
0.800001
0.783675
0.016326
You are tasked with creating a program that maximizes a given function and then plots the results in a 3D graph and a contour plot. The function to be maximized is defined as a complex expression involving sine and cosine terms. The program should iterate through a range of values for β and γ, calculate the maximum val...
glaive
[ 0.020553680136799812, 0.031752754002809525, -0.059116289019584656, -0.03239355981349945, 0.034073855727910995, -0.01772361248731613, -0.03137689456343651, 0.06425248831510544, 0.03825093060731888, 0.003947553690522909, 0.03198821470141411, 0.04842676222324371, -0.03530002012848854, -0.0046...
0.796883
0.770825
0.026058
You are tasked with creating a program that calculates the probability of a quantum state using the given amplitude functions. The program should then find the maximum probability within certain parameter constraints and plot the probability density function in 3D and as a contour plot. Create a program that: 1. Defin...
glaive
[ 0.0035803569480776787, 0.037474941462278366, -0.03451574966311455, -0.027192551642656326, 0.0377519428730011, -0.032154932618141174, -0.0186102706938982, 0.06762169301509857, 0.035571109503507614, 0.012720128521323204, 0.0288749560713768, 0.03118174709379673, -0.018601682037115097, -0.0105...
0.792729
0.766531
0.026198
I have the following function in C: ``` uint myFunction (uint arrayLen, uint* array) { uint i; uint j; uint sum = 0; for (i = 0; i < arrayLen/2; i++) for (j = 0; j < arrayLen; j++) if (array[i*2] == array[j]) sum += mySumFunction(arrayLen, array, 6); mySortFunc...
glaive
[ 0.024125732481479645, 0.04062718152999878, -0.02615341730415821, -0.01998242363333702, 0.03819410130381584, -0.03591058775782585, -0.04389224201440811, 0.08887600898742676, 0.031882964074611664, 0.006610610987991095, 0.0269146878272295, 0.010476975701749325, -0.02763407491147518, -0.029124...
0.816797
0.798885
0.017912
You need to create a function that takes a string representing an integer in Chinese characters and returns the corresponding integer value. The input string can represent integers from 0 to 9999. For example, the input "一千二百三十四" should return 1234, and the input "五千八" should return 5008.
glaive
[ 0.020871667191386223, 0.029158737510442734, -0.02363169565796852, -0.039115529507398605, 0.030463306233286858, -0.028769860044121742, -0.01790088787674904, 0.05818217247724533, 0.03863875940442085, -0.004289740230888128, 0.024746058508753777, 0.033644676208496094, -0.023196440190076828, -0...
0.791434
0.746571
0.044864
You are tasked with simulating two-generation families using a specific programming language. The simulation involves generating family data for each family member, including genotype, sex, age, and other relevant variables. The simulation process includes generating sibship size, sex and age for each family member, an...
glaive
[ 0.001438905717805028, 0.014398966915905476, -0.032423995435237885, -0.03240813687443733, 0.026010578498244286, -0.03159749507904053, -0.007523763459175825, 0.08529128134250641, 0.030374085530638695, -0.031051328405737877, 0.024865588173270226, 0.03560532256960869, -0.01652664504945278, 0.0...
0.80353
0.787564
0.015965
You need to create a subroutine in FORTRAN called ZLAQGE that will equilibrate a general M by N matrix A using the row and column scaling factors in the vectors R and C. The equilibrated matrix will be stored back in A, and the form of the equilibrated matrix will be specified by the EQUED parameter. The subroutine sh...
glaive
[ 0.04092630743980408, 0.02249845303595066, -0.0251298975199461, -0.0477600172162056, 0.04741062596440315, -0.028461569920182228, -0.008217803202569485, 0.061923813074827194, 0.03137802332639694, -0.028225518763065338, 0.02479463629424572, 0.042144060134887695, -0.045674532651901245, -0.0058...
0.805127
0.778043
0.027085
You are tasked with implementing a down counter in VHDL using the given entity and architecture framework. The counter should have the following inputs and outputs: - clk_i: input clock signal - srst_n_i: asynchronous active low reset signal - en_i: enable signal to control the counter operation - load_data: input sign...
glaive
[ 0.012748618610203266, 0.02615232951939106, -0.018674485385417938, -0.03764327988028526, 0.028647972270846367, -0.01889670453965664, -0.017838843166828156, 0.09308517724275589, 0.0452907532453537, -0.016906453296542168, 0.019438637420535088, 0.04327945038676262, -0.014155158773064613, -0.00...
0.79717
0.781696
0.015474
You are tasked with writing a SQL query to perform a partial merge join and calculate the count and unique values of the resulting dataset. The dataset consists of two tables: one containing numbers from 1 to 100000 and another containing a single row with the value 1. Write a SQL query to perform a partial merge join...
glaive
[ 0.025219306349754333, 0.029632272198796272, -0.0363042950630188, -0.018684985116124153, 0.017832718789577484, -0.001318776630796492, -0.01662493869662285, 0.049665044993162155, 0.060678012669086456, 0.008816022425889969, 0.024266717955470085, 0.03589947894215584, -0.010963162407279015, -0....
0.778131
0.759448
0.018683
You are tasked with creating a Stan model to calculate the probability mass function of a Poisson distribution. The Poisson probability mass function is defined as: \[ P(x|n) = \frac{e^{-n} \cdot n^x}{x!} \] Where \( n \) is the mean of the distribution and \( x \) is the value at which to evaluate the probability ma...
glaive
[ 0.03790082409977913, 0.019037066027522087, -0.03301823139190674, -0.05737895146012306, 0.041153937578201294, -0.03174901008605957, -0.027317874133586884, 0.044903017580509186, 0.02956039272248745, 0.00010917383769992739, 0.007327019702643156, 0.04205731302499771, -0.024202054366469383, -0....
0.798492
0.775233
0.023259
You are tasked with implementing a function that calculates the natural logarithm of a complex number. The function should take a complex number as input and return a new complex number representing the natural logarithm of the input. The input complex number, z, has a real part (z.re) and an imaginary part (z.im). To...
glaive
[ 0.018108868971467018, 0.04836723953485489, -0.030493222177028656, -0.04276354983448982, 0.03176556155085564, -0.01905634254217148, -0.012454717420041561, 0.04262978211045265, 0.040597252547740936, -0.016577700152993202, 0.026571540161967278, 0.02373385988175869, -0.04284865781664848, -0.00...
0.800947
0.779449
0.021498
You are tasked with implementing a function to add two arrays of integers and store the result in a third array. The arrays 'a' and 'b' are filled with integer values and have a length of N. You need to create a function add(a, b, c) that takes in the arrays 'a' and 'b', and stores the sum of corresponding elements in ...
glaive
[ 0.024155210703611374, 0.03207780048251152, -0.030021177604794502, -0.02281957119703293, 0.05407460033893585, -0.009060991927981377, -0.022561505436897278, 0.047087978571653366, 0.03145222365856171, -0.009638375602662563, 0.009942109696567059, 0.037093635648489, -0.04594803974032402, -0.032...
0.806579
0.771175
0.035404
You are given the task of defining a datatype and related functions to represent and manipulate even and odd numbers. Specifically, you need to define the datatypes `even` and `odd` to represent even and odd numbers, and then implement the function `e+e≡e` to demonstrate that the sum of two even numbers is even.
glaive
[ 0.02112533338367939, 0.007652945816516876, -0.039724547415971756, -0.05311020091176033, 0.044213853776454926, -0.03323979675769806, -0.006733800284564495, 0.06623803079128265, 0.04477105289697647, -0.02575523965060711, 0.02142188884317875, 0.04640880972146988, -0.028946224600076675, -0.024...
0.805706
0.78846
0.017246
You are tasked with implementing a CUDA kernel function for computing the dot product of two arrays. The function should take two input arrays `x` and `y`, and a context object `context` containing memory pointers and other necessary information. The output should be stored in the `PartResults` array within the context...
glaive
[ 0.0035466488916426897, 0.05113140866160393, -0.03251143917441368, -0.016426818445324898, 0.03400174155831337, 0.006433459464460611, -0.03958735242486, 0.0926622673869133, 0.05228651314973831, -0.009641280397772789, 0.026730893179774284, 0.048194389790296555, 0.00627253670245409, -0.0023945...
0.802121
0.784101
0.01802
You have been tasked with implementing a program that processes a series of integer inputs and performs specific operations based on the input values. The input consists of a series of lines, each containing a sequence of integers separated by spaces. The program should process the input and produce the desired output ...
glaive
[ 0.0460972897708416, 0.011603049002587795, -0.022957593202590942, -0.012802091427147388, 0.03386640176177025, -0.023061441257596016, -0.014109673909842968, 0.06889185309410095, 0.05092304199934006, -0.016444498673081398, 0.021589921787381172, 0.036254528909921646, -0.020202551037073135, -0....
0.832587
0.78918
0.043407
You are tasked with implementing a matrix multiplication using Shared Memory and CUDA Unified Memory, specifically for Compute Capability 5.X. You are given a code snippet that includes the necessary boilerplate and the matrices A, B, and C, along with their dimensions. The goal is to write the kernel function for matr...
glaive
[ 0.018873538821935654, 0.0463561974465847, -0.012022660113871098, -0.031701620668172836, 0.041643355041742325, -0.0024701531510800123, -0.03525374084711075, 0.0857277661561966, 0.03882824629545212, -0.020157882943749428, 0.012543088756501675, 0.01958112046122551, -0.009749730117619038, -0.0...
0.793814
0.777581
0.016233
You are tasked with implementing a nowcasting algorithm to estimate the instantaneous reproduction number (R) and the nowcasted cases for a given dataset. The dataset is stored in an Excel file located at "../data/raw/nowcasting-data.xlsx" and contains the following columns: "Datum des Erkrankungsbeginns" for the date ...
glaive
[ 0.0005784703535027802, 0.025739626958966255, -0.018218234181404114, -0.035059262067079544, 0.034139618277549744, 0.0028029074892401695, -0.02207043394446373, 0.1035468652844429, 0.057457488030195236, -0.020129522308707237, 0.026580870151519775, 0.040806226432323456, -0.021011024713516235, ...
0.812413
0.796122
0.016291
You are tasked with implementing a queue data structure in SystemVerilog with the following functionalities: - Pushing elements to the back of the queue - Popping elements from the front of the queue by assignment You should write the code for the following functionalities: 1. Define a queue `q` of integers. 2. Push t...
glaive
[ 0.03608613833785057, 0.018599646165966988, -0.02474399469792843, -0.03440843150019646, 0.02292420156300068, -0.019653500989079475, -0.03191841393709183, 0.07998381555080414, 0.03256122022867203, -0.001802563900128007, 0.03615575656294823, 0.046840887516736984, -0.014645662158727646, 0.0045...
0.804077
0.777568
0.026509
You are required to implement a function `mulByDigit` that takes an integer `i` and a list `l` as input and returns a new list where each element of the input list is multiplied by the input integer. The function should be defined as `let rec mulByDigit i l = ...` and should be implemented using recursion.
glaive
[ 0.011758174747228622, 0.027349503710865974, -0.009063717909157276, -0.052813202142715454, 0.04450108855962753, -0.026576535776257515, -0.019220707938075066, 0.046743977814912796, 0.036837972700595856, -0.009032933972775936, 0.02038995549082756, 0.04045814275741577, -0.029469413682818413, -...
0.825814
0.806252
0.019563
Can you provide a solution to classify text as either spam or ham?
glaive
[ 0.004358773585408926, 0.01178606878966093, 0.018260767683386803, -0.06377846002578735, 0.028125068172812462, -0.037352245301008224, 0.009258902631700039, 0.03673381730914116, 0.017828118056058884, -0.022962767630815506, 0.016248617321252823, 0.04363778606057167, -0.029200831428170204, -0.0...
0.74727
0.732618
0.014652
You are required to implement a subroutine for a type 3 nonuniform FFT (Fast Fourier Transform) as described in the subroutine nufft1d3f90_ffte. The subroutine takes in the following input parameters: - nj: number of sources - xj: location of sources (double array) - cj: strengths of sources (double complex array) - if...
glaive
[ 0.0025206219870597124, 0.035295333713293076, -0.03663218021392822, -0.03420117869973183, 0.034323662519454956, -0.011075451038777828, -0.01023929938673973, 0.0666315108537674, 0.0323997437953949, 0.010793684050440788, 0.050913967192173004, 0.037376243621110916, -0.05083629861474037, -0.004...
0.799393
0.775749
0.023644
How can I find the maximum value in an array using an executable C program?
glaive
[ 0.01639840379357338, 0.034418735653162, -0.03237947076559067, -0.022196028381586075, 0.027535337954759598, -0.04689029976725578, -0.03196151554584503, 0.06243367865681648, 0.03340559080243111, -0.0469687357544899, 0.02077445387840271, 0.044079866260290146, -0.04871465638279915, -0.00986827...
0.786382
0.770051
0.016331
You are tasked with creating a REBOL program that calculates and prints the first 28 numbers in the Fibonacci sequence. The Fibonacci sequence is a series of numbers in which each number is the sum of the two preceding ones, usually starting with 0 and 1. You need to define a function `fib` that takes an integer `x` a...
glaive
[ 0.008165680803358555, 0.03374764323234558, -0.020480554550886154, -0.039107128977775574, 0.045380767434835434, -0.017091022804379463, -0.02011573128402233, 0.06495637446641922, 0.030054330825805664, -0.014124580658972263, 0.030872488394379616, 0.0380907878279686, -0.04646438732743263, -0.0...
0.816087
0.783884
0.032203
You are tasked with creating a Groovy class called "CurlyCountingGroovyLexer" that can tokenize a given input string, splitting it into individual tokens while keeping track of the curly braces count. The class should have a method called "toList" that returns a list of tokens and an attribute called "parenLevel" that ...
glaive
[ 0.009515764191746712, 0.02472119778394699, -0.004020540975034237, -0.04247521236538887, 0.02519293501973152, -0.021978843957185745, -0.010937405750155449, 0.05973738059401512, 0.034188807010650635, -0.035112518817186356, 0.007965901866555214, 0.03311682492494583, -0.02145734801888466, -0.0...
0.810325
0.792453
0.017872
You are tasked with creating a program that calculates the maximum value of a complex function over a specified range of input variables. The function is defined as follows: \[f(x, y) = \text{Exp}[-15i y] (1 (i \sin[x])^7 \cos[x]^8 + 1 (i \sin[x])^8 \cos[x]^7) + \text{Exp}[-11i y] (38 (i \sin[x])^6 \cos[x]^9 + 38 (i \s...
glaive
[ 0.039876539260149, 0.04034794494509697, -0.035415660589933395, -0.04397708922624588, 0.0337706096470356, -0.01256652269512415, -0.0286487378180027, 0.05413493514060974, 0.041874803602695465, -0.00869289506226778, 0.03688370808959007, 0.04338274896144867, -0.039670221507549286, -0.007183997...
0.814642
0.7705
0.044142
You are tasked with creating a program that deals with complex numbers. A complex number is a number that can be expressed in the form a + bi, where a and b are real numbers, and i is the imaginary unit. Your task is to write a Scala program that defines a class ComplexNumber with the following functionalities: - A met...
glaive
[ 0.024341441690921783, 0.044313088059425354, -0.013914001174271107, -0.038482390344142914, 0.04442060366272926, -0.03417493402957916, 0.0035661158617585897, 0.031653761863708496, 0.0292507354170084, -0.01452610269188881, 0.04021881893277168, 0.05490351468324661, -0.03310859203338623, -0.007...
0.796419
0.771814
0.024605
You are tasked with writing a function to generate all combinations of well-formed parentheses given a number n. A well-formed parentheses string is one where for every open parenthesis there is a corresponding closing parenthesis and the parentheses are properly nested. Write a function called generate_parenthesis tha...
glaive
[ 0.04705910012125969, 0.029894227162003517, -0.016787365078926086, -0.04361935704946518, 0.02446785382926464, -0.026546798646450043, -0.004248825833201408, 0.0446103997528553, 0.049650613218545914, -0.020754050463438034, 0.021245067939162254, 0.04304799810051918, -0.03548351302742958, -0.01...
0.805487
0.775452
0.030035
What is the most efficient algorithm to solve a problem where I need to find the minimum difference between two parts of an array?
glaive
[ 0.011143529787659645, 0.01723487675189972, -0.032164037227630615, -0.03241945803165436, 0.02985689975321293, -0.028162384405732155, -0.04253874719142914, 0.04587310552597046, 0.045145370066165924, -0.03191268444061279, 0.02954346314072609, 0.016172003000974655, -0.018588103353977203, -0.00...
0.80702
0.771413
0.035607
You are tasked with creating a function that determines the winner of a game board. The game is played on a square board represented as a 2D array of characters (either "X", "O", or empty). The function should return the player ("X" or "O") who has a winning configuration. A winning configuration is defined as having a...
glaive
[ 0.01511866319924593, 0.03762126713991165, -0.04292812570929527, -0.04048722982406616, 0.01927882432937622, -0.02755577303469181, -0.03969200700521469, 0.061156656593084335, 0.03730912134051323, -0.013197195716202259, 0.0137978196144104, 0.04432439059019089, -0.027112718671560287, -0.007177...
0.815241
0.766582
0.048659
You are tasked with implementing a predicate in Prolog that takes two lists as input and modifies the second list based on specific conditions. The predicate should be named `y/2` and should behave as follows: - If the first element of the first list is of the form `q(X,Y)` and `Y` is greater than 0, the second list sh...
glaive
[ 0.009807022288441658, 0.03696504980325699, -0.02187526226043701, -0.0364781878888607, 0.045511312782764435, -0.0205350574105978, -0.017544878646731377, 0.07404837757349014, 0.04856023192405701, -0.022444361820816994, 0.01693958416581154, 0.03795526549220085, -0.028019055724143982, 0.012774...
0.812978
0.785649
0.02733
You are tasked with implementing a demultiplexor in VHDL. The demultiplexor has 4 outputs (s0, s1, s2, s3) and takes in 4-bit input (entrada), a 2-bit selection signal (sel), and an enable signal. When the enable signal is low, all outputs should be "1111". When the selection signal is "00", the input should be directe...
glaive
[ 0.023525815457105637, 0.01858273334801197, -0.03568040579557419, -0.035604849457740784, 0.044777076691389084, -0.037499554455280304, -0.0327250212430954, 0.08316032588481903, 0.047045547515153885, -0.004216291476041079, 0.024380341172218323, 0.02858266606926918, -0.00796717219054699, -0.01...
0.799669
0.776255
0.023415
You are tasked with creating a Windows Form application for a deathmatch game. The game will consist of two teams, each with four players. The players will be represented by images (nave1, nave2, invasor1, invasor2) on the form. Each team will have a label displaying their score, and a timer to keep track of the game d...
glaive
[ 0.024047499522566795, 0.021588295698165894, -0.03907736390829086, -0.04531317204236984, 0.030448833480477333, -0.02406284585595131, -0.004157078452408314, 0.08403212577104568, 0.05514813959598541, -0.025303633883595467, 0.04729068651795387, 0.02640317752957344, -0.01773887872695923, -0.012...
0.774067
0.758704
0.015363
How can I create a Java program that can find the maximum and minimum values among a collection of integers?
glaive
[ 0.015763498842716217, 0.003550696186721325, -0.039067741483449936, -0.0189236868172884, 0.033436037600040436, -0.03172534331679344, -0.01841782219707966, 0.02765294350683689, 0.03245365992188454, -0.05071379244327545, 0.031040973961353302, 0.04791424050927162, -0.04241521283984184, -0.0213...
0.795761
0.77614
0.019621
You are tasked with implementing a `spectrum` function for a star Banach algebra. The spectrum of an element `a` in a star Banach algebra over a ring `R` is defined as the set of all elements in `R` for which the resolvent `x • 1 - a` is not invertible. You need to write a function `spectrum` that takes an element `a` ...
glaive
[ 0.04268438741564751, 0.03589832782745361, -0.03594174608588219, -0.03282122313976288, 0.024691633880138397, -0.0366273857653141, -0.004065236076712608, 0.07714864611625671, 0.046817436814308167, 0.0038256505504250526, 0.02164389379322529, 0.052835263311862946, -0.03149982914328575, -0.0145...
0.804931
0.786323
0.018608
You are tasked with creating a program to model the distribution of observed values over a number of years. The program should take into account the number of events observed each year, as well as the actual observed values. The program should also be able to generate posterior data for a specified number of years. The...
glaive
[ -0.007240248378366232, -0.002739863470196724, -0.030734069645404816, -0.04490741714835167, 0.0388791449368, -0.043592989444732666, -0.04288974776864052, 0.07600676268339157, 0.02871186099946499, -0.018332717940211296, 0.022644298151135445, 0.049198757857084274, -0.031749214977025986, 0.027...
0.802839
0.787325
0.015514