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 implementing a program that calculates various probabilities based on given events. The program should be able to handle calculations for de Morgan's law, binomial coefficients, conditional probabilities, and independent and disjoint events. | glaive | [
0.01771741919219494,
0.013517690822482109,
-0.04064600542187691,
-0.028211699798703194,
0.043797701597213745,
-0.028447819873690605,
-0.034338679164648056,
0.06322572380304337,
0.058229994028806686,
-0.010046379640698433,
0.029330210760235786,
0.03900681063532829,
-0.014951372519135475,
-0... | 0.795596 | 0.772993 | 0.022603 |
You are tasked with implementing a function to calculate and finalize the CSR row_ind array that would result from summing together two CSR matrices. The function should take in the row_ind array, index_ptr array, and data array for both matrices, as well as their respective sizes and the number of rows in the final ma... | glaive | [
0.000016240086551988497,
0.038214344531297684,
-0.03181201219558716,
-0.03765232861042023,
0.04462699219584465,
-0.004489079117774963,
-0.02601184882223606,
0.10058701038360596,
0.04457606002688408,
-0.017504889518022537,
0.026546869426965714,
0.031727276742458344,
-0.011881674639880657,
-... | 0.80622 | 0.785482 | 0.020738 |
You are tasked with implementing a CUDA kernel function to perform matrix multiplication using the CUDAMatrix library. The goal is to create a parallelized kernel that can efficiently multiply two matrices on a GPU.
The function signature for the kernel should be:
```cpp
__global__ void multiply_kernel(float* A, float... | glaive | [
0.00850621797144413,
0.05554793030023575,
-0.01608128286898136,
-0.02529054693877697,
0.03338819369673729,
-0.0018161350162699819,
-0.03130408748984337,
0.10231807082891464,
0.044351812452077866,
-0.02412744052708149,
0.019599998369812965,
0.033463820815086365,
-0.011709032580256462,
-0.00... | 0.792907 | 0.774293 | 0.018614 |
I have a table called "城市" (City) with columns "城市名稱" (City Name) and "國家名稱" (Country Name). I want to write an SQL query that groups the cities by country and then sorts them alphabetically by the first letter of the city name. Additionally, I need to calculate the number of cities in each country. How can I achieve t... | glaive | [
0.05196873098611832,
0.030081434175372124,
-0.019792214035987854,
-0.023869208991527557,
0.03761053457856178,
-0.031262174248695374,
-0.008397091180086136,
0.022651318460702896,
0.04292767122387886,
-0.010453633964061737,
0.010359403677284718,
0.02538079023361206,
-0.037827491760253906,
-0... | 0.780757 | 0.761719 | 0.019038 |
You are tasked with implementing a Discrete Interval Encoding Tree (DIET) using Scala. The DIET should be implemented using a Vector and should be balanced at all times. The DIET should support the following operations:
- Adding an interval to the DIET
- Adding a single value to the DIET
- Removing an interval from the... | glaive | [
0.01833789236843586,
0.007867861539125443,
-0.0024360637180507183,
-0.03290354087948799,
0.018522540107369423,
-0.04081364721059799,
0.001962255919352174,
0.057259466499090195,
0.023944459855556488,
-0.024943336844444275,
0.05471714958548546,
0.029249055311083794,
-0.020835889503359795,
0.... | 0.814944 | 0.787977 | 0.026967 |
You are tasked with implementing a program that tests different optimization algorithms on a set of mathematical functions. The program should utilize CUDA to run the tests on a specific device. The functions will be tested using Particle Swarm and Simulated Annealing algorithms to find their minimum values in a multi-... | glaive | [
0.014496782794594765,
0.02292827144265175,
-0.04237234592437744,
-0.04281128570437431,
0.0364004448056221,
-0.008806525729596615,
-0.03204606473445892,
0.06678543984889984,
0.04593280330300331,
-0.01868509128689766,
-0.0005116567481309175,
0.027141159400343895,
0.003530715825036168,
0.0079... | 0.807454 | 0.785109 | 0.022345 |
You are required to write a CUDA C++ program to perform element-wise addition of two vectors (c = a + b). The length of the vectors a, b, and c is 1024, and the tolerance used in floating-point comparisons is 0.001. The program should include a CUDA kernel for the vector addition operation, allocate device memory for t... | glaive | [
0.00796709768474102,
0.032577626407146454,
-0.009688416495919228,
-0.013651703484356403,
0.03223435953259468,
0.003482530126348138,
-0.022080980241298676,
0.11722095310688019,
0.04811382293701172,
-0.02675926312804222,
0.0038575357757508755,
0.042576372623443604,
0.002946315100416541,
-0.0... | 0.799997 | 0.774375 | 0.025622 |
How can I create a C++ program that calculates the number of pairs in an array whose sum is less than a given number? | glaive | [
-0.013509669341146946,
0.01885189488530159,
-0.03610429912805557,
-0.021987492218613625,
0.05761408433318138,
-0.003526332089677453,
-0.02268858626484871,
0.07906849682331085,
0.03241065517067909,
-0.027798276394605637,
0.012121538631618023,
0.040324266999959946,
-0.03389422222971916,
-0.0... | 0.804606 | 0.781429 | 0.023177 |
You are tasked with creating a decentralized application that simulates a game of Rock, Paper, Scissors between two players. The challenge is to ensure that the program is deterministic, meaning that both participants must agree on which participant is responsible for sending the next move at every step of the game. Ho... | glaive | [
0.01941654644906521,
0.02327551506459713,
-0.0500389039516449,
-0.024150293320417404,
0.02114974334836006,
-0.004807689227163792,
-0.01643252745270729,
0.07762565463781357,
0.04414306581020355,
-0.04157509654760361,
0.035393353551626205,
0.031806930899620056,
-0.004767070524394512,
-0.0077... | 0.804436 | 0.789279 | 0.015156 |
You are tasked with implementing a program that can calculate the intersection of a ray with a sphere. The ray is defined by its origin and direction, and the sphere is defined by its center and radius. Your program should be able to determine if and where the ray intersects the sphere, and provide the intersection dat... | glaive | [
0.035181012004613876,
0.035666774958372116,
-0.024353085085749626,
-0.022361116483807564,
0.02695421501994133,
-0.008333392441272736,
-0.030248679220676422,
0.05306436866521835,
0.06584987789392471,
-0.03215712681412697,
0.031725239008665085,
0.03414609655737877,
-0.013802500441670418,
-0.... | 0.789048 | 0.771622 | 0.017426 |
You are tasked with writing a program to calculate the "Dist Max" for a given set of points. The "Dist Max" is defined as the maximum distance between any two points in the set, where the distance between two points (x1, y1) and (x2, y2) is given by the formula abs(x1 - x2) + abs(y1 - y2).
Your program should take as ... | glaive | [
0.019468137994408607,
0.018375946208834648,
-0.03291776031255722,
-0.03489939868450165,
0.03673451021313667,
-0.013432883657515049,
-0.048178061842918396,
0.03823837637901306,
0.05635913833975792,
-0.011377369984984398,
0.025320835411548615,
0.05741646885871887,
-0.0299687460064888,
0.0022... | 0.818767 | 0.768925 | 0.049841 |
How can I modify the following Python code to find the pair of numbers with the largest difference in a given list of floating-point numbers, while ensuring that the result is sorted in ascending order (i.e., smaller number followed by larger number)?
```python
from typing import List, Tuple
def find_furthest_element... | glaive | [
0.03978557884693146,
0.02980082854628563,
-0.024258634075522423,
-0.04239695519208908,
0.030116837471723557,
-0.02514651231467724,
-0.020166968926787376,
0.059380386024713516,
0.019880179315805435,
-0.012043756432831287,
0.02811029925942421,
0.042302098125219345,
-0.03882841020822525,
0.01... | 0.822561 | 0.785564 | 0.036997 |
You are tasked with creating a program that configures a bounded region for a given set of points. The program should take in a list of points and calculate the minimum and maximum x and y coordinates to define the bounds of the region. The program should also account for any margin or padding that needs to be added to... | glaive | [
0.02651691623032093,
0.03073922172188759,
-0.03557135909795761,
-0.021884026005864143,
0.03538426011800766,
-0.02853933349251747,
-0.024145152419805527,
0.05949539691209793,
0.042931292206048965,
-0.005251083988696337,
0.017354372888803482,
0.06654095649719238,
-0.03261839225888252,
0.0070... | 0.802737 | 0.777959 | 0.024778 |
You are tasked with creating a program that calculates the probability of a quantum state using a given quantum amplitude function. The program should also find the maximum probability and plot the probability distribution in 3D and 2D.
Write a program that defines the following functions:
1. `amplitude[x_,y_]`: Take... | glaive | [
0.006817864719778299,
0.037631675601005554,
-0.023029915988445282,
-0.022728491574525833,
0.03604608401656151,
-0.02718738280236721,
-0.014053849503397942,
0.06963983923196793,
0.03766303136944771,
0.008770127780735493,
0.02656768262386322,
0.03282501548528671,
-0.0186613779515028,
-0.0138... | 0.78849 | 0.760442 | 0.028048 |
You are asked to write a CUDA kernel function that implements the matrix-matrix multiplication (gemm) operation for a given set of parameters. The CUDA kernel function will be used for general matrix multiplication and should support different tile sizes for optimization.
The function signature for the CUDA kernel fun... | glaive | [
0.018517056480050087,
0.055516209453344345,
-0.018621642142534256,
-0.03061884455382824,
0.04053712263703346,
-0.01921122893691063,
-0.03691072762012482,
0.09231013059616089,
0.02271176129579544,
-0.02370215207338333,
0.023516438901424408,
0.031070351600646973,
-0.01174133736640215,
-0.000... | 0.799156 | 0.777727 | 0.021429 |
You are tasked with creating a Java program that performs the following tasks:
1. Create an ArrayList of integers.
2. Use a lambda expression to iterate through the ArrayList and print each element.
Write the complete Java program to achieve the above tasks. | glaive | [
0.01553956139832735,
0.03276825696229935,
-0.02007378078997135,
-0.023771461099386215,
0.05661575123667717,
-0.05215977877378464,
-0.020547708496451378,
0.04767586663365364,
0.03911113739013672,
-0.046438299119472504,
0.034837547689676285,
0.043940067291259766,
-0.0448138602077961,
-0.0121... | 0.801507 | 0.778396 | 0.023111 |
Is there a way to create an algorithm that can determine the number of changes in the order of a given list? | glaive | [
0.017730487510561943,
0.011231426149606705,
-0.03451387956738472,
-0.0308113694190979,
0.03937245532870293,
-0.036256298422813416,
-0.04070977121591568,
0.04302526265382767,
0.030520375818014145,
-0.03129404038190842,
0.01217795629054308,
0.017398953437805176,
-0.034782133996486664,
-0.015... | 0.79172 | 0.773231 | 0.018489 |
You are tasked with implementing a function that calculates the area of a triangle using Heron's formula. Heron's formula states that the area of a triangle with side lengths a, b, and c is given by the formula: √(s * (s - a) * (s - b) * (s - c)), where s is the semiperimeter of the triangle calculated as (a + b + c) /... | glaive | [
0.018741244450211525,
0.047192834317684174,
-0.034548189491033554,
-0.04125893488526344,
0.03681786730885506,
-0.015603632666170597,
-0.03671296313405037,
0.06195671483874321,
0.046688374131917953,
0.0034973816946148872,
0.020845655351877213,
0.04532449319958687,
-0.019218862056732178,
-0.... | 0.790833 | 0.762953 | 0.02788 |
You are tasked with implementing a program that simulates a computer's memory mask operation. The computer has two versions, and each version has a different memory masking behavior. The mask is represented by a string of characters, where 'X' represents a floating bit, '0' represents a bit that has to be set to 0, and... | glaive | [
0.032810382544994354,
0.027936123311519623,
-0.028547823429107666,
-0.022546565160155296,
0.03742508962750435,
-0.046693865209817886,
-0.0023704918567091227,
0.0806802362203598,
0.04016098752617836,
-0.02195717766880989,
0.006057595834136009,
0.029187291860580444,
-0.03468851372599602,
0.0... | 0.809937 | 0.785009 | 0.024929 |
I want to write a program that finds the largest palindrome made from the product of two 3-digit numbers. | glaive | [
0.018638554960489273,
0.020335905253887177,
-0.041982997208833694,
-0.03923533111810684,
0.035978469997644424,
-0.0028806019108742476,
-0.022147996351122856,
0.057233959436416626,
0.0224631167948246,
-0.026498837396502495,
0.03357794135808945,
0.052292317152023315,
-0.040229421108961105,
-... | 0.811002 | 0.783909 | 0.027093 |
You have been tasked with implementing a CUDA-based program for calculating the average shortest path length (ASPL) of a given graph using the MPI framework for parallel processing. The ASPL is a measure of the efficiency of information transfer within a network, and is defined as the average shortest path length betwe... | glaive | [
-0.012312845326960087,
0.026486743241548538,
-0.021147189661860466,
-0.027846362441778183,
0.024527965113520622,
-0.022446034476161003,
-0.050577711313962936,
0.06559500098228455,
0.04718300327658653,
-0.03055771067738533,
0.027163932099938393,
0.020085282623767853,
-0.0016884661745280027,
... | 0.807767 | 0.781281 | 0.026485 |
You are tasked with implementing a Lie group, which is a group that is also a smooth manifold, in which the group operations of multiplication and inversion are smooth maps. Smoothness of the group multiplication means that multiplication is a smooth mapping of the product manifold `G` × `G` into `G`. Your task is to c... | glaive | [
0.03031420148909092,
0.021989062428474426,
-0.02216396853327751,
-0.0535905584692955,
0.05768199265003204,
-0.032506607472896576,
-0.04805799573659897,
0.06591790169477463,
0.02683105319738388,
-0.014870980754494667,
0.01160796545445919,
0.026824817061424255,
-0.03325672447681427,
-0.03217... | 0.78767 | 0.772397 | 0.015273 |
You are tasked with implementing a Huffman coding algorithm in Scheme. Huffman coding is a method of lossless data compression, where each character is assigned a variable-length prefix code based on its frequency of occurrence. The algorithm involves creating a binary tree, known as a Huffman tree, where each leaf nod... | glaive | [
0.008614053949713707,
0.014609661884605885,
-0.008312656544148922,
-0.04272853955626488,
0.057048995047807693,
-0.04576685652136803,
0.005346322897821665,
0.07056733220815659,
0.020410526543855667,
-0.012812882661819458,
0.021952882409095764,
0.02797573059797287,
-0.013906260021030903,
0.0... | 0.814989 | 0.794163 | 0.020827 |
You are tasked with creating a program that checks if a given number is a prime number. You should implement a function that takes an integer as input and returns true if the number is a prime number, and false if it is not. A prime number is a natural number greater than 1 that has no positive divisors other than 1 an... | glaive | [
0.028547171503305435,
0.00930820219218731,
-0.014001657254993916,
-0.03365827724337578,
0.04530175030231476,
-0.03261551633477211,
0.012665603309869766,
0.0621681734919548,
0.03303900361061096,
-0.006582554895430803,
0.01964643783867359,
0.024211877956986427,
-0.02955201268196106,
-0.02625... | 0.801957 | 0.767709 | 0.034249 |
You have been tasked with simulating the spread of a contagious disease within a network using the SIR (Susceptible, Infected, Recovered) model. You are required to write a function that takes an input graph representing the network, and simulates the spread of the disease within the network according to the SIR model.... | glaive | [
-0.0006303453701548278,
0.026353007182478905,
-0.02381674386560917,
-0.024793259799480438,
0.031424492597579956,
-0.03996627405285835,
-0.047305893152952194,
0.08437711000442505,
0.028110839426517487,
-0.019899927079677582,
0.03212820366024971,
0.054749250411987305,
-0.022398609668016434,
... | 0.803846 | 0.78403 | 0.019816 |
You are given a dataset containing five columns: X, Y, TStamp, Pres., and EndPts. The dataset has a DataSize of 142. Your task is to write a program to process this dataset and perform the following operations:
1. Calculate the average of the X and Y columns.
2. Find the maximum value of the TStamp column.
3. Count the... | glaive | [
0.0029385006055235863,
0.0037521955091506243,
-0.04477273300290108,
-0.04526621475815773,
0.04137757420539856,
-0.043529484421014786,
-0.031056391075253487,
0.07432359457015991,
0.05320760980248451,
-0.009850605390965939,
0.03163547441363335,
0.024132641032338142,
-0.030927440151572227,
0.... | 0.8072 | 0.787848 | 0.019353 |
You are tasked with creating a program that takes a string and a wrapper string as input and outputs the wrapper string surrounding the input string. For example, if the input string is "OK" and the wrapper string is "TRIN", the output should be "TRINOKTRIN". | glaive | [
0.030628761276602745,
0.028684640303254128,
-0.018021689727902412,
-0.04436841607093811,
0.03884334862232208,
-0.04891716688871384,
-0.007531784009188414,
0.04884541779756546,
0.03298523277044296,
-0.019520658999681473,
0.03022867441177368,
0.04403160139918327,
-0.03921686112880707,
-0.026... | 0.806601 | 0.783761 | 0.02284 |
You are tasked with implementing a bytestring implementation of regular expression pattern matching using partial derivative. The algorithm should scan the input word from left to right until it reaches an emptiable pattern and the input word is fully consumed.
You need to build a table that maps a key to a set of tar... | glaive | [
0.02844557724893093,
0.02466728910803795,
-0.021396471187472343,
-0.0290389284491539,
0.032148901373147964,
-0.034894298762083054,
-0.0055402712896466255,
0.06996486335992813,
0.05419295281171799,
-0.01749764382839203,
0.0024649370461702347,
0.02920796535909176,
-0.024092067033052444,
-0.0... | 0.821942 | 0.806956 | 0.014986 |
You are given a complex mathematical function with two variables, `x` and `y`, represented by the equation `function[x, y]`. Your task is to find the maximum value of this function within a specified range of `x` and `y` values and then visualize the function using a 3D plot and a contour plot. | glaive | [
0.02798568829894066,
0.025219256058335304,
-0.05672749876976013,
-0.04209805652499199,
0.032643891870975494,
-0.018878962844610214,
-0.028528477996587753,
0.04175597056746483,
0.05849136784672737,
-0.0019827079959213734,
0.028515145182609558,
0.04440492391586304,
-0.021450214087963104,
0.0... | 0.800642 | 0.777097 | 0.023545 |
You have been asked to create a class in JavaScript that represents a 2D Cartesian point. The class should have the following functionalities:
1. Constructor to initialize the X and Y components of the Cartesian point. If no values are provided, default to 0.0 for both X and Y.
2. A method to create a Cartesian2 insta... | glaive | [
0.014862111769616604,
0.03325029835104942,
-0.018272770568728447,
-0.03764934092760086,
0.03319243714213371,
-0.018316105008125305,
-0.01355256699025631,
0.04895484074950218,
0.04724722355604172,
-0.017676440998911858,
0.0325714610517025,
0.038278378546237946,
-0.03399959206581116,
0.00028... | 0.798566 | 0.779792 | 0.018773 |
You are tasked with writing a program to calculate the value of the variable \(\KLevBF_{t}\) using the given formula:
\[
\KLevBF_{t} = \int_{0}^{1} \kLevBF_{t,i}\,\text{d}i = \int_{0}^{1} \big(\pLives_{t,i}\aLevBF_{t-1,i} \big/\PLives\, \big)\,\text{d}i = \int_{0}^{1} \aLevBF_{t-1,i}\,\text{d}i = \ALevBF_{t-1}. \lab... | glaive | [
0.03357688710093498,
0.039852987974882126,
-0.05400291457772255,
-0.025587107986211777,
0.0610819049179554,
-0.024517476558685303,
-0.02551308646798134,
0.07710590213537216,
0.048959340900182724,
0.0032606390304863453,
0.02344498783349991,
0.04337301850318909,
-0.044078659266233444,
-0.001... | 0.820395 | 0.78497 | 0.035425 |
I have used Project Euler's Problem #12 as a programming exercise to compare my implementations in C, Python, Erlang, and Haskell, and I found that the execution times were highest for Haskell and lowest for C. I have a few questions regarding this:
1. Do Erlang, Python, and Haskell lose speed due to using arbitrary l... | glaive | [
0.01702531799674034,
0.043107207864522934,
-0.014575504697859287,
-0.036313559859991074,
0.02956867776811123,
-0.02482697181403637,
-0.021129803732037544,
0.07404986023902893,
0.038427967578172684,
-0.020280394703149796,
0.003016427159309387,
0.03410448506474495,
-0.0048962729051709175,
-0... | 0.809662 | 0.794069 | 0.015594 |
You are tasked with creating a program that calculates the duration of a given interval in seconds. The program should take into account that not every year consists of 365 days. The input will be a durationClass, and the output should be the interval duration in seconds. | glaive | [
0.0107205705717206,
0.0191299170255661,
-0.03603065013885498,
-0.016996139660477638,
0.03684401884675026,
-0.025501931086182594,
-0.052565935999155045,
0.07196162641048431,
0.054308705031871796,
-0.018693547695875168,
0.042350735515356064,
0.031341176480054855,
-0.027943195775151253,
-0.00... | 0.795482 | 0.773355 | 0.022127 |
I am trying to define a set of real numbers based on certain conditions and need to determine the least upper bound (lub) of the set. The set is defined as follows:
1. S3a: {x : ℝ | x<0}
2. S3b: {x : ℝ | ∃ y : ℚ, x = ↑y}
3. S3c: {x : ℝ | (x+1)^2 < x^2} -- x<-0.5
4. S3d: {x : ℝ | (∃ q : ℚ, x=↑q) ∧ 1 < x ∧ x < 2}
I need... | glaive | [
-0.00973053090274334,
0.032576266676187515,
-0.03622610121965408,
-0.02147521637380123,
0.03846157714724541,
-0.01590155065059662,
-0.02021181210875511,
0.050477366894483566,
0.019674325361847878,
-0.015617385506629944,
0.018310194835066795,
0.027893774211406708,
-0.04620093107223511,
-0.0... | 0.80112 | 0.773617 | 0.027503 |
You are tasked with implementing a CSR (Compressed Sparse Row) storage management structure for BFS (Breadth-First Search) problems using CUDA in C++.
Your task is to create a C++ class `CsrProblem` that manages the storage and processing of BFS problems on a graph using CSR format. The class should include the follow... | glaive | [
0.0013003334170207381,
0.017048606649041176,
-0.04038359224796295,
-0.03909872844815254,
0.022438477724790573,
-0.00927062425762415,
-0.030347952619194984,
0.09588251262903214,
0.05047528073191643,
-0.02675083465874195,
0.023749981075525284,
0.03506096079945564,
0.00605191383510828,
0.0091... | 0.815508 | 0.799012 | 0.016495 |
You are tasked with writing a program that takes in a 3x3 matrix 'a' and a 3-element vector 'b', and then performs the operation 'c = b - a' where 'c' is also a 3x3 matrix. Your program should calculate the difference between each element of 'b' and the corresponding element of 'a', and store the results in 'c'. | glaive | [
0.04150044173002243,
0.016662830486893654,
-0.04358569160103798,
-0.03367337957024574,
0.051439765840768814,
-0.029713625088334084,
-0.03394853696227074,
0.08639577031135559,
0.050119832158088684,
-0.028870441019535065,
0.027169717475771904,
0.04357561841607094,
-0.05160122364759445,
-0.01... | 0.819208 | 0.782196 | 0.037012 |
You are tasked with implementing the Cyrus-Beck algorithm to clip line segments with an arbitrary polygon. The algorithm should first allow the user to construct a polygon by left-clicking the mouse, and then add the last segment by right-clicking. Once the polygon is constructed, the user should be able to add line se... | glaive | [
0.0009607856045477092,
0.02534591034054756,
-0.02750912308692932,
-0.04136660322546959,
0.016254998743534088,
-0.0013448476092889905,
-0.0064352876506745815,
0.06725641340017319,
0.0460023358464241,
-0.013594564981758595,
0.013023292645812035,
0.05244627967476845,
-0.00876598246395588,
-0.... | 0.796251 | 0.776452 | 0.019799 |
You are tasked with implementing a concurrent dining philosophers problem using the given code snippet as a reference. The problem consists of a finite number of philosophers sitting at a table, each with a plate of spaghetti. Between each plate, there is a single fork. The philosophers alternate between thinking and e... | glaive | [
0.008512318134307861,
0.02082149311900139,
-0.002701835473999381,
-0.019149724394083023,
-0.002121400088071823,
-0.0010497719049453735,
-0.011290671303868294,
0.07338769733905792,
0.03721282258629799,
-0.0328056737780571,
0.03369531407952309,
0.04433619976043701,
-0.013440471142530441,
-0.... | 0.808914 | 0.781395 | 0.027518 |
How can I write a Java program to remove duplicate elements from an array and return the number of distinct values? | glaive | [
-0.0012121355393901467,
0.0241705272346735,
-0.03737490996718407,
-0.027577564120292664,
0.030978098511695862,
-0.05127212777733803,
-0.022014642134308815,
0.04463057592511177,
0.03781557083129883,
-0.03951498121023178,
0.016601812094449997,
0.010623474605381489,
-0.03600731119513512,
-0.0... | 0.799122 | 0.784256 | 0.014866 |
You are tasked with creating a program that calculates the probability of a quantum state being in a certain configuration. The program should take into account the number of qubits, the state's name, and the number of possible states. Additionally, the program should use the given `amplitude`, `amplitude2`, and `proba... | glaive | [
-0.004723543766885996,
0.03186258673667908,
-0.026788007467985153,
-0.012623563408851624,
0.043602701276540756,
-0.019139492884278297,
-0.017128191888332367,
0.07795137912034988,
0.02875419333577156,
0.0067363339476287365,
0.024725044146180153,
0.033578697592020035,
-0.013818630948662758,
... | 0.794228 | 0.765308 | 0.02892 |
You are tasked with writing a program using MDX (Multidimensional Expressions) to retrieve the last child of a specified member. The program should return the value of the last child of a given member expression.
Write a function or program that takes a valid MDX expression as input and returns the last child of the ... | glaive | [
0.03705740347504616,
0.023662101477384567,
-0.04088989645242691,
-0.07004470378160477,
0.0341433584690094,
-0.02091677300632,
-0.016178200021386147,
0.07071101665496826,
0.06625938415527344,
0.0017493987688794732,
0.038503412157297134,
0.03323282301425934,
-0.03786580264568329,
-0.01815756... | 0.805386 | 0.784754 | 0.020632 |
You are tasked with implementing a partitioned counter in CUDA for efficient parallel processing. The partitioned counter consists of local counters and a global counter, and supports adding and synchronizing operations.
Your task is to write the CUDA code to implement the following operations for the partitioned coun... | glaive | [
0.028997035697102547,
0.03793635591864586,
-0.018633577972650528,
-0.014630257152020931,
0.009221713058650494,
0.005078079178929329,
-0.02380744181573391,
0.10334024578332901,
0.0466080978512764,
-0.01388584729284048,
0.01750250533223152,
0.03631441667675972,
-0.005022452212870121,
0.01077... | 0.804155 | 0.78364 | 0.020515 |
You are tasked with implementing a function to perform union operation on a list of Finite State Automata (FSAs). The FSAs are represented as a vector of FSAs, and your function should merge them into a single FSA.
The FSAs are represented using the following data structure:
- Each FSA is represented as a list of arcs... | glaive | [
0.03766312822699547,
0.022354034706950188,
-0.030909325927495956,
-0.03066694736480713,
0.02893710881471634,
0.003356238594278693,
-0.021260935813188553,
0.08388841152191162,
0.03535894677042961,
0.01943941041827202,
0.026939041912555695,
0.04692400246858597,
0.004263059236109257,
-0.03022... | 0.817659 | 0.794231 | 0.023428 |
You are tasked with implementing a program that calculates the probability of a quantum state. The amplitude of the state is given by the function `amplitude[x,y]`, and the probability is calculated using the `probability[x, y]` function, where `x` and `y` are input parameters. You need to use the `NMaximize` function ... | glaive | [
-0.0012117766309529543,
0.03403231501579285,
-0.02733176201581955,
-0.015828309580683708,
0.04437875375151634,
-0.012682119384407997,
-0.008348246105015278,
0.06886684149503708,
0.04241746664047241,
0.00830214936286211,
0.027151508256793022,
0.04177111014723778,
-0.009589902125298977,
-0.0... | 0.796954 | 0.769671 | 0.027283 |
You are tasked with implementing a CUDA kernel function that utilizes shared memory to calculate the running average of an input array. The CUDA kernel function should take an array of floating-point numbers as input and modify the array in place to store the running average at each index.
You will need to define the ... | glaive | [
-0.004386266693472862,
0.058861956000328064,
-0.02213379181921482,
-0.032153643667697906,
0.04001849517226219,
-0.018703032284975052,
-0.043330058455467224,
0.08790833503007889,
0.02985917590558529,
-0.024043092504143715,
0.02076186053454876,
0.01725834235548973,
-0.0014754049479961395,
0.... | 0.797641 | 0.778708 | 0.018933 |
You are tasked with implementing a program to calculate the change in entropy for a given process. The change in entropy ($\Delta S$) can be calculated using the formula:
\begin{equation}
\Delta S = \int \frac{đQ_{\mathrm{REV}}}{T}
\end{equation}
Where $đQ_{\mathrm{REV}}$ is the heat exchanged at reversible condition... | glaive | [
0.03117109090089798,
0.023160506039857864,
-0.024058248847723007,
-0.016577132046222687,
0.010317995212972164,
-0.04749484732747078,
-0.040045298635959625,
0.07550350576639175,
0.036888133734464645,
-0.01167633943259716,
0.03751402720808983,
0.019299883395433426,
-0.038889605551958084,
-0.... | 0.806744 | 0.786652 | 0.020092 |
You are tasked with implementing a program to solve a linear system using the finite element method. The program should create a uniform 10x10 mesh on the domain [0,1]^2, generate Gauss point coordinates, initialize a DNN with specific weights and biases, construct a coefficient matrix, define a source function, impose... | glaive | [
0.008858704008162022,
0.01147400215268135,
-0.024038631469011307,
-0.06165473535656929,
0.040135324001312256,
-0.03287505358457565,
-0.01766059175133705,
0.0627608373761177,
0.02914551831781864,
-0.006510941777378321,
0.025065859779715538,
0.044006917625665665,
-0.028403904289007187,
-0.00... | 0.80368 | 0.781756 | 0.021924 |
You are tasked with implementing a lexicographical order for a sigma type in a programming language that supports dependent types, such as Lean. The lexicographical order should relate two elements of a sigma type based on a relation on the index type and a relation for each summand.
The lexicographical order should r... | glaive | [
0.009322088211774826,
0.01961733028292656,
-0.04306549206376076,
-0.035209719091653824,
0.02515745349228382,
-0.011222493834793568,
-0.03491486608982086,
0.062441084533929825,
0.027122974395751953,
-0.012868025340139866,
0.02598162740468979,
0.04490886256098747,
-0.017576150596141815,
-0.0... | 0.821624 | 0.798526 | 0.023098 |
Can you provide a code that can determine the smallest number from three given numbers? | glaive | [
0.008121166378259659,
0.02373775839805603,
-0.029767999425530434,
-0.04005114734172821,
0.04033318907022476,
-0.026738323271274567,
0.0007439623004756868,
0.041306931525468826,
0.029661033302545547,
-0.026366103440523148,
0.031673699617385864,
0.04516930505633354,
-0.042917851358652115,
-0... | 0.801733 | 0.780259 | 0.021474 |
You are tasked with creating a Python program that takes a list of integers as input and returns the sum of all the even numbers in the list.
Write a function called `sum_even_numbers` that takes a list of integers as a parameter and returns the sum of all the even numbers in the list.
For example:
Input: [1, 2, 3, 4... | glaive | [
0.020850662142038345,
0.01708485186100006,
-0.040128979831933975,
-0.052397534251213074,
0.048585742712020874,
-0.022868497297167778,
-0.017238343134522438,
0.02871433086693287,
0.029628558084368706,
-0.017449257895350456,
0.014525121077895164,
0.052829235792160034,
-0.04402288421988487,
-... | 0.806719 | 0.766394 | 0.040325 |
You are tasked with implementing a hash function using the following C++ code structure. The hash function should utilize the BLAKE, BMW, Groestl, JH, Keccak, and Skein hash algorithms to create a unique hash based on the input data. The function should also include logic to handle conditional branches based on certain... | glaive | [
0.02962227165699005,
0.022542566061019897,
-0.007585679646581411,
-0.013329682871699333,
0.027073275297880173,
-0.016143424436450005,
-0.020657038316130638,
0.09796455502510071,
0.04839429631829262,
-0.012910290621221066,
0.00976257398724556,
0.0180855393409729,
-0.009847327135503292,
0.00... | 0.807795 | 0.783538 | 0.024257 |
You are tasked with processing a dataset containing five columns: X, Y, TStamp, Pres., EndPts. The dataset has a DataSize of 88. Each row in the dataset represents a data point with values for X, Y, TStamp, Pres., and EndPts. Your goal is to write a program that reads this dataset and performs the following tasks:
1. C... | glaive | [
0.0029621447902172804,
0.004433230496942997,
-0.04038653150200844,
-0.05405678227543831,
0.04344746097922325,
-0.05686451494693756,
-0.028904346749186516,
0.06234186887741089,
0.05194868892431259,
-0.011806730180978775,
0.031415317207574844,
0.016104666516184807,
-0.0330476388335228,
0.007... | 0.818036 | 0.793949 | 0.024087 |
You are tasked with creating a Kotlin function that validates a hunter's identification number. The hunter number is a string of 8 digits, and it is considered valid if it meets the following criteria:
1. It must consist of 8 digits.
2. All characters in the string must be digits (0-9).
3. The last digit in the string ... | glaive | [
0.007463051937520504,
0.01688803918659687,
-0.01146371103823185,
-0.042581379413604736,
0.03185562416911125,
-0.04042734578251839,
-0.0030701940413564444,
0.04151764139533043,
0.016362732276320457,
-0.02482413873076439,
0.015177041292190552,
0.026113945990800858,
-0.02611982263624668,
-0.0... | 0.822042 | 0.798406 | 0.023636 |
You are tasked with implementing a function to determine if two subsets `S` and `T` of a group `G` are complements. In this context, complements are defined as subsets such that every element of `G` can be written uniquely as a product of an element from `S` and an element from `T`. More formally, the function should d... | glaive | [
0.018243752419948578,
0.03329775854945183,
-0.024847939610481262,
-0.032466329634189606,
0.04840879142284393,
-0.03837001696228981,
0.00993063859641552,
0.07392790913581848,
0.03318117558956146,
-0.02254314534366131,
0.021191341802477837,
0.021014975383877754,
-0.014709707349538803,
-0.017... | 0.817014 | 0.789699 | 0.027315 |
You are tasked with creating a program to calculate the probability distribution for a quantum system with 16 qubits and 4 states. The amplitude of the system is given by the function amplitude[x_, y_], and the probability density is calculated using the function probability[x_, y_]. You need to find the maximum probab... | glaive | [
-0.001379608758725226,
0.021497122943401337,
-0.03584285080432892,
-0.01527942344546318,
0.0520869679749012,
-0.026411117985844612,
-0.027821600437164307,
0.05596359446644783,
0.04359903559088707,
-0.008028153330087662,
0.017972905188798904,
0.03379182890057564,
0.0007348118233494461,
-0.0... | 0.794329 | 0.758958 | 0.035371 |
You are required to write a program in C++ that demonstrates how to swap elements in two vectors using cuarma, a BLAS-like shared library. The program should perform the following steps:
1. Create a backend to specify OpenCL command queues, CPU threads, or CUDA streams.
2. Use the host to swap all odd entries of vector... | glaive | [
0.02990054339170456,
0.03407590836286545,
-0.022228527814149857,
-0.021894579753279686,
0.022276682779192924,
0.01613583229482174,
-0.04827849566936493,
0.09874723106622696,
0.023576324805617332,
-0.036376941949129105,
0.011537402868270874,
0.02252689190208912,
-0.02972058579325676,
-0.005... | 0.805394 | 0.788996 | 0.016397 |
You are tasked with implementing a function to calculate the division and remainder of two natural numbers. The function should take two natural numbers, `x` and `y`, and return the quotient and remainder when `x` is divided by `y`.
Create a function `divAndMod` that takes two natural numbers `x` and `y` as input and ... | glaive | [
0.03051925078034401,
0.030850129202008247,
-0.01638202741742134,
-0.04461095109581947,
0.045989587903022766,
-0.016979264095425606,
-0.014208399690687656,
0.056205447763204575,
0.047602009028196335,
-0.012725193053483963,
0.03264892101287842,
0.03628185763955116,
-0.03211379423737526,
-0.0... | 0.812445 | 0.781721 | 0.030724 |
You are tasked with creating a program to process a series of musical beats and notes. The program should be able to read in a list of beats and notes, and then perform specific actions based on the input. The beats are represented as a series of numbers indicating the time at which the beat occurs, and the notes are r... | glaive | [
0.04501606151461601,
0.027743613347411156,
-0.04927223175764084,
-0.00511607900261879,
0.041088446974754333,
-0.03833300620317459,
-0.023528199642896652,
0.06063704565167427,
0.047918446362018585,
-0.009604246355593204,
0.03511122241616249,
0.02223656140267849,
-0.03720836713910103,
-0.016... | 0.800912 | 0.778567 | 0.022345 |
You are tasked with creating a program that processes a series of beats and notes in a music file. The beats are given as a sequence of time points and the number of notes played at each time point. The notes are given as a sequence of time intervals, with the start and end times, and the pitch of the note.
Create a f... | glaive | [
0.026156872510910034,
0.020881913602352142,
-0.04666296765208244,
-0.007149798795580864,
0.027399422600865364,
-0.034819960594177246,
-0.009489770978689194,
0.06557919085025787,
0.035922154784202576,
-0.008756466209888458,
0.04497670754790306,
0.022067243233323097,
-0.03747425228357315,
0.... | 0.800006 | 0.784016 | 0.01599 |
You are tasked with creating a function to calculate the area of a given shape. The function should take the shape's dimensions as input and return the calculated area. The shapes that need to be supported are rectangles, squares, circles, and triangles. The function should be able to accurately calculate the area for ... | glaive | [
-0.006311776582151651,
0.06317038089036942,
-0.032791867852211,
-0.03718581795692444,
0.04355240613222122,
-0.011881982907652855,
-0.02341880090534687,
0.056659035384655,
0.02953263558447361,
0.0035224133171141148,
0.031343962997198105,
0.04553884640336037,
-0.03471389040350914,
-0.0131765... | 0.771113 | 0.744915 | 0.026198 |
You are tasked with implementing a subroutine to remove the mean value of a given trace in an array. The subroutine should take the biased array, the output array to receive the unbiased data, the number of elements in the input array, and the address where the mean value can be stored as arguments. The mean removal pr... | glaive | [
0.019975360482931137,
0.026135198771953583,
-0.02953142486512661,
-0.036841146647930145,
0.03713477402925491,
-0.04282576963305473,
-0.023451272398233414,
0.06829150766134262,
0.048016708344221115,
0.0002347635745536536,
0.014237944036722183,
0.024520736187696457,
-0.009176135994493961,
0.... | 0.808345 | 0.7875 | 0.020845 |
You are tasked with analyzing a dataset containing linguistic data in the form of Universal Dependencies (UD) for Latin-PROIEL. The dataset includes information on the relations between different parts of speech, specifically focusing on the `aux:pass` relation. Your goal is to create a program that can extract and ana... | glaive | [
0.007497384212911129,
0.02341572195291519,
-0.02695406787097454,
-0.04645393416285515,
0.02316562458872795,
0.0054939924739301205,
-0.0009181955829262733,
0.06136966496706009,
0.03552376106381416,
0.008195645175874233,
0.025249669328331947,
0.02652512490749359,
0.003730669617652893,
0.0072... | 0.804393 | 0.786844 | 0.01755 |
You are tasked with creating a function in Racket that computes the product of a list of numbers and another function that reverses a list. Your task is to implement the `prod` function, which takes a list of numbers as input and returns the product of all the numbers in the list. Additionally, you need to implement th... | glaive | [
0.03981775417923927,
0.040327467024326324,
-0.018046338111162186,
-0.02875424362719059,
0.05229666456580162,
-0.01078329049050808,
-0.019509466364979744,
0.06871693581342697,
0.04068094119429588,
-0.003195843892171979,
-0.0001049481361405924,
0.057380203157663345,
-0.015392112545669079,
-0... | 0.812101 | 0.788353 | 0.023748 |
You are tasked with writing a program in Fortran that tests the shmem_collect32 function. The program should initialize an array of integers, perform a collective operation using shmem_collect32, and then compare the collected array with the expected result. If the collected array does not match the expected array, a f... | glaive | [
0.014982441440224648,
0.021964436396956444,
-0.030905285850167274,
-0.04248911887407303,
0.02972167357802391,
-0.02101724036037922,
-0.016212549060583115,
0.0700274333357811,
0.03679485619068146,
-0.02562885172665119,
0.021821899339556694,
0.044740524142980576,
-0.013819994404911995,
-0.01... | 0.814658 | 0.798945 | 0.015713 |
You are tasked with creating a function in R that calculates the factorial of a given number. The factorial of a non-negative integer n, denoted by n!, is the product of all positive integers less than or equal to n. For example, the factorial of 5 is 5! = 5 * 4 * 3 * 2 * 1 = 120. Your function should take an integer i... | glaive | [
0.027435582131147385,
0.043608158826828,
-0.028883488848805428,
-0.04478320851922035,
0.0482061468064785,
-0.02154461480677128,
-0.018118148669600487,
0.05355251580476761,
0.03688489645719528,
-0.007747342344373465,
-0.00043036616989411414,
0.05623995140194893,
-0.04680962115526199,
-0.019... | 0.797866 | 0.766616 | 0.03125 |
You are tasked with creating a program that includes a function to calculate the area of a circle. The function should take the radius of the circle as an argument and return the area. Additionally, you need to define the main function to prompt the user for the radius, call the area calculation function, and display t... | glaive | [
0.010374127887189388,
0.05310830846428871,
-0.0380423367023468,
-0.028491191565990448,
0.04438301920890808,
-0.017833128571510315,
-0.03359898924827576,
0.043485574424266815,
0.03745834901928902,
0.012043380178511143,
0.013597538694739342,
0.040887583047151566,
-0.03211988881230354,
-0.010... | 0.773591 | 0.753813 | 0.019778 |
You are tasked with implementing a function in Common Lisp that generates subgroups of a given group using a heuristic approach. The function should take a group as input and return all suitable subgroups for further computation. The subgroups should be generated by trying different combinations of powers of the genera... | glaive | [
0.014964415691792965,
0.04765085130929947,
-0.027925929054617882,
-0.0394333079457283,
0.0495755597949028,
-0.03520526364445686,
-0.020491478964686394,
0.03505844995379448,
0.04424403980374336,
-0.012366590090095997,
0.02481301687657833,
0.03885738551616669,
-0.026825997978448868,
-0.02211... | 0.799733 | 0.779163 | 0.02057 |
You are tasked with implementing a function that calculates the canonical correlation between two matrices `x` and `y`. The canonical correlation is a measure of the association between two sets of variables. Your function should take two matrices as input and return a single value representing the canonical correlatio... | glaive | [
0.011529614217579365,
0.03726567327976227,
-0.0470627024769783,
-0.028396083042025566,
0.032722603529691696,
-0.01319434680044651,
-0.030231745913624763,
0.07068927586078644,
0.045876502990722656,
0.005833258852362633,
0.02727760747075081,
0.028993839398026466,
-0.023611655458807945,
0.015... | 0.790332 | 0.766439 | 0.023893 |
You are tasked with implementing a C++ function that can perform various transformations on a 4x4 matrix. The function should be able to translate, rotate, and scale the matrix based on the input parameters. The function should take in a 4x4 matrix and perform the specified transformation, returning the resulting matri... | glaive | [
0.025157533586025238,
0.0333276242017746,
-0.01267466600984335,
-0.03640726953744888,
0.05778965726494789,
-0.014340396970510483,
-0.020662371069192886,
0.09613309055566788,
0.03287958353757858,
0.0016794989351183176,
0.021909967064857483,
0.032902877777814865,
-0.013316201977431774,
-0.00... | 0.790321 | 0.77348 | 0.016842 |
You are tasked with implementing an inclusive prefix sum algorithm using shared memory in CUDA. The inclusive prefix sum, also known as a prefix scan, is an operation that takes an input array and produces an output array where each element is the sum of all the elements before it, including itself.
Your task is to wr... | glaive | [
-0.0022255079820752144,
0.052305299788713455,
-0.008761855773627758,
-0.02435886487364769,
0.029727019369602203,
-0.022729840129613876,
-0.008482792414724827,
0.0817134752869606,
0.042249079793691635,
-0.009937756694853306,
0.022670520469546318,
0.023150993511080742,
-0.004890428390353918,
... | 0.819037 | 0.79199 | 0.027047 |
You are tasked with creating a C++ program that reads a list of file names and displays them in alphabetical order. The program should take a list of file names as input and output the sorted list. You are not allowed to use any built-in sorting functions in C++. | glaive | [
0.02202388271689415,
0.009815086610615253,
-0.01719510182738304,
-0.03282800316810608,
0.023970693349838257,
-0.020579198375344276,
-0.01932964101433754,
0.06618029624223709,
0.030165091156959534,
-0.026631470769643784,
0.017112240195274353,
0.031032327562570572,
-0.03860105946660042,
-0.0... | 0.796382 | 0.781607 | 0.014775 |
You are tasked with implementing a single-block Smith-Waterman (SW) algorithm using CUDA for parallel processing. The algorithm takes two sequences of characters, seq1 and seq2, and their respective lengths len1 and len2, and performs local sequence alignment to find the optimal subsequence alignment. The algorithm sho... | glaive | [
0.012334671802818775,
0.03838741034269333,
-0.02719375491142273,
-0.029534582048654556,
0.03599589318037033,
-0.019093802198767662,
-0.03763153403997421,
0.10132782906293869,
0.04737941175699234,
-0.023979507386684418,
0.027775317430496216,
0.02420366182923317,
0.015633152797818184,
0.0042... | 0.80874 | 0.785848 | 0.022892 |
You are working on a depthNet application in CUDA, and you need to implement a histogram equalization function for processing depth images. The depth field is represented as a 2D array of float values, and you need to perform the following steps in CUDA:
1. Calculate the range of raw depth values in the input image.
2.... | glaive | [
0.010613149031996727,
0.011190514080226421,
-0.024555513635277748,
-0.02795172482728958,
0.02913537248969078,
-0.015357263386249542,
-0.012684435583651066,
0.08800869435071945,
0.051597606390714645,
-0.026766996830701828,
0.03445734456181526,
0.024059880524873734,
-0.003978748805820942,
-0... | 0.789366 | 0.773308 | 0.016058 |
Can you provide a program that can determine if there are any duplicates in an array of integers? | glaive | [
0.019043313339352608,
0.02348364144563675,
-0.03607723116874695,
-0.017666907981038094,
0.028471462428569794,
-0.033428166061639786,
-0.007503174245357513,
0.06696177273988724,
0.032629966735839844,
-0.05420665815472603,
0.020416319370269775,
0.010703017935156822,
-0.033415086567401886,
-0... | 0.805223 | 0.784472 | 0.020751 |
How can I sort the following array [135, 781, 79, 6, 903, 5] in ascending order using the radix sort algorithm? | glaive | [
0.022905120626091957,
0.0345960296690464,
-0.003010823857039213,
-0.029340235516428947,
0.011124171316623688,
-0.039189551025629044,
-0.020818766206502914,
0.03959525376558304,
0.022828275337815285,
-0.008354904130101204,
0.015794727951288223,
0.013824183493852615,
-0.05770979821681976,
-0... | 0.827358 | 0.779501 | 0.047857 |
You are asked to create a program that calculates the number of days in a given month of a specific year. The program should take the year and the month as input and output the number of days in that month.
For example, when the program is given the year 2001 and the month July (represented by the integer 7), the outp... | glaive | [
0.027159884572029114,
0.021167945116758347,
-0.06207391247153282,
-0.0421607680618763,
0.042308345437049866,
-0.05349579453468323,
-0.028876906260848045,
0.06455633044242859,
0.02825833298265934,
-0.0067674764432013035,
-0.001160869374871254,
0.044084303081035614,
-0.03470323607325554,
-0.... | 0.790133 | 0.761738 | 0.028396 |
You are tasked with writing a MIPS assembly program that performs a series of operations based on the given code snippet. The program should execute the following instructions in sequence:
1. Set register $2 to the value 0xffff
2. Bitwise OR immediate, adding the value 0xfffe to register $2
3. Branch and link if greate... | glaive | [
0.03389923274517059,
0.024783167988061905,
-0.014973132871091366,
-0.021028393879532814,
0.02636575512588024,
-0.035836707800626755,
-0.02156432531774044,
0.067703478038311,
0.05214958265423775,
0.0034346398897469044,
0.030160771682858467,
0.02465149015188217,
-0.034378938376903534,
-0.013... | 0.811734 | 0.78533 | 0.026404 |
How can I construct a program that takes an array of strings and an integer value k and outputs the k-th most frequent string? | glaive | [
0.009382210671901703,
0.040190186351537704,
-0.030533090233802795,
-0.028625866398215294,
0.03792782127857208,
-0.04822605103254318,
-0.022468339651823044,
0.04543469846248627,
0.019779371097683907,
-0.031596988439559937,
0.03234768286347389,
0.03250940889120102,
-0.04093030095100403,
-0.0... | 0.81796 | 0.799214 | 0.018746 |
Write a Fortran subroutine that takes as input a unitary M-by-N complex matrix Q_in and performs Householder Reconstruction (HR) to reconstruct Householder vectors V(i) implicitly representing another M-by-N matrix Q_out. The Householder vectors (columns V(i) of V) are to be stored in the input matrix A, and the diagon... | glaive | [
0.02679014578461647,
0.04902464896440506,
-0.02382538467645645,
-0.0297926627099514,
0.04107053577899933,
-0.0040182629600167274,
0.0031610005535185337,
0.05640526860952377,
0.04178720712661743,
-0.0038638021796941757,
0.0249494481831789,
0.05365800857543945,
-0.010983496904373169,
-0.0063... | 0.811202 | 0.791296 | 0.019906 |
You are tasked with creating a program in Dart that calculates 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. Your program should include a function called `fib` that takes an integer `n` as input and return... | glaive | [
0.005381310358643532,
0.02519867569208145,
-0.015187383629381657,
-0.03782092034816742,
0.035814717411994934,
-0.023589875549077988,
-0.04045527055859566,
0.060241375118494034,
0.018006950616836548,
-0.012873757630586624,
0.03502213954925537,
0.04009159654378891,
-0.03205128386616707,
0.00... | 0.809351 | 0.775388 | 0.033964 |
You are tasked with creating a Java program to collect and store agent statistics in a distributed system. The agent statistics are represented in the given Thrift data structure, which includes information about the agent, JVM, GC, CPU load, transactions, active traces, response time, deadlock, file descriptors, direc... | glaive | [
0.011213432066142559,
0.0114391865208745,
-0.03031671792268753,
-0.031426284462213516,
0.03139447420835495,
-0.03282330930233002,
-0.014321830123662949,
0.033947430551052094,
0.037237394601106644,
-0.010968620888888836,
0.013306669890880585,
0.022508975118398666,
-0.03992048278450966,
0.00... | 0.803242 | 0.787345 | 0.015897 |
You are tasked with creating a VHDL program for a hardware accelerator that performs unsigned division. The program should take in two input signals, a dividend and a divisor, and produce two output signals, a quotient and a remainder. The program should also have control signals for clock, reset, and start, and a sign... | glaive | [
0.028179718181490898,
0.03038867563009262,
-0.013614144176244736,
-0.018340053036808968,
0.035702191293239594,
-0.00906255841255188,
-0.039609163999557495,
0.09232214838266373,
0.041128769516944885,
-0.03440569341182709,
0.02866225875914097,
0.03160494565963745,
-0.004093749914318323,
-0.0... | 0.793668 | 0.774024 | 0.019644 |
Can you provide an algorithm in Java that can be used to print the elements of a two-dimensional array of integers? | glaive | [
0.0106865419074893,
0.03676820173859596,
-0.030494339764118195,
-0.022812554612755775,
0.02425026148557663,
-0.03727351129055023,
-0.026123063638806343,
0.043211713433265686,
0.03699370101094246,
-0.04260449856519699,
0.026644783094525337,
0.03509902209043503,
-0.0420084223151207,
-0.02157... | 0.798757 | 0.776069 | 0.022689 |
You are working on a statistical analysis tool and need to create a function that returns the column number of a critical value matrix (trend number) for a given trend type. The trend types and their corresponding trend numbers are as follows:
- none: 1
- rconstant: 2
- constant: 3
- rtrend: 4
- trend: 5
Write a progr... | glaive | [
0.0019091337453573942,
0.0227966345846653,
-0.0575791597366333,
-0.04355147108435631,
0.04417755827307701,
-0.0058723329566419125,
-0.03324834257364273,
0.0765223503112793,
0.019959649071097374,
-0.011494826525449753,
0.017329882830381393,
0.039223812520504,
-0.01885247603058815,
0.0089430... | 0.798602 | 0.78024 | 0.018362 |
You are required to implement a CUDA program for a genetic algorithm to solve the 0/1 knapsack problem. The knapsack problem is defined as follows: given a set of items, each with a weight and a value, determine the number of each item to include in a collection so that the total weight is less than or equal to a given... | glaive | [
0.000968802603892982,
0.03384515270590782,
-0.01304200105369091,
-0.008501654490828514,
0.03120744787156582,
-0.006559384521096945,
-0.0331747904419899,
0.08051355928182602,
0.036742571741342545,
-0.019958816468715668,
0.0138537073507905,
0.03430618345737457,
-0.007849359884858131,
0.00955... | 0.811916 | 0.785463 | 0.026452 |
You are given a text file "day01.txt" containing a list of integers separated by new lines. Your task is to write a function to perform the following operations:
part1: Count the number of times the value of an integer increases compared to the previous one in the list.
part2: Count the number of times the sum of thre... | glaive | [
-0.004190823528915644,
0.012358289211988449,
-0.03484804928302765,
-0.04304785653948784,
0.0434890016913414,
-0.025398753583431244,
-0.02542063035070896,
0.07252974808216095,
0.030911697074770927,
-0.015286472626030445,
0.0064462278969585896,
0.007636820897459984,
-0.046205922961235046,
-0... | 0.823176 | 0.795996 | 0.02718 |
Can you provide an algorithm to determine if two given strings are anagrams? | glaive | [
0.018100451678037643,
0.019997870549559593,
-0.014538166113197803,
-0.01922772265970707,
0.018194569274783134,
-0.048485707491636276,
-0.005548130255192518,
0.06070604547858238,
0.031020140275359154,
-0.045800767838954926,
0.01826278306543827,
0.0142494086176157,
-0.02703831158578396,
-0.0... | 0.800394 | 0.78258 | 0.017814 |
You are tasked with creating a Racket program to calculate 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.
Write a function named "calculate-factorial" that takes an integer input n and returns the factorial of n.
For example... | glaive | [
0.031329937279224396,
0.03583068028092384,
-0.027230892330408096,
-0.020298073068261147,
0.047340743243694305,
-0.030373504385352135,
-0.016351567581295967,
0.04610494524240494,
0.04409799352288246,
-0.025173641741275787,
0.01193126942962408,
0.0585661306977272,
-0.04363320395350456,
-0.01... | 0.806536 | 0.772643 | 0.033893 |
You are tasked with creating a program to generate the partial sums of binomial coefficients raised to the power of 2. The binomial coefficient is calculated using the formula C(n, k) = n! / (k! * (n - k)!) where n! is the factorial of n and k! is the factorial of k. The partial sum is obtained by summing the binomial ... | glaive | [
0.013186465948820114,
0.03533394634723663,
-0.04068441689014435,
-0.031670957803726196,
0.02322528511285782,
-0.03856467083096504,
-0.024040579795837402,
0.07217186689376831,
0.04168097302317619,
0.0010215484071522951,
0.037889473140239716,
0.06479877978563309,
-0.04668216034770012,
0.0036... | 0.814687 | 0.766472 | 0.048216 |
Can you provide an algorithm to calculate the mean of a given set of numbers? | glaive | [
0.02460748702287674,
0.019219158217310905,
-0.04036775603890419,
-0.0372367687523365,
0.04019996523857117,
-0.031677380204200745,
-0.031918980181217194,
0.028377249836921692,
0.03143234923481941,
-0.044879745692014694,
0.01850142702460289,
0.02606106549501419,
-0.04534908011555672,
-0.0187... | 0.784119 | 0.760668 | 0.023451 |
You are asked to create a CUDA C++ program that can output matrices and vectors. Your task is to write a program that takes in a string, a matrix or vector, and its dimensions, and then outputs the matrix or vector to the console. The program should be able to handle floating point numbers, integers, and unsigned integ... | glaive | [
0.020086729899048805,
0.03287607803940773,
-0.01451508142054081,
-0.020292555913329124,
0.03699246421456337,
-0.01258451584726572,
-0.04344289377331734,
0.10733085125684738,
0.04881419241428375,
-0.028837986290454865,
0.022765619680285454,
0.04358791932463646,
0.00007820583414286375,
-0.02... | 0.796626 | 0.775004 | 0.021622 |
You are tasked with implementing a CUDA kernel that determines eigenvalues for large matrices for intervals that contained after the first step one eigenvalue. The kernel will take as input the diagonal elements of a symmetric, tridiagonal matrix, the superdiagonal elements of the same matrix, the matrix size, the tota... | glaive | [
0.00754950987175107,
0.04117786884307861,
-0.030454248189926147,
-0.03070078231394291,
0.023349860683083534,
-0.0036454875953495502,
-0.02091514691710472,
0.0817987471818924,
0.035583626478910446,
-0.031177733093500137,
0.028488164767622948,
0.03698078170418739,
-0.019832702353596687,
0.01... | 0.806566 | 0.779346 | 0.02722 |
Can you provide an algorithm to find the nth Fibonacci number? | glaive | [
0.019190413877367973,
0.01160244271159172,
-0.02312648296356201,
-0.03075539320707321,
0.025026174262166023,
-0.032818183302879333,
-0.02956424653530121,
0.041272714734077454,
0.031113458797335625,
-0.02916913852095604,
0.029247643426060677,
0.016919942572712898,
-0.0448591448366642,
-0.02... | 0.795601 | 0.769162 | 0.026439 |
You are tasked with implementing a tree data structure to efficiently solve a combinatorial optimization problem using the Juniper solver in Julia. The tree structure will be used to explore different combinations of variables and their potential solutions. The problem involves defining and structuring various objects ... | glaive | [
-0.013799742795526981,
0.014968011528253555,
-0.04244324937462807,
-0.02483934722840786,
0.021719807758927345,
-0.03053172305226326,
-0.004684721119701862,
0.08993171900510788,
0.0346403531730175,
-0.0027053137309849262,
0.023818260058760643,
0.013782343827188015,
-0.02587442472577095,
0.0... | 0.802491 | 0.777753 | 0.024738 |
How can I find the maximum sum of a subset within an array of integers using Python? | glaive | [
0.01232112292200327,
0.031110133975744247,
-0.025610098615288734,
-0.03138159215450287,
0.04003370180726051,
-0.02498186193406582,
-0.022628670558333397,
0.016668660566210747,
0.025457488372921944,
-0.03442966938018799,
0.028921255841851234,
0.0321408174932003,
-0.04787423461675644,
0.0069... | 0.800397 | 0.776236 | 0.024161 |
You are required to implement a depthwise 2D convolution operation using the given input, weights, bias, and output arrays along with the provided parameters. The operation should support both NHWC and NCHW data formats. The input, weights, and bias arrays are of type NDArray and the output array is also of type NDArra... | glaive | [
0.006563433445990086,
0.015437424182891846,
-0.01742550916969776,
-0.018380554392933846,
0.02337604947388172,
-0.02429872751235962,
-0.02941908687353134,
0.08293961733579636,
0.019332099705934525,
-0.010067603550851345,
0.023919515311717987,
0.016322776675224304,
-0.022378189489245415,
-0.... | 0.804696 | 0.789122 | 0.015574 |
You are tasked with implementing a method in a programming language that allows for the removal of a key and its associated value from a data structure. The method should take two parameters:
- key: the key to be removed
- aBlock: a block of code to be evaluated if the key is not found in the data structure
The method... | glaive | [
0.03968939557671547,
0.04282047972083092,
-0.02721797302365303,
-0.032080020755529404,
0.04089662432670593,
-0.05351351574063301,
0.00027629939722828567,
0.07487089931964874,
0.046234626322984695,
-0.015246793627738953,
0.024947471916675568,
0.005857713520526886,
-0.032374829053878784,
0.0... | 0.806232 | 0.790164 | 0.016069 |
How can I create an array with the values 1, 5, 9, 62, 87 and sort it using AI? | glaive | [
0.02023017406463623,
0.017402689903974533,
-0.012536006979644299,
-0.03396355360746384,
0.037599753588438034,
-0.037485845386981964,
-0.02619141712784767,
0.06422269344329834,
0.028922248631715775,
-0.026455143466591835,
0.018096793442964554,
0.019722985103726387,
-0.04302939772605896,
-0.... | 0.810482 | 0.789396 | 0.021086 |
You are required to create a bouncing line animation program using Python. The program should generate a specified number of points and draw lines between them using the Bresenham line algorithm. The lines should move in different directions and bounce off the walls and corners of the terminal window. The animation sho... | glaive | [
-0.007588654290884733,
0.036131344735622406,
-0.02415190450847149,
-0.03454550728201866,
0.029182791709899902,
-0.02232230082154274,
-0.03375735133886337,
0.060761917382478714,
0.02268105372786522,
-0.01869983971118927,
0.024741249158978462,
0.048037558794021606,
-0.01661055162549019,
0.00... | 0.793699 | 0.778112 | 0.015588 |
You are tasked with processing a dataset containing five columns: X, Y, TStamp, Pres., EndPts. The DataSize is 262. Your goal is to write a program that will read and manipulate this data to perform specific operations. The program should be able to read the dataset, perform calculations, and output the results.
Your ... | glaive | [
0.006830164697021246,
0.012626278214156628,
-0.04282303526997566,
-0.0505104623734951,
0.04015979915857315,
-0.06050247699022293,
-0.030573153868317604,
0.07111930102109909,
0.04976995661854744,
-0.011665299534797668,
0.03830748423933983,
0.02754940651357174,
-0.029765110462903976,
-0.0028... | 0.805947 | 0.791559 | 0.014387 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.