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 writing a program that generates a sequence of numbers that are congruent to {0, 2, 5, 7} mod 8. The program should take an input 'n' and return the first 'n' numbers in the sequence. The sequence should start from 0 and increment by 1 for each subsequent number.
glaive
[ 0.034162379801273346, 0.04213623329997063, -0.015012918040156364, -0.04011215642094612, 0.03471260145306587, -0.01190687995404005, -0.03128733113408089, 0.04914356395602226, 0.03312528878450394, -0.0352025106549263, 0.009119135327637196, 0.01399538479745388, -0.04791617393493652, -0.006179...
0.823914
0.775674
0.04824
You are tasked with creating a program that implements a distributed scan algorithm. The input for the program will be a list of integers, and the output should be the prefix sum of the input list. The distributed scan algorithm involves dividing the input list into segments and then performing the prefix sum calculati...
glaive
[ 0.034029025584459305, 0.03387419506907463, -0.024123912677168846, -0.03325666859745979, 0.03835683688521385, -0.014763119630515575, -0.012249679304659367, 0.07454582303762436, 0.04136871173977852, -0.007973872125148773, 0.026687193661928177, 0.036836013197898865, -0.03558740019798279, -0.0...
0.819481
0.781209
0.038272
You are tasked with implementing a 2D convolution using FFT transformations in CUDA. The goal is to efficiently implement 2D convolutions with very large kernel sizes. You need to create a CUDA program that pads kernels, calculates the FFT size, transforms the convolution kernel, runs the GPU FFT convolution, and compa...
glaive
[ 0.003454921068623662, 0.05463210865855217, -0.0262087881565094, -0.023590926080942154, 0.02923436462879181, -0.007264829706400633, -0.02313314937055111, 0.09007925540208817, 0.04251113906502724, -0.015871571376919746, 0.030862145125865936, 0.0266882237046957, -0.009633640758693218, 0.00783...
0.798404
0.779117
0.019287
You are tasked with creating a function that takes in an array of numbers and returns the sum of all the numbers in the array. The function should be named "calculateSum" and should take in one parameter, an array of numbers. If the array is empty, the function should return 0.
glaive
[ 0.02167966216802597, 0.03836381807923317, -0.041142113506793976, -0.042769819498062134, 0.0652427226305008, -0.023957880213856697, -0.019928954541683197, 0.04144175723195076, 0.028076281771063805, -0.006929799448698759, 0.017295315861701965, 0.032440200448036194, -0.03862921893596649, -0.0...
0.796397
0.755218
0.041179
You are tasked with implementing a class called LightArray in C++ using CUDA. The LightArray class is designed to represent a lightweight array with the following functionalities: - Constructor: Initialize the capacity and storage of the array. - Destructor: Clean up the memory allocated for the array. - Accessor meth...
glaive
[ 0.011699081398546696, 0.04753616452217102, -0.011033553630113602, -0.021932799369096756, 0.025934360921382904, -0.030788369476795197, -0.03900517150759697, 0.11792609095573425, 0.05903111398220062, -0.026646757498383522, 0.03105498105287552, 0.04034176096320152, -0.0020301828626543283, 0.0...
0.788715
0.770313
0.018401
You are tasked with creating a simple duck-hunting game using Pascal programming language. The game should include a duck that moves across the screen and the player should be able to shoot the duck using a gun. The duck should be drawn using lines and pixels, and the player should be able to aim and shoot using joysti...
glaive
[ -0.02435670793056488, 0.022803079336881638, -0.009127970784902573, -0.03440586104989052, 0.022943126037716866, -0.010121764615178108, 0.002835520775988698, 0.06220973655581474, 0.049464888870716095, -0.029976559802889824, 0.02379423752427101, 0.05823344737291336, -0.015231024473905563, -0....
0.781986
0.767679
0.014307
You are tasked with implementing a Fortran subroutine that overwrites a general complex M-by-N matrix C with the product of Q and C, where Q is a complex unitary matrix. The specific details and arguments for the subroutine are as follows: Arguments: - SIDE (input): Character*1, specifies whether to apply Q from the L...
glaive
[ 0.029502950608730316, 0.043203357607126236, -0.01636943221092224, -0.032221198081970215, 0.03790682926774025, -0.025684500113129616, -0.004268865566700697, 0.06615901738405228, 0.03719374164938927, -0.01602749712765217, 0.017440561205148697, 0.03910128399729729, -0.01777178794145584, -0.01...
0.806027
0.784528
0.021499
You are tasked with implementing a set of functions for calculating the similarity and distance between two sequences of elements. The functions should use the Levenshtein, DamerauLevenshtein, Jaro, and JaroWinkler algorithms for the calculations. You need to implement the following functions: 1. `leven_distance`: Thi...
glaive
[ 0.019801614806056023, 0.03211070969700813, -0.012993737123906612, -0.02743138000369072, 0.040213193744421005, -0.028173940256237984, -0.01841265894472599, 0.07093758881092072, 0.04064922407269478, -0.011637735180556774, 0.022228511050343513, 0.025946037843823433, -0.023892797529697418, 0.0...
0.822665
0.785738
0.036927
You are tasked with writing a subroutine to calculate the photoelectron orbital using the local density approximation (LDA) in the Dirac equation. The subroutine will utilize various input parameters and complex arrays to perform the necessary calculations. The goal is to resolve the Dirac equation to obtain the initia...
glaive
[ -0.01182829961180687, 0.04610402509570122, -0.020657222718000412, -0.031148504465818405, 0.02767999842762947, -0.04407539963722229, -0.02739369310438633, 0.060273658484220505, 0.04450086131691933, 0.00748820323497057, 0.011823250912129879, 0.028036318719387054, -0.022426020354032516, 0.001...
0.781971
0.761271
0.020701
You are tasked with implementing an equivalence relation in Racket. An equivalence relation is a boolean-returning function of two arguments that returns true when two values are equivalent, according to some notion of equivalence. The details of what counts as equivalent vary based on the equivalence relation used, bu...
glaive
[ 0.03486502915620804, 0.011067063547670841, -0.022899312898516655, -0.019143231213092804, 0.03389915078878403, -0.00671441899612546, 0.00643907580524683, 0.07772371172904968, 0.04055332764983177, -0.02657456323504448, 0.013048466295003891, 0.04194628819823265, -0.009558723308146, 0.00267758...
0.797011
0.780071
0.01694
You are tasked with creating a Verilog module that implements a past assertion for a given set of formal verification tests. The module should include the following: - A parameter MAX_AMOUNT that defines the maximum value for a 16-bit counter - An input wire i_clk for the clock signal - An input wire i_start_signal fo...
glaive
[ 0.02049858681857586, 0.02585848793387413, -0.03563911095261574, -0.041246600449085236, 0.0342874750494957, -0.023055970668792725, -0.006838229950517416, 0.087204210460186, 0.017431626096367836, -0.01597728207707405, 0.025228438898921013, 0.034468621015548706, -0.0027081386651843786, -0.000...
0.805365
0.790943
0.014422
You are tasked with creating a program that checks whether a given sequence is partitioned based on a specific predicate. The sequence should be partitioned into two segments: one that satisfies the predicate and one that does not. You are required to implement the function is_partitioned_kernel that takes an execution...
glaive
[ 0.03187336400151253, 0.021251771599054337, -0.015529848635196686, 0.003032598877325654, 0.02021261490881443, -0.0037569734267890453, -0.0023011707235127687, 0.10175115615129471, 0.028007926419377327, -0.019979752600193024, 0.014161605387926102, 0.015192094258964062, -0.008502230979502201, ...
0.814481
0.79894
0.015541
You are tasked with optimizing a complex mathematical function represented by the following code snippet: function[x_, y_] := $Conjugate[Exp[-8 I y] (1 (I Sin[x])^3 Cos[x]^5 + 1 (I Sin[x])^5 Cos[x]^3) + Exp[-4 I y] (6 (I Sin[x])^2 Cos[x]^6 + 6 (I Sin[x])^6 Cos[x]^2 + 20 (I Sin[x])^4 Cos[x]^4 + 1 (I Sin[x])^1 Cos[x]^7 ...
glaive
[ 0.004725557751953602, 0.03546351194381714, -0.039639461785554886, -0.03302895650267601, 0.03143075481057167, -0.027226464822888374, -0.036866284906864166, 0.05535225570201874, 0.0622103326022625, 0.00993267446756363, 0.01991703175008297, 0.026657404378056526, -0.03758400306105614, -0.01202...
0.806795
0.775143
0.031652
You are required to implement a subroutine to calculate the Wigner 3j symbols. The subroutine should calculate the values for all allowable integer values of j within the limits of jmin and jmax. The formula to be used for the calculation is: Wigner 3j symbols: j j2 j3 m1 m2 m3 The returned values in t...
glaive
[ 0.0062256380915641785, 0.029422631487250328, -0.040387846529483795, -0.032840728759765625, 0.04596066102385521, -0.027419596910476685, -0.03757492080330849, 0.06679081171751022, 0.024634575471282005, 0.009978003799915314, 0.03153127059340477, 0.057877860963344574, -0.02879093959927559, -0....
0.810581
0.775811
0.03477
You are tasked with creating a 2D game using the Love2D framework. The game involves navigating a character through a dungeon, with the ability to move in all four directions, and shoot bullets in both horizontal and vertical directions. The dungeon consists of multiple rooms, each with doors on its four sides. The pla...
glaive
[ 0.015195627696812153, 0.020344063639640808, -0.015268823131918907, -0.023459505289793015, 0.035853005945682526, -0.005278951022773981, -0.030084650963544846, 0.06376157701015472, 0.035465579479932785, -0.02186940796673298, 0.03673560172319412, 0.03501962497830391, -0.013951950706541538, 0....
0.779735
0.764022
0.015713
How can I build a Java program that finds the number in an integer array with the highest frequency?
glaive
[ 0.011876131407916546, 0.027202734723687172, -0.046259600669145584, -0.020478811115026474, 0.025988243520259857, -0.030524279922246933, -0.027532827109098434, 0.03451473265886307, 0.012106682173907757, -0.04589971527457237, 0.028580758720636368, 0.032609835267066956, -0.038301020860672, -0....
0.80247
0.779987
0.022483
You are tasked with implementing a generic function that can apply various arithmetic operations on different types of numbers, including integers, rationals, reals, and complex numbers. The operations include addition, subtraction, multiplication, and division. The function should be able to handle coercion between di...
glaive
[ 0.05085672438144684, 0.037254493683576584, -0.021532073616981506, -0.03592703491449356, 0.04177188128232956, -0.032285504043102264, -0.013706780970096588, 0.05420150235295296, 0.04566703364253044, -0.02396622858941555, 0.017586760222911835, 0.0388016514480114, -0.01871076039969921, -0.0181...
0.796225
0.7776
0.018626
You are required to create a subroutine in the SALMON program that calculates and assigns the number of processes for parallel computing based on specific conditions. The subroutine should take the global number of processes as an input and calculate the optimal distribution of processes based on their prime factors. T...
glaive
[ 0.011654514819383621, 0.013841788284480572, -0.03797374665737152, -0.017468085512518883, 0.025211481377482414, -0.007264035753905773, -0.04814065620303154, 0.06554100662469864, 0.03701212257146835, -0.003128583775833249, 0.028999362140893936, 0.05269315838813782, -0.015169024467468262, 0.0...
0.822219
0.787989
0.03423
You need to implement a Prolog program that performs several operations on text. The program should include the following predicates: - format_to_chars/3: Execute the built-in procedure format/2 with form _Form_ and arguments _Args_ outputting the result to the string of character codes _Result_. - format_to_chars/4: E...
glaive
[ 0.03735452890396118, 0.023943616077303886, -0.016761481761932373, -0.04295170679688454, 0.0388755276799202, -0.05043970048427582, -0.031123898923397064, 0.06298554688692093, 0.05106349661946297, -0.009737301617860794, 0.018344229087233543, 0.05289575830101967, -0.014546385034918785, -0.004...
0.814755
0.794767
0.019988
You are tasked with implementing a CUDA kernel function that calculates the gradient for a given neural network model using the Noise-Contrastive Estimation (NCE) loss function. The NCE loss function is used in machine learning for training neural network models. Your task is to write a CUDA kernel function that comput...
glaive
[ -0.010981420055031776, 0.051670268177986145, -0.01908222772181034, -0.02078377828001976, 0.03666580095887184, -0.01063651591539383, -0.027732687070965767, 0.08781687170267105, 0.03163764998316765, -0.009899811819195747, 0.01750412955880165, 0.024387598037719727, -0.027287479490041733, 0.00...
0.800832
0.782728
0.018104
: You are tasked with implementing a function in Stan that performs diagonal post-multiplication of matrices. The function should take in a matrix and a vector or row vector, and return the result of post-multiplying the matrix by the diagonal matrix formed from the vector or row vector. Write a function `diag_post_mu...
glaive
[ 0.04332108423113823, 0.026209501549601555, -0.030253548175096512, -0.07210685312747955, 0.04704979807138443, -0.00904318131506443, -0.017588691785931587, 0.0836334303021431, 0.03019414283335209, -0.004008994437754154, 0.013170906342566013, 0.032385196536779404, -0.033683303743600845, -0.02...
0.807959
0.777317
0.030642
I need to implement a synchronous N-counter in Verilog. The counter should have the following inputs and outputs: Inputs: 1. clk: a clock signal 2. reset: a reset signal 3. modulus: a 32-bit logic vector defining the modulus of the counter 4. time_delay: a 32-bit logic vector defining the time delay Outputs: 1. cout: a...
glaive
[ 0.021376164630055428, 0.0340476855635643, -0.03443912789225578, -0.035544782876968384, 0.0139512550085783, -0.010826162993907928, -0.04175984859466553, 0.08509072661399841, 0.027101503685116768, -0.019524531438946724, 0.03600203990936279, 0.06141452491283417, -0.026265308260917664, -0.0034...
0.791446
0.773722
0.017724
You are tasked with creating a CUDA program that performs matrix multiplication. Your program should take two input matrices, perform the multiplication using CUDA, and then output the resulting matrix.
glaive
[ 0.01623644307255745, 0.039588551968336105, -0.026790520176291466, -0.021060790866613388, 0.030402299016714096, -0.004983162507414818, -0.03331981971859932, 0.09786538779735565, 0.04754914715886116, -0.03496190533041954, 0.009046824648976326, 0.027531372383236885, -0.007861065678298473, -0....
0.786491
0.7674
0.019092
You are tasked with implementing a function that prepares buffers by performing a series of operations on memory addresses. The function should perform the following steps: 1. Load 32 bytes of data from the memory address 'addresses_A_ht' offset by 0x1b88d and store it in 256-bit YMM register 'ymm4'. 2. Extract the sec...
glaive
[ 0.03450601547956467, 0.04036422446370125, -0.014891411177814007, -0.015331164002418518, 0.02376285381615162, -0.047722239047288895, -0.017877371981739998, 0.07384510338306427, 0.053445179015398026, -0.013553678058087826, 0.010214429348707199, 0.040660642087459564, -0.024932656437158585, -0...
0.792178
0.77591
0.016268
You are tasked with creating a program that utilizes object-oriented programming (OOP) to define and manipulate Cartesian coordinates. The program should consist of a class definition for a coordinate, with fields for x and y, as well as methods for computing the distance of the coordinate from the origin and for movin...
glaive
[ 0.016978135332465172, 0.030967548489570618, -0.03219474479556084, -0.01905599795281887, 0.019150597974658012, -0.03262105584144592, -0.0277616735547781, 0.045964669436216354, 0.056255754083395004, -0.023325446993112564, 0.02553635463118553, 0.039194609969854355, -0.024024857208132744, 0.00...
0.799135
0.780514
0.018621
You are tasked with implementing a set of GLSL template functions for basic arithmetic operations such as addition, subtraction, multiplication, and division. These functions should be able to handle any number of input arguments and generate the corresponding GLSL code. Additionally, you need to define compiler macros...
glaive
[ 0.04101769998669624, 0.030207673087716103, -0.0181622002273798, -0.054904479533433914, 0.04294465854763985, -0.03821561858057976, -0.030451614409685135, 0.06821583956480026, 0.04112211987376213, -0.019079644232988358, 0.031022509559988976, 0.03247353062033653, -0.005126681178808212, -0.000...
0.787959
0.770522
0.017437
You are required to implement a program that performs matrix multiplication using the MapReduce framework on graphics processors. The purpose of this program is to compute the relationship of two documents by multiplying two matrices M and N. Each Map will compute the multiplication for a row from M and a column from N...
glaive
[ 0.02510756067931652, 0.034797314554452896, -0.0104474276304245, -0.023299435153603554, 0.030477328225970268, -0.004883125890046358, -0.04177907109260559, 0.0817812830209732, 0.03590211644768715, -0.03802940994501114, 0.01188221201300621, 0.020638898015022278, -0.0011106138117611408, 0.0050...
0.805762
0.785152
0.020609
How can I design an algorithm in C to check if a given array contains any duplicate elements or not?
glaive
[ 0.0004938539350405335, 0.01976354420185089, -0.025532767176628113, -0.027939608320593834, 0.023588772863149643, -0.03713078051805496, -0.012550807558000088, 0.07816503942012787, 0.013361146673560143, -0.03585737571120262, 0.014013339765369892, 0.007188219577074051, -0.023203017190098763, -...
0.801973
0.779146
0.022828
You are tasked with implementing a function that determines whether a local minimum of a convex function is a global minimum, with respect to a given set. The function should take as input a function f : E → β, a point a ∈ s, where s is a subset of E, and the necessary conditions for a local minimum of f at a. You need...
glaive
[ -0.0009967684745788574, 0.03134235739707947, -0.041011955589056015, -0.03025621920824051, 0.053882937878370285, -0.01522296853363514, -0.024318791925907135, 0.06349451094865799, 0.041685644537210464, -0.00907914899289608, 0.0154400784522295, 0.04497189447283745, -0.021352041512727737, -0.0...
0.805937
0.781375
0.024562
You are tasked with writing a function called `specifyFunction2` that takes a `treeMap` of natural numbers as input. The function should perform the specified operations on the treeMap and return the result. The operations to be performed are as follows: 1. If the treeMap contains a `Node<Nat>` with two child `Leaf<Nat...
glaive
[ 0.02906508557498455, 0.033683814108371735, -0.02956473082304001, -0.03980472683906555, 0.03637221083045006, -0.011740914545953274, 0.00721315061673522, 0.0669979378581047, 0.02547805942595005, 0.009821564890444279, 0.04575978219509125, 0.020718015730381012, -0.03633139654994011, 0.00723594...
0.816773
0.790702
0.026072
You are tasked with creating a subroutine in the CalculiX finite element program to count the number of triangles needed for the triangulation of the contact master surfaces. The subroutine should also count the slave entities (nodes for nodal surfaces and faces for facial surfaces) and determine the master and slave s...
glaive
[ 0.012043231166899204, 0.025749411433935165, -0.031230097636580467, -0.0335925929248333, 0.02882339432835579, 0.006179085932672024, -0.021156059578061104, 0.04991328716278076, 0.03163566812872887, 0.013442941941320896, 0.030763471499085426, 0.054048556834459305, -0.00582649651914835, -0.004...
0.804597
0.77746
0.027137
You are tasked with creating a Sudoku solver using the given code snippet as the foundation. The solver should take in a Sudoku grid of any order and return a solved grid with all cells filled in according to the Sudoku rules. A Sudoku grid consists of a number of cells, grouped into rows, columns, or boxes for applyi...
glaive
[ 0.006858333013951778, 0.027341265231370926, -0.024611299857497215, -0.055190879851579666, 0.03476033732295036, -0.035237058997154236, -0.010209288448095322, 0.05426928773522377, 0.05278942734003067, -0.017662309110164642, 0.019794028252363205, 0.022210897877812386, -0.016781780868768692, -...
0.817006
0.775739
0.041267
You are given a map represented as a list of locations and their corresponding distances to other locations. The map is stored in a data structure called `LMap`, which is a `Map` of `Int` to a list of tuples containing the destination location and the distance. Additionally, there is a function `solve` that takes the m...
glaive
[ 0.013038828037679195, 0.018975136801600456, -0.005626283586025238, -0.037832509726285934, 0.04875486344099045, -0.01835407130420208, -0.018544262275099754, 0.03561576083302498, 0.048413459211587906, -0.021322058513760567, 0.028562625870108604, 0.034907564520835876, -0.0029718177393078804, ...
0.821059
0.785492
0.035567
You are tasked with creating a program to calculate the probability of a quantum state using a given amplitude function. The amplitude function is defined as follows: amplitude[x_,y_] := (long complex expression) The probability of a quantum state is given by the square of the absolute value of the amplitude function...
glaive
[ 0.010592631995677948, 0.029266713187098503, -0.034296903759241104, -0.028475893661379814, 0.036494188010692596, -0.023577995598316193, -0.014496824704110622, 0.07105687260627747, 0.03879402577877045, 0.00631225761026144, 0.026584869250655174, 0.029559526592493057, -0.01926547661423683, -0....
0.790837
0.762792
0.028045
You are tasked with implementing a C++ program that utilizes the Eigen library to perform tensor contraction operations on a GPU. The program should be able to handle different dimensions of input tensors and validate the results by comparing the CPU and GPU computation outputs. The program should perform the followin...
glaive
[ 0.019295550882816315, 0.022860126569867134, -0.017983848229050636, -0.038063887506723404, 0.02297225035727024, -0.004142850171774626, -0.019876668229699135, 0.10662642121315002, 0.04837976023554802, -0.02951165847480297, 0.014299939386546612, 0.03213358670473099, -0.008137576282024384, 0.0...
0.805223
0.790413
0.014811
I need to create a program that calculates the minimal tour length for a given itinerary. The itinerary is a sequence of nodes that need to be visited in a specific order, represented by their IDs. I want the program to take the itinerary as input and output the minimal tour length required to visit all nodes in the gi...
glaive
[ 0.00040038544102571905, 0.007161434274166822, -0.05040691792964935, -0.03441676124930382, 0.04313470795750618, -0.0175971407443285, -0.049852024763822556, 0.029252514243125916, 0.03716796636581421, -0.012166609056293964, 0.036582037806510925, 0.02795746736228466, -0.010711626149713993, -0....
0.818301
0.78995
0.028351
You are tasked with creating a program to obtain the topology of an MPI system, including servers, MPI threads, and GPUs. The program should be able to count the total number of unique hosts and GPUs, associate GPUs with MPI threads, and obtain properties of each GPU. The program should also be able to print out the to...
glaive
[ 0.024269690737128258, 0.018862677738070488, -0.0451626293361187, -0.022074446082115173, 0.020966026932001114, -0.027628904208540916, -0.04699166119098663, 0.04422280937433243, 0.049621663987636566, -0.018998926505446434, 0.0029008903075009584, 0.03851465880870819, -0.019375836476683617, -0...
0.790605
0.771796
0.018809
You have been tasked with implementing a parallelized Incomplete LU (ILU) factorization using CUDA for sparse matrices. The ILU factorization is a method for solving linear systems of equations and is commonly used in iterative methods for solving large linear systems. Your task is to parallelize the ILU factorization ...
glaive
[ 0.0044501470401883125, 0.0575159415602684, -0.01269144844263792, -0.024443870410323143, 0.020941151306033134, 0.004700081888586283, -0.018557654693722725, 0.07571148872375488, 0.04286164417862892, -0.02801528386771679, 0.016891926527023315, 0.026931799948215485, -0.007200626190751791, 0.00...
0.798655
0.781409
0.017247
You are tasked with creating a program to calculate the number of 4 X n binary arrays with rows and columns lexicographically nondecreasing and column sums nonincreasing. In other words, you need to generate all possible 4 X n binary arrays where each row is nondecreasing when read from left to right and each column's ...
glaive
[ -0.00989121850579977, 0.02449755370616913, -0.04288630932569504, -0.025983788073062897, 0.03905877843499184, -0.01581662893295288, -0.037530384957790375, 0.057441774755716324, 0.04467485472559929, -0.020886752754449844, 0.01444441918283701, 0.026603881269693375, -0.04741277918219566, -0.01...
0.834179
0.778126
0.056053
I have a dataset with information about 2000 students, including columns for their name, class, subject, age, and address. I need to write a Java program that uses data structures and algorithms to create a new dataset that only includes the "Name", "Class", and "Subject" columns for students who are 16 years old or ol...
glaive
[ 0.01857423223555088, 0.0018718227511271834, -0.04917797073721886, -0.029342610388994217, 0.03445738926529884, -0.050434011965990067, -0.012112027034163475, 0.032599322497844696, 0.03610945865511894, -0.04045320674777031, 0.031266745179891586, 0.014670935459434986, -0.023013049736618996, -0...
0.807147
0.790198
0.016949
You are tasked with creating a program to calculate the maximum drawdown of a stock, fund, or other financial product. The maximum drawdown is an important risk management factor in the finance industry, and it is used to evaluate a fund manager's performance. Your program should be able to handle a given range of data...
glaive
[ 0.018253574147820473, 0.009883453138172626, -0.04828912392258644, -0.02419130690395832, 0.049752578139305115, -0.011469215154647827, -0.023320473730564117, 0.07177165150642395, 0.05161166936159134, -0.0040973760187625885, 0.00026017820346169174, 0.04457050561904907, -0.030239421874284744, ...
0.795417
0.77344
0.021977
You are tasked with creating a program that takes in a list of tuples containing two integer values. The program should then output a new list containing only the tuples where the second integer value is greater than the first integer value. For example, given the input: [(1, 12), (5, 2), (8, 10), (3, 3), (7, 5)] The...
glaive
[ 0.03668106347322464, 0.02501467615365982, -0.024514686316251755, -0.03399081528186798, 0.03429967910051346, -0.022342029958963394, -0.02897411771118641, 0.07316405326128006, 0.04509706422686577, -0.03738714009523392, 0.030207952484488487, 0.03868084400892258, -0.034129977226257324, -0.0108...
0.834787
0.793603
0.041184
You are tasked with creating a program that calculates the probability of a quantum state given a certain set of amplitudes. The amplitudes are defined by the functions `amplitude[x,y]` and `amplitude2[x,y]`, and the probability is calculated by the function `probability[x,y]`. The program should also find the maximum ...
glaive
[ 0.003348126308992505, 0.02885149046778679, -0.03545213118195534, -0.02273045852780342, 0.04651731997728348, -0.027619576081633568, -0.017653116956353188, 0.06752282381057739, 0.037843432277441025, 0.0021178643219172955, 0.02595316246151924, 0.03339924290776253, -0.018526636064052582, -0.01...
0.797027
0.769554
0.027473
You are tasked with creating a program that calculates the maximum probability and plots a 3D graph and contour plot based on the given quantum amplitude equations. The program should use the NMaximize function to find the maximum probability and then plot the 3D and contour graphs. The quantum amplitude equations are...
glaive
[ 0.01629115454852581, 0.036856696009635925, -0.036189768463373184, -0.02977735921740532, 0.034693799912929535, -0.03141578286886215, -0.022632088512182236, 0.06625553965568542, 0.052692122757434845, 0.001232416951097548, 0.022469166666269302, 0.03358064219355583, -0.01947023533284664, -0.01...
0.788314
0.760392
0.027922
You are tasked with implementing a set of vector operations in a Lisp programming language. The operations include vector addition, subtraction, normalization, length calculation, distance calculation, midpoint calculation, and more. These operations will be performed on both 2D and 3D vectors. Your task is to implemen...
glaive
[ 0.03132063150405884, 0.044079460203647614, -0.019754568114876747, -0.04292962700128555, 0.0447094552218914, -0.00863390602171421, -0.03271569311618805, 0.05100584402680397, 0.05558893829584122, -0.010893222875893116, 0.026755766943097115, 0.03481137007474899, -0.0038753743283450603, -0.014...
0.795075
0.780199
0.014876
You are tasked with creating a program that automatically generates a table of contents for a document. The program should read the section and subsection headers from the document and create a table of contents with the correct page numbers. The input will be a list of section and subsection headers along with their c...
glaive
[ 0.03273947536945343, 0.026318224146962166, -0.022435173392295837, -0.014263501390814781, 0.02765977755188942, -0.01953260600566864, -0.0029156277887523174, 0.04061705246567726, 0.010070203803479671, -0.010076149366796017, 0.02100609429180622, 0.020338822156190872, -0.045424479991197586, 0....
0.770908
0.750303
0.020605
I want to create a Prolog module that can handle matrices with integer or floating point numbers. The module should be able to perform various operations on matrices, such as addition, subtraction, multiplication, division, and more. The module should also be able to create new matrices, retrieve the dimensions of a ma...
glaive
[ 0.031012650579214096, 0.01762009970843792, -0.023437047377228737, -0.04561321437358856, 0.0473552942276001, -0.03881499171257019, -0.014037379063665867, 0.0345962718129158, 0.04275553673505783, -0.009987568482756615, 0.005287432111799717, 0.04448358714580536, -0.027328897267580032, -0.0085...
0.779683
0.765307
0.014375
You are tasked with implementing a simulation of a game involving a circular list of cups labeled with positive integers. The game consists of a series of moves, where each move involves the following steps: 1. The current cup is removed from the circle 2. The next three cups immediately clockwise of the current cup ar...
glaive
[ -0.0036312593147158623, 0.025403225794434547, -0.019320035353302956, -0.03385240584611893, 0.033653948456048965, -0.01263531856238842, -0.027385326102375984, 0.07269652932882309, 0.05416509881615639, -0.015896879136562347, 0.02415730059146881, 0.043549634516239166, -0.015011928975582123, -...
0.828906
0.801208
0.027697
You are tasked with creating a function that takes a specific date and time as input and calculates the date and time after a gigasecond (10^9 seconds) has passed. The function should accept a tuple in the format {{year, month, day}, {hour, minute, second}} and return a new tuple in the same format representing the dat...
glaive
[ 0.018257295712828636, 0.031068790704011917, -0.02394827827811241, -0.0365690253674984, 0.03453348949551582, -0.03857627883553505, -0.05142688751220703, 0.08552369475364685, 0.05382344499230385, -0.007755892351269722, 0.03968112915754318, 0.02518896944820881, -0.03047882206737995, -0.006330...
0.79512
0.774435
0.020684
You are tasked with creating a function that counts the number of occurrences of a specific character in a given string. Your function should take in two parameters: a string and a character, and return the count of the given character within the string. For example, if the input string is "hello" and the character i...
glaive
[ 0.000930794863961637, 0.018026024103164673, -0.011894334107637405, -0.0492754727602005, 0.052835576236248016, -0.020029855892062187, -0.009824413806200027, 0.050402481108903885, 0.02571880631148815, 0.0058117941953241825, 0.002906259149312973, 0.018862487748265266, -0.020845798775553703, -...
0.790728
0.768261
0.022467
You are tasked with implementing a subroutine in Fortran called MMPY2 that performs matrix-matrix multiplication. The subroutine takes in several input parameters: - M: the number of rows in the input matrices X and Y - N: the number of columns in X and the number of rows in A - Q: the number of columns in A and Y - XP...
glaive
[ 0.02022686041891575, 0.029400736093521118, -0.015162640251219273, -0.04677150398492813, 0.03154229372739792, -0.017274633049964905, -0.017970751971006393, 0.06380216777324677, 0.03563547134399414, -0.012603512033820152, -0.002739632735028863, 0.028229977935552597, -0.0365351140499115, -0.0...
0.793426
0.768312
0.025114
You are tasked with optimizing a complex mathematical function in the form of a code snippet, where the function involves various mathematical operations and parameters. The goal is to find the maximum value of the function within a specified range and plot its 3D and contour graphs.
glaive
[ 0.021761853247880936, 0.024186747148633003, -0.05735522881150246, -0.03770226612687111, 0.040442515164613724, -0.01262853667140007, -0.04858621209859848, 0.04187310114502907, 0.039987701922655106, -0.007356726564466953, 0.01984100602567196, 0.045434363186359406, -0.026283225044608116, 0.00...
0.799862
0.775604
0.024258
You are given a list of numbers, but the list is not in a regular format. The list is a 2D array with some missing values. Your task is to fill in the missing values in the array based on the following rules: - The first column contains sequential numbers starting from 1. - The second column contains the square of the...
glaive
[ 0.011984498240053654, 0.05251803621649742, -0.021801017224788666, -0.05171811953186989, 0.06152080371975899, -0.01955244317650795, -0.0017134995432570577, 0.06131298840045929, 0.028498373925685883, -0.010287509299814701, 0.027799447998404503, 0.032100602984428406, -0.04311252012848854, -0....
0.825915
0.796789
0.029126
You are tasked with implementing a CUDA device function that calculates the natural logarithm of a given number in double-double precision. The function should use Newton's iteration to determine the root of the function f(x) = exp(x) - a, and return the result with high precision. Additionally, you need to implement C...
glaive
[ 0.01641874946653843, 0.04488074406981468, -0.03928710147738457, -0.03240940719842911, 0.018893199041485786, -0.01666432060301304, -0.039813026785850525, 0.07735924422740936, 0.04236743971705437, -0.03127770498394966, 0.03128596395254135, 0.03806929290294647, -0.008560705929994583, -0.01196...
0.796676
0.781002
0.015674
What is the algorithm for merging two sorted arrays into one in C++?
glaive
[ 0.010827366262674332, 0.02566000074148178, -0.02449037693440914, -0.02971721813082695, 0.018180400133132935, 0.009054124355316162, -0.021107438951730728, 0.07336951792240143, 0.03568817302584648, -0.019500693306326866, 0.015396501868963242, 0.028025932610034943, -0.01955813355743885, -0.01...
0.794299
0.770336
0.023963
You are tasked with implementing a CUDA kernel function to resample data from an input array based on a set of indexes. The input arrays x0 and y0 contain the original data, while the indexes array specifies the indices to be sampled. The resampled data should be stored in the output arrays x and y. The size of the inp...
glaive
[ 0.0006222972879186273, 0.04852582514286041, -0.015401259064674377, -0.018341951072216034, 0.0422726608812809, -0.021497681736946106, -0.019641265273094177, 0.09043077379465103, 0.02732982113957405, -0.016674689948558807, 0.036409422755241394, 0.02877938561141491, -0.02196648344397545, 0.01...
0.793705
0.775974
0.017731
You are tasked with designing a VHDL entity and architecture for a counter with a specified number of bits. The entity should have input ports for enabling the counter, resetting the counter, and providing a clock signal. It should also have an input for a synchronous clear signal and an output for the counter value. T...
glaive
[ 0.02074345201253891, 0.016391996294260025, -0.008389557711780071, -0.04325086250901222, 0.022606637328863144, -0.025305500254034996, -0.03881300240755081, 0.09521784633398056, 0.04776793718338013, -0.019639315083622932, 0.023767240345478058, 0.048027291893959045, -0.018782533705234528, 0.0...
0.793901
0.778649
0.015253
You are tasked with implementing a function to calculate the value of A114211, where a(n) is defined as a(n) = (5*n^3+12*n^2+n+6)/6. Your function should take an integer n as input and return the value of a(n). Ensure that the function works efficiently for large values of n.
glaive
[ 0.04596056789159775, 0.03148332238197327, -0.025514867156744003, -0.05003323778510094, 0.04001166671514511, -0.04134826734662056, -0.03007662668824196, 0.0645507276058197, 0.02475307695567608, 0.011049038730561733, 0.015184069983661175, 0.0542752742767334, -0.05386437103152275, -0.01219078...
0.819774
0.771725
0.048049
You are tasked with creating a program to calculate the probability of a quantum state using a given amplitude function. The amplitude function is defined as follows: amplitude[x_,y_] := (long complex function) You need to write a function to calculate the probability of a quantum state based on the given amplitude f...
glaive
[ 0.006669886875897646, 0.03223459795117378, -0.03364172950387001, -0.02754022553563118, 0.04165945202112198, -0.022134361788630486, -0.009797635488212109, 0.07272487878799438, 0.030884182080626488, 0.010536743327975273, 0.02843853458762169, 0.03074589930474758, -0.010040417313575745, -0.015...
0.794528
0.766481
0.028047
I need to create a program that takes input for the degree of a polynomial (N) and a parameter (alpha) for the Laguerre polynomial. The program should then generate and display charts for Legendre, Chebyshev, Reduced Chebyshev, Hermite, and Laguerre polynomials based on the input. Additionally, the program should calcu...
glaive
[ 0.023233354091644287, 0.027660148218274117, -0.05592542141675949, -0.03853512555360794, 0.020779557526111603, -0.03741990774869919, -0.015932347625494003, 0.05051775649189949, 0.033300913870334625, -0.024885712191462517, 0.013875238597393036, 0.04703139513731003, -0.03221593797206879, -0.0...
0.795839
0.778589
0.01725
You are tasked with implementing a Fortran program that utilizes atomic operations to perform a bitwise OR operation on an array element. The program should use the `atomic_or` subroutine from the `iso_fortran_env` module to perform the operation and should be able to handle a binary input value. Write a Fortran progr...
glaive
[ 0.02303936891257763, 0.015742672607302666, -0.02152622677385807, -0.010033675469458103, 0.022502876818180084, -0.0326959565281868, -0.005778385326266289, 0.10225752741098404, 0.049336306750774384, -0.016604876145720482, 0.01762436516582966, 0.027056928724050522, -0.02602074109017849, -0.00...
0.809593
0.788379
0.021214
You are tasked with creating a SAS macro that calculates the weights of all values of a variable in each subgroup within a dataset. The input dataset needs to be sorted by a specified variable before running the macro. The macro should have the following options: - data: Required. Data set that contains the data of int...
glaive
[ 0.007406996097415686, 0.024565165862441063, -0.06031012162566185, -0.0385456345975399, 0.0479833148419857, -0.027976714074611664, -0.004164427984505892, 0.04893498495221138, 0.037119392305612564, 0.008342955261468887, 0.03265395015478134, 0.02787558175623417, -0.031373538076877594, -0.0094...
0.789379
0.769117
0.020262
You are tasked with implementing a function in a programming language that takes in three boolean values (a, b, c) and returns a boolean value based on the following logic: - If a and b and c are all true, the function should return true if c and b and a are all true, otherwise it should return false. - If a and false ...
glaive
[ 0.016197266057133675, 0.02596728876233101, -0.05108970031142235, -0.025019438937306404, 0.042173679918050766, -0.03653845936059952, -0.006944251712411642, 0.07595513015985489, 0.024372510612010956, -0.020873142406344414, 0.018533481284976006, 0.0532757043838501, -0.011317146010696888, -0.0...
0.822988
0.798507
0.024481
You are tasked with creating a function that takes a range of IP addresses and returns a string representation of the IP range. The input will be an object with a start and end property, where the start property is the starting IP address and the end property is the ending IP address. If the end property is null, only ...
glaive
[ 0.02895374968647957, 0.04135196655988693, -0.025012820959091187, -0.034687843173742294, 0.031149888411164284, -0.027908487245440483, -0.01767200417816639, 0.05736145004630089, 0.054030053317546844, -0.023748308420181274, 0.04436744004487991, 0.03554759919643402, -0.046524155884981155, -0.0...
0.791679
0.775254
0.016425
You are tasked with creating a program that manipulates a list of student names and their corresponding test scores. You need to write a function that takes in the student names, their test scores, and a specific score threshold. The function should return a list of student names whose test scores are above the given t...
glaive
[ 0.014546368271112442, 0.0034472784027457237, -0.026892397552728653, -0.03644830733537674, 0.03497994318604469, -0.051167041063308716, -0.0235234834253788, 0.04658160358667374, 0.024949287995696068, 0.005986231379210949, 0.017129749059677124, 0.05188576132059097, -0.028343334794044495, 0.00...
0.80858
0.790346
0.018234
You are tasked with implementing a function to calculate the determinant of a 2x2 matrix. The function should take the matrix as input and return the determinant as output. The determinant of a 2x2 matrix
glaive
[ 0.02263735979795456, 0.03925939276814461, -0.04521520435810089, -0.027967585250735283, 0.0325612798333168, -0.02163056842982769, -0.0334516242146492, 0.06854040920734406, 0.03903847560286522, -0.004139993339776993, 0.0047905780375003815, 0.03605198115110397, -0.027760077267885208, -0.00648...
0.780895
0.748527
0.032368
You are tasked with creating a CUDA kernel function that performs the operation of SAXPY (Single-precision A*X Plus Y) on arrays of floating-point numbers. The input to the function will be two arrays `src` and `dst`, both of type `float`, and a scalar `factor` of type `float`. The function should iterate through the a...
glaive
[ 0.0041261520236730576, 0.03696344047784805, -0.02745738811790943, -0.03714916482567787, 0.024004561826586723, -0.0029828157275915146, -0.017508042976260185, 0.07543334364891052, 0.0394732840359211, -0.016337130218744278, 0.042578499764204025, 0.03257462754845619, -0.01009152177721262, -0.0...
0.807491
0.789538
0.017953
You are tasked with visualizing the frequency of music genres in festival lineups and music charts over different decades. You need to create visualizations showing the frequency of various music genres in festival lineups and music charts over different decades. The frequency of each genre will be represented in both ...
glaive
[ -0.006110228132456541, 0.03041592240333557, -0.01708928868174553, -0.025574807077646255, 0.014503941871225834, -0.04837584123015404, -0.04084271937608719, 0.027492770925164223, 0.04069840535521507, 0.0029249165672808886, 0.038317907601594925, 0.017263619229197502, -0.017287421971559525, 0....
0.73101
0.710012
0.020999
You are required to write a CUDA kernel that performs floating-point fused multiply-add (FMA) operations using assembly language. Your task is to implement the following kernels: 1. fma_fp16: This kernel performs FMA operations using 16-bit floating-point data types. It takes three integer inputs (a, b, c) and an array...
glaive
[ 0.024609236046671867, 0.04214727506041527, -0.013867228291928768, -0.029854070395231247, 0.04582264646887779, -0.01100133266299963, -0.01760525070130825, 0.10207303613424301, 0.04721603915095329, -0.016370970755815506, 0.030627800151705742, 0.04967707023024559, -0.010797652415931225, -0.00...
0.794089
0.774222
0.019867
You are tasked with implementing a subroutine to perform a QR factorization with column pivoting of a matrix. The matrix A is of size MxN, and the QR factorization is computed as A*P=Q*R using Level 3 BLAS. The arguments for the subroutine are as follows: - M: The number of rows of the matrix A. M >= 0. - N: The numbe...
glaive
[ 0.018027180805802345, 0.0371943935751915, -0.02746972069144249, -0.02588661201298237, 0.03163701668381691, -0.0055819121189415455, -0.009014742448925972, 0.0646710991859436, 0.02936212718486786, 0.004342664964497089, 0.027231840416789055, 0.038061078637838364, -0.037554655224084854, 0.0083...
0.80538
0.782563
0.022817
: You are tasked with creating a program to calculate the probability of a quantum state given a set of amplitudes. The program should then find the maximum probability and plot the 3D and contour plots of the probability distribution. Your program should include the following functions: - `amplitude[x_,y_]`: This fun...
glaive
[ -0.0029725702479481697, 0.030973322689533234, -0.029191339388489723, -0.02507968619465828, 0.04793524742126465, -0.025683164596557617, -0.013613958843052387, 0.07706983387470245, 0.03681674599647522, 0.008646312169730663, 0.02693585865199566, 0.03308061510324478, -0.02229941450059414, -0.0...
0.800545
0.774423
0.026121
You are tasked with writing a program to perform a precise division operation on two decimal numbers in a database. The first decimal number has a precision of 18 digits and a scale of 9, while the second decimal number has a precision of 28 digits and a scale of 14. Your program should retrieve the result of dividing ...
glaive
[ 0.02557368203997612, 0.021736864000558853, -0.03557128831744194, -0.04169505834579468, 0.03307432308793068, -0.020245177671313286, -0.029943719506263733, 0.06144077330827713, 0.05736022815108299, -0.026265783235430717, 0.03721506521105766, 0.024095913395285606, -0.02052704244852066, 0.0084...
0.805286
0.782982
0.022303
You have been tasked with implementing a CUDA kernel function to scatter the output of a Point-Pillars Network onto a 2D grid. The input to the scatter_kernel function consists of arrays x_coors, y_coors, pfe_output, and scattered_feature, along with constants MAX_NUM_PILLARS_, GRID_X_SIZE, and GRID_Y_SIZE. The scatter...
glaive
[ 0.0012814740184694529, 0.05629793927073479, -0.01294860988855362, -0.016903365030884743, 0.03459545969963074, -0.020424768328666687, -0.03912871703505516, 0.0901307538151741, 0.051791928708553314, -0.005975646898150444, 0.03024453856050968, 0.043859802186489105, -0.02113213762640953, 0.000...
0.79193
0.772762
0.019168
You are tasked with creating a program that calculates the probability distribution of a quantum system with 16 qubits. The program should use the given `amplitude` and `probability` functions to find the maximum probability and plot the 3D and contour graphs.
glaive
[ 0.002760662930086255, 0.025413664057850838, -0.0339648500084877, -0.01958279497921467, 0.052534155547618866, -0.029607905074954033, -0.030264299362897873, 0.062034327536821365, 0.03532226383686066, -0.01011455338448286, 0.03527002036571503, 0.038162797689437866, -0.0108894482254982, -0.018...
0.803386
0.777108
0.026278
You are tasked with implementing a class for matrix operations in C++ using CUDA technology. The class should be able to perform matrix decomposition and compute the determinant of the matrix. The matrix should be loaded from a file, and the decomposition can be performed either on the GPU or CPU. Your task is to crea...
glaive
[ 0.019138582050800323, 0.02898174524307251, -0.025960305705666542, -0.02551833726465702, 0.03922624513506889, -0.014524337835609913, -0.03475548326969147, 0.11352218687534332, 0.049029622226953506, -0.0308363139629364, 0.020885908976197243, 0.03666416555643082, 0.0004118896904401481, -0.010...
0.791767
0.775632
0.016135
You are tasked with implementing a set of functions to calculate affine, rigid, and translation transformations between moving and fixed points in a 2D space. The input consists of two arrays of points: moving_pts and fixed_pts, both represented as 2D arrays. The calculate_affine function should return the transformati...
glaive
[ 0.03775760158896446, 0.04813116416335106, -0.02307514287531376, -0.03732806444168091, 0.04764287546277046, -0.040086355060338974, -0.016676602885127068, 0.06487338244915009, 0.03669087588787079, 0.007993296720087528, 0.015555399470031261, 0.013548091985285282, -0.038408149033784866, -0.003...
0.797748
0.771112
0.026637
I want to develop a function that can determine if a specified number, which can be an integer or a floating point, exists within a multi-dimensional numerical array. Additionally, I want the function to keep track of the total number of occurrences of the specified number in the array. Can anyone help me with this? `...
glaive
[ 0.0003246916749048978, 0.02618219144642353, -0.05337123945355415, -0.023083219304680824, 0.04807275906205177, -0.02670382149517536, -0.02267126739025116, 0.05323663353919983, 0.026649082079529762, -0.013592230156064034, 0.0117438193410635, 0.018301021307706833, -0.02040303312242031, -0.017...
0.813598
0.798447
0.015151
You are tasked with creating a program that calculates the probability of a quantum state in a 16-qubit system and then visualizes the results. You need to define functions for amplitude, amplitude2, and probability, which take in two variables x and y and perform complex mathematical calculations. Then, you should us...
glaive
[ 0.0013002912746742368, 0.03594415262341499, -0.03358306363224983, -0.018641382455825806, 0.05128856375813484, -0.02033359929919243, -0.025695977732539177, 0.0770169124007225, 0.03931340202689171, 0.0031113815493881702, 0.02923879213631153, 0.04337477311491966, -0.002108186949044466, -0.015...
0.803756
0.780519
0.023237
You are tasked with creating a CUDA C++ program to perform a series of operations on input data. The program should perform convolution, mean pooling, and dot product operations using CUDA C++ to accelerate the process. The input data consists of arrays x and y of size N * N * channels, kernel arrays kernel_1, kernel_2...
glaive
[ -0.00032786509837023914, 0.041891634464263916, -0.02506415918469429, -0.006052776705473661, 0.02936442941427231, 0.005742410663515329, -0.03304509446024895, 0.11283188313245773, 0.0543830506503582, -0.021221118047833443, 0.02221212163567543, 0.03972232714295387, 0.0014527596067637205, -0.0...
0.78971
0.769499
0.020211
I am trying to create a program in Clojure that calculates the sum of all the multiples of a given set of numbers up to a certain limit. The function `sum-of-multiples` should take two arguments: a vector of numbers and a limit. It should then calculate the sum of all the multiples of the numbers in the vector up to th...
glaive
[ -0.004760750103741884, 0.042858950793743134, -0.03212602436542511, -0.028439462184906006, 0.05298636481165886, -0.03136766701936722, -0.014165881089866161, 0.031518563628196716, 0.0339791364967823, -0.028001466765999794, 0.008858995512127876, 0.05189565569162369, -0.03038540482521057, -0.0...
0.800666
0.777836
0.02283
You are tasked with implementing a program that calculates the probability of a quantum system being in a certain state. The amplitude of the system is given by the function amplitude[x_,y_], and the probability is calculated using the function probability[x_, y_]. The task is to find the maximum probability and plot t...
glaive
[ 0.008581193163990974, 0.022801494225859642, -0.04461178183555603, -0.02659551426768303, 0.04696043208241463, -0.028329504653811455, -0.018744029104709625, 0.06200848147273064, 0.04817548394203186, -0.004180566407740116, 0.021517759189009666, 0.030203532427549362, -0.016115255653858185, -0....
0.808917
0.784611
0.024306
You are tasked with creating a query to retrieve the list of arrival times of vehicles going in a particular direction for a given stop. The stop ID is "00000000000000000007" and the headsign is "00000000000000000033". The query should retrieve the arrival times of vehicles at the specified stop with the specified head...
glaive
[ 0.052053797990083694, 0.017592452466487885, -0.010421243496239185, -0.016347333788871765, 0.013174786232411861, -0.02632509171962738, -0.05302349850535393, 0.056417591869831085, 0.05926087498664856, -0.014982393011450768, 0.030142612755298615, 0.01317276619374752, -0.0018089361255988479, 0...
0.778197
0.758933
0.019264
You are tasked with implementing a quantum probability distribution function using the given amplitude and probability functions. The goal is to find the maximum probability for a given number of states in a quantum system with a specific number of qubits. You will then need to visualize the probability distribution us...
glaive
[ 0.008662249892950058, 0.017676157876849174, -0.04548240080475807, -0.03366485983133316, 0.03853912279009819, -0.01803291216492653, -0.02954852022230625, 0.057496462017297745, 0.042703211307525635, 0.0040929121896624565, 0.022438861429691315, 0.028077488765120506, -0.001592231565155089, -0....
0.789175
0.770417
0.018758
You are required to implement a function that solves for Nash equilibria in a normal form game using the Lemke-Howson algorithm. The function should take as input a normal form game and an initial pivot to start the algorithm. The function should return the Nash equilibria computed by the algorithm.
glaive
[ 0.02566232532262802, 0.005768449977040291, -0.030582180246710777, -0.030514856800436974, 0.03173551335930824, -0.006963646039366722, -0.027690183371305466, 0.0712253600358963, 0.045010920614004135, -0.024802612140774727, 0.03028424084186554, 0.04895739629864693, -0.024902265518903732, -0.0...
0.808211
0.785539
0.022672
You have been given a set of time points and the number of beats that occurred at each time point. Your task is to write a program to process this data and generate a series of notes based on the given time points and beat counts. Each note should have a start time, end time, and the number of beats associated with it....
glaive
[ 0.033065978437662125, 0.019662143662571907, -0.0575064979493618, -0.0029647795017808676, 0.03275561332702637, -0.039312973618507385, -0.029802046716213226, 0.07346528023481369, 0.049012042582035065, -0.005642947740852833, 0.053118716925382614, 0.014907874166965485, -0.03956708312034607, -0...
0.809609
0.792233
0.017376
You are tasked with writing a Python program to extract the digit in the tens place of a given integer and print it. Write a function that takes an integer as input and returns the digit in the tens place. For example, if the input integer is 354, the function should return 5. If the input is 120, the function should ...
glaive
[ 0.037168871611356735, 0.0282434094697237, -0.038571327924728394, -0.04080703482031822, 0.03864907845854759, -0.03647119924426079, -0.029524967074394226, 0.03123294748365879, 0.027684630826115608, -0.004024056252092123, 0.02425227500498295, 0.03881344199180603, -0.04870757833123207, 0.00358...
0.799977
0.782193
0.017785
You are required to implement a function that finds all occurrences of a specified pattern in a given set of strings and returns the substrings that match the pattern. The function should be able to handle large sets of strings and efficiently compute the size and count of matches for each string before extracting the ...
glaive
[ 0.012248104438185692, 0.027249600738286972, -0.03399056941270828, -0.02183638885617256, 0.024325735867023468, -0.03321634978055954, -0.018563641235232353, 0.08898449689149857, 0.04111015051603317, -0.005260071717202663, 0.016611332073807716, 0.03652767464518547, 0.0010161014506593347, -0.0...
0.817401
0.796119
0.021282
You are tasked with writing a program to generate the sequence A058006, which consists of alternating factorials. The sequence is defined as follows: - The first term is 1 - The second term is 0 - The third term is 2 - The fourth term is -4 - The fifth term is 20 - And so on... The pattern for generating the terms in ...
glaive
[ 0.0015698670176789165, 0.03423040360212326, -0.01030603889375925, -0.01675518974661827, 0.024267736822366714, -0.033034488558769226, -0.028889577835798264, 0.08009220659732819, 0.0375414676964283, -0.01916295848786831, 0.011659662239253521, 0.027358658611774445, -0.04665324091911316, -0.00...
0.826292
0.78114
0.045152
You are tasked with simulating the movement of carts on a railway track, which is represented as a grid. Each cart has a specific starting position, direction, and movement behavior, and the grid contains different types of road segments (|, -, /, \, +) that affect the movement of the carts. The simulation involves upd...
glaive
[ 0.014883475378155708, 0.023901671171188354, -0.028581032529473305, -0.028128312900662422, 0.03936045989394188, -0.026369567960500717, -0.039809972047805786, 0.06841213256120682, 0.03437846899032593, -0.01244994718581438, 0.01790340431034565, 0.02264806069433689, -0.01908799447119236, -0.00...
0.811637
0.790206
0.021431
I need to create a program that can generate different types of visual art based on mathematical expressions. The art will be in the form of grayscale and color images, and will be created using a combination of mathematical functions and randomization. The program needs to be able to: 1. Generate grayscale images bas...
glaive
[ 0.015363411977887154, 0.026557475328445435, -0.0223150122910738, -0.034459188580513, 0.040728937834501266, -0.019696244969964027, -0.05030928552150726, 0.07542794942855835, 0.05943624675273895, -0.041139110922813416, 0.030993593856692314, 0.027573170140385628, -0.009102399460971355, -0.015...
0.782492
0.76394
0.018552
You are tasked with implementing a program to perform QR decomposition using the SAS programming language. QR decomposition is a technique used to decompose a matrix into an orthogonal matrix and an upper triangular matrix. Your program should take a given matrix as input and compute the orthogonal matrix (q) and the u...
glaive
[ 0.02856714278459549, 0.02168586663901806, -0.04374825581908226, -0.03649570047855377, 0.03967507183551788, 0.0006042752065695822, -0.009690823964774609, 0.06489758938550949, 0.0383545458316803, 0.0015494218096137047, 0.02842550538480282, 0.02359134331345558, -0.03193572163581848, -0.013453...
0.788294
0.772043
0.01625
You are tasked with creating a function that generates a list of random characters and numbers based on a given set of commands. The function should take in an association list (alist) of keywords and their corresponding values, and output a list of all the char-codes in one long list. The commands in the input alist ...
glaive
[ 0.018720723688602448, 0.029607132077217102, 0.0037751556374132633, -0.05054086446762085, 0.037444256246089935, -0.04119385406374931, -0.01834231987595558, 0.026133202016353607, 0.032324668020009995, -0.009749764576554298, 0.015473464503884315, 0.05460544675588608, -0.029766064137220383, -0...
0.800916
0.783968
0.016947
During a race, a train and a series of cars competed. The train completed the race in 30 minutes, while each car finished at a different time. I have a list that contains the finish times for the cars in minutes. I need to write a program that can calculate the time difference between each car and the train after 30 mi...
glaive
[ 0.023078303784132004, 0.029720136895775795, -0.03133217990398407, -0.015968043357133865, 0.030953284353017807, -0.01740046590566635, -0.04454774409532547, 0.05901314318180084, 0.06366855651140213, -0.025358788669109344, 0.022313665598630905, 0.03437257558107376, -0.014753232710063457, -0.0...
0.825636
0.791439
0.034196
You are tasked with creating a program that can process groups of answers to identify unique and common answers within each group. Given a list of groups, where each group contains a set of answers from a specific set of individuals, your program should: - Calculate the total number of unique answers within each group...
glaive
[ 0.015216289088129997, 0.02087821252644062, -0.04537731036543846, -0.048975713551044464, 0.05149710923433304, -0.04968864843249321, -0.014741289429366589, 0.04500313103199005, 0.027975916862487793, -0.004300287924706936, 0.012872631661593914, 0.003995351027697325, -0.03398261219263077, -0.0...
0.800268
0.747844
0.052423
You are tasked with implementing a function in a programming language that takes in the following parameters: - `a`: An integer representing the start index - `b`: An integer representing the end index - `price`: A float representing the price - `mean`: A float representing the mean - `fundamentalZero`: A float represe...
glaive
[ 0.025804782286286354, 0.019377032294869423, -0.042462270706892014, -0.04438641294836998, 0.04396464303135872, -0.03694835305213928, -0.0252838134765625, 0.0612814836204052, 0.039863068610429764, 0.004969116300344467, 0.027292383834719658, 0.040204860270023346, -0.05055241659283638, -0.0006...
0.81741
0.785871
0.031539
You are tasked with creating a function in Python that checks whether a given number is a palindrome in binary and decimal form. A palindrome is a number that reads the same forwards and backwards. Your function should take an integer as input and return True if the number is a palindrome in both binary and decimal for...
glaive
[ 0.012652987614274025, 0.023080062121152878, -0.025986649096012115, -0.035017307847738266, 0.038620587438344955, -0.016399996355175972, 0.004503521136939526, 0.06671910732984543, 0.022713640704751015, -0.00045839426456950605, 0.012312985956668854, 0.022317225113511086, -0.011049464344978333, ...
0.805111
0.768328
0.036783
You are tasked with writing a program that calculates the sum of the first 5 fractional Fibonacci numbers. A fractional Fibonacci number is obtained by dividing the current Fibonacci number by the previous one. The Fibonacci sequence starts with 1, 1, 2, 3, 5, 8, 13, and so on. The program should iterate through the fi...
glaive
[ -0.0006582344649359584, 0.02866913564503193, -0.02211664617061615, -0.040271151810884476, 0.06825143843889236, -0.015883024781942368, -0.01165076158940792, 0.0573066808283329, 0.0369168296456337, -0.0019962196238338947, 0.022383427247405052, 0.02383180521428585, -0.04647728055715561, -0.00...
0.801632
0.758786
0.042845
You are given a list of strings, each representing a box ID of a product. You need to find the following: - The number of box IDs that contain exactly two of any letter - The number of box IDs that contain exactly three of any letter - The checksum, which is calculated by multiplying the number of box IDs with exactly ...
glaive
[ 0.031668927520513535, 0.008785754442214966, -0.03768846020102501, -0.03458927199244499, 0.035081278532743454, -0.0071592810563743114, -0.022190311923623085, 0.05203566327691078, 0.027910783886909485, -0.015748698264360428, 0.017028940841555595, 0.03177874907851219, -0.024453183636069298, -...
0.823384
0.782727
0.040657
You are tasked with creating a program to model the spread of infections and forecast deaths in various countries. The program will take in data for each country, including the number of days of observed data, reported deaths, population, and other relevant factors. The goal is to use this data to predict the number of...
glaive
[ 0.026192758232355118, 0.0203973688185215, -0.0487675666809082, -0.04139205813407898, 0.03680916503071785, -0.024234600365161896, -0.038324274122714996, 0.06337500363588333, 0.030034665018320084, -0.018813684582710266, 0.015646763145923615, 0.060805998742580414, -0.008751509711146355, 0.024...
0.776308
0.759113
0.017195
What is an algorithm for finding the median of a sorted array?
glaive
[ 0.021201903000473976, 0.012102826498448849, -0.04133238643407822, -0.04185791686177254, 0.014752847142517567, -0.020546330139040947, -0.03943078592419624, 0.0530284121632576, 0.022221624851226807, -0.04256501421332359, 0.029898496344685555, 0.015099342912435532, -0.03331323713064194, -0.01...
0.788808
0.760472
0.028335