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 finite state machine in VHDL to create a flag generator module. The module should have three input ports: clk (clock signal), reset (reset signal), and a (input signal). The module should also have one output port: z (output signal).
The flag generator should have 8 states (s0-s7) an... | glaive | [
0.035300981253385544,
0.02862449362874031,
-0.021337511017918587,
-0.0426105260848999,
0.025674991309642792,
-0.04771546646952629,
-0.033343203365802765,
0.0846637636423111,
0.024406637996435165,
-0.023650309070944786,
0.03207235783338547,
0.045735277235507965,
-0.008967144414782524,
-0.01... | 0.801213 | 0.786559 | 0.014654 |
You are tasked with creating a program that calculates the probability distribution of a quantum wavefunction and then visualizes it in 3D and 2D plots. The wavefunction is given by the amplitude function, which takes two input variables, x and y. The probability distribution is calculated using the probability functio... | glaive | [
-0.0049326480366289616,
0.02728922851383686,
-0.044899433851242065,
-0.025061823427677155,
0.044150423258543015,
-0.02432897873222828,
-0.029833117499947548,
0.07282231748104095,
0.043839313089847565,
0.015902480110526085,
0.025480831041932106,
0.03764459490776062,
-0.016618821769952774,
-... | 0.798459 | 0.770991 | 0.027468 |
You are tasked with creating a program that calculates the probability of a quantum state given a set of parameters. The program should use the given amplitude function and the number of qubits to calculate the probability and then find the maximum probability using simulated annealing method. Finally, the program shou... | glaive | [
0.007241270504891872,
0.03379599377512932,
-0.03251419588923454,
-0.02231932058930397,
0.040818795561790466,
-0.025616925209760666,
-0.021874981001019478,
0.07282808423042297,
0.030845532193779945,
-0.0077325692400336266,
0.022834306582808495,
0.034945372492074966,
-0.011263744905591011,
-... | 0.798939 | 0.771336 | 0.027603 |
You are tasked with writing a program in a language that supports the 'while' loop with an optional continue expression. The goal is to print out all the powers of 2 from 2 up to 1024. The continue expression should be set in such a way that the loop continues to multiply the variable 'n' by 2 until it reaches 1024, an... | glaive | [
0.01728055812418461,
0.0592733658850193,
-0.02063819020986557,
-0.032393671572208405,
0.02282952331006527,
-0.045399006456136703,
-0.02849668636918068,
0.06425397098064423,
0.05081979185342789,
-0.032260071486234665,
0.026894843205809593,
0.040427301079034805,
-0.0318293534219265,
-0.01006... | 0.816931 | 0.791136 | 0.025796 |
You are tasked with creating a program that calculates the number of arguments for a multi-line function in a given context. Your program should take an integer as input and determine the number of arguments for a multi-line function in the specified context. The program should then announce a setting change based on t... | glaive | [
0.027637282386422157,
0.01792282797396183,
-0.05527399852871895,
-0.014842916280031204,
0.04152202233672142,
-0.02628406696021557,
-0.05179719626903534,
0.06121023744344711,
0.04307234287261963,
-0.015282068401575089,
0.013149963691830635,
0.04697871953248978,
-0.0342804491519928,
-0.01904... | 0.815143 | 0.800658 | 0.014485 |
You are tasked with implementing a function that calculates the value of a sequence using the given formula: a(n) = 2*n - floor(n/r), where r = (1 + sqrt(5))/2 (the golden ratio). The input parameter n represents the position in the sequence and the function should return the value at that position.
Write a function ... | glaive | [
0.029305297881364822,
0.055817611515522,
-0.03458788990974426,
-0.03280605375766754,
0.04896267130970955,
-0.018733669072389603,
-0.03541744500398636,
0.059381384402513504,
0.0360848605632782,
-0.011370822787284851,
0.027803098782896996,
0.03810154274106026,
-0.03928755596280098,
-0.004235... | 0.815825 | 0.772485 | 0.04334 |
I need to write a SAS program to calculate the sum of the squares of the first 100 positive integers and output the result. The program should use an array to store the squares of the numbers and then sum them up to produce the final result. | glaive | [
0.020939087495207787,
0.02008083648979664,
-0.051180217415094376,
-0.043265633285045624,
0.0385378822684288,
-0.030736833810806274,
-0.02051301673054695,
0.052651163190603256,
0.04954016953706741,
-0.018909858539700508,
0.02804376929998398,
0.030751559883356094,
-0.061500418931245804,
-0.0... | 0.80438 | 0.782956 | 0.021424 |
You are tasked with designing a router with buffered outputs (pipeline stage) in VHDL. The router should have the following specifications:
- It should have a generic parameter for the number of ports, X, Y, and Z coordinates, and whether or not the header is included in the packet length.
- It should have input ports... | glaive | [
0.009531624615192413,
0.027200065553188324,
-0.0009122624178417027,
-0.008695729076862335,
0.022564711049199104,
-0.0267360657453537,
-0.024283910170197487,
0.06797362118959427,
0.04232390597462654,
-0.0035499250516295433,
0.034974560141563416,
0.05798079073429108,
0.007223262917250395,
-0... | 0.787593 | 0.772003 | 0.01559 |
You are tasked with creating a program that reads a list of numbers from a file and then calculates the sum of all the numbers in the list. The file contains one number per line, and the program should be able to handle the file of any size. Write a Python program to accomplish this task. | glaive | [
0.0023684133775532246,
0.02673189714550972,
-0.039712026715278625,
-0.06276489049196243,
0.06637153029441833,
-0.02412419207394123,
-0.012176058255136013,
0.03264227509498596,
0.027443181723356247,
-0.01627175509929657,
0.01235356554389,
0.04052598774433136,
-0.045464273542165756,
-0.01434... | 0.794236 | 0.776109 | 0.018126 |
You are tasked with creating a Stan model for testing a Dirichlet process mixed with the beta-binomial distribution. The model should include the following data inputs:
- Nsamp: Number of draws
- Nbin: Number of repetitions
- Nc: DP truncation
- mu: Demanded expectation of DP draws
- x[Nsamp]: Array of counts
Addition... | glaive | [
0.0031769529450684786,
-0.0003932270628865808,
-0.020656390115618706,
-0.042144425213336945,
0.028520915657281876,
-0.020120514556765556,
-0.018093831837177277,
0.062363751232624054,
0.03430434316396713,
-0.001512007089331746,
0.0006969277164898813,
0.052144914865493774,
-0.02277525514364242... | 0.793781 | 0.776007 | 0.017774 |
You are tasked with implementing a subroutine that returns the values of PSI(X) which is the derivative of the natural logarithm of the gamma function, at integer arguments. The subroutine should perform a table look-up for N <= 100, and evaluate the asymptotic expansion for N > 100.
The subroutine should take an inte... | glaive | [
0.0017676986753940582,
0.02368365041911602,
-0.024181095883250237,
-0.026393620297312737,
0.01654004119336605,
-0.041702646762132645,
-0.01072106882929802,
0.04123023897409439,
0.048996664583683014,
-0.0019948596600443125,
0.03506993502378464,
0.02852235734462738,
-0.040449582040309906,
-0... | 0.799179 | 0.778422 | 0.020757 |
You are tasked with implementing a quantum simulation program that calculates the probability amplitudes for a given set of quantum states. The program should be able to find the maximum probability amplitude and generate a 3D plot and a contour plot of the probability function.
The program should include the followin... | glaive | [
0.006984743755310774,
0.030312104150652885,
-0.031029092147946358,
-0.029993968084454536,
0.03549252450466156,
-0.031915146857500076,
-0.01681901142001152,
0.07332704216241837,
0.0311039537191391,
-0.0024353843182325363,
0.028484486043453217,
0.02953614667057991,
-0.027074085548520088,
-0.... | 0.796515 | 0.773733 | 0.022782 |
You are tasked with creating a Clojure function that takes a list of service offers and returns the smallest one based on the amount of vCPUs, RAM, and disk space it offers. The service offers are represented as maps with keys :resource:vcpu, :resource:ram, and :resource:disk, and their corresponding values are integer... | glaive | [
0.0009135300642810762,
0.04410618543624878,
-0.022023646160960197,
-0.04313003644347191,
0.03347427397966385,
-0.020268527790904045,
-0.02857760339975357,
0.05272505804896355,
0.060784537345170975,
-0.0036941256839782,
0.03516599163413048,
0.04041401669383049,
-0.015884358435869217,
-0.012... | 0.808532 | 0.793167 | 0.015366 |
You are tasked with creating a function in a programming language that takes a boolean input and returns a value based on a conditional statement. If the input is true, the function should return the value of a constant integer variable. If the input is false, the function should return the size of a specific data type... | glaive | [
0.01603938639163971,
0.027346212416887283,
-0.060660552233457565,
-0.02692612260580063,
0.04065437987446785,
-0.03270470350980759,
-0.014970699325203896,
0.07344875484704971,
0.038916636258363724,
-0.02551455795764923,
0.024914182722568512,
0.06046939268708229,
-0.010336610488593578,
-0.01... | 0.81253 | 0.792217 | 0.020313 |
You are tasked with creating a program that calculates the probability of a quantum state and then maximizes this probability within a given range. The quantum state is defined by the amplitude and amplitude2 functions, which take two variables x and y. The probability of the quantum state is given by the probability f... | glaive | [
-0.0075233071111142635,
0.03920936584472656,
-0.030702324584126472,
-0.01782790571451187,
0.04147567227482796,
-0.018807537853717804,
-0.022060003131628036,
0.08206354081630707,
0.02997172810137272,
0.006698520854115486,
0.02223813347518444,
0.034499287605285645,
-0.0189258623868227,
-0.01... | 0.804044 | 0.772937 | 0.031107 |
You are tasked with implementing a function in assembly language that decrypts data using the AES-CBC (Cipher Block Chaining) mode of operation. The function `aes_cbcs_1_9_dec_128_vaes_avx512` should take four parameters: a pointer to the input data (`in`), a pointer to the initialization vector (`IV`), a pointer to th... | glaive | [
0.05077032744884491,
0.0408039316534996,
-0.01779942214488983,
-0.028414683416485786,
0.0299631729722023,
-0.03751922398805618,
-0.02597825415432453,
0.07880076766014099,
0.0326494425535202,
0.012032432481646538,
0.024022873491048813,
0.0177867840975523,
-0.013335373252630234,
0.0148639129... | 0.799755 | 0.777635 | 0.02212 |
You are tasked with implementing a binomial mixture model with covariates. The model requires the following data:
- Number of transects (R)
- Number of temporal replications (T)
- Number of sites (nsites)
- Vector of sites (sites)
- Counts (y)
- Covariates: elev, elev2, litter, RH, temp, temp2, gcover, gcover2
- Upper ... | glaive | [
-0.014328381977975368,
-0.00198065722361207,
-0.03289080411195755,
-0.03254052996635437,
0.029556116089224815,
-0.014631899073719978,
-0.022518325597047806,
0.06118939071893692,
0.03809726983308792,
0.01604503206908703,
0.018436964601278305,
0.06014373153448105,
0.0018087067874148488,
0.01... | 0.788129 | 0.772353 | 0.015776 |
You are tasked with creating a Fortran function called w_master_cylinder that calculates the volume of a master cylinder using the given formula:
Volume = π * radius^2 * height
Your function should take in two parameters:
1. radius (real*4): the radius of the cylinder
2. height (real*4): the height of the cylinder
Yo... | glaive | [
0.013535365462303162,
0.03916823863983154,
-0.022286314517259598,
-0.04784367233514786,
0.047740716487169266,
-0.027197454124689102,
-0.0419551320374012,
0.07006647437810898,
0.03701946139335632,
0.01922471821308136,
0.017338953912258148,
0.05971812829375267,
-0.00788209494203329,
-0.01681... | 0.777783 | 0.762415 | 0.015368 |
I want to implement a Cauchy sequence in a programming language. A Cauchy sequence is a sequence of numbers in which the terms become arbitrarily close to each other as the sequence progresses. I need to define a Cauchy sequence data structure and implement the following operations for it:
1. Addition of two Cauchy se... | glaive | [
0.03123694285750389,
0.02013211138546467,
-0.03371579200029373,
-0.025370460003614426,
0.031136982142925262,
-0.01791534014046192,
-0.003875620197504759,
0.08660018444061279,
0.032935258001089096,
-0.016080720350146294,
0.01253050472587347,
0.02358785644173622,
-0.028230393305420876,
-0.00... | 0.816721 | 0.784222 | 0.032499 |
You are tasked with implementing a function that calculates the absolute difference between two sets of pixels. The function should take in two arrays of uint8_t (pix1 and pix2), a static offset, a stride, and the stride multiplied by 3. The goal is to perform the absolute difference calculation using MMX optimized DSP... | glaive | [
0.0045270468108356,
0.04587722197175026,
-0.018472876399755478,
-0.026377800852060318,
0.025604715570807457,
-0.021679723635315895,
-0.03999897465109825,
0.09449463337659836,
0.06520066410303116,
-0.022302933037281036,
0.028758231550455093,
0.010231423191726208,
-0.0403638519346714,
-0.000... | 0.806828 | 0.782534 | 0.024294 |
You are tasked with creating a program that generates a sprite sequence for a game. The sprite should have the following characteristics:
- The sprite should have a width and height of 128 pixels each
- The sprite should have a bounding box with left, right, top, and bottom values
- The sprite should be part of the "De... | glaive | [
-0.013583680614829063,
0.012813440524041653,
0.0007476031896658242,
-0.038804203271865845,
0.036983296275138855,
-0.022468775510787964,
-0.053769443184137344,
0.0906195342540741,
0.03184792771935463,
-0.028366828337311745,
0.04697922617197037,
0.03490143641829491,
-0.024037113413214684,
0.... | 0.779767 | 0.765178 | 0.014589 |
You are tasked with creating a dataset for sparse data using SAS programming language. The dataset should consist of 230 records with the following variables:
- SEED
- PROCEDURE
- COMPLICATION
- AGE_OLD
- AGE_NEW
- AGE
The dataset SPREAD should also be created with the following variables:
- GROUP
- EVENT
- WEIGHT
On... | glaive | [
0.019450778141617775,
0.012493646703660488,
-0.03986164554953575,
-0.04344816505908966,
0.04247681424021721,
-0.02191438525915146,
-0.010153921321034431,
0.06775719672441483,
0.04626331478357315,
0.00599006749689579,
0.027243267744779587,
0.03229101002216339,
-0.011200477369129658,
0.01306... | 0.791147 | 0.776607 | 0.01454 |
You are working on a project that involves parsing and processing a specific type of programming language. You need to implement a function that can evaluate mathematical expressions based on the given syntax rules. The function should be able to handle simple arithmetic operations, such as addition, subtraction, multi... | glaive | [
0.04549642652273178,
0.030404282733798027,
-0.038320817053318024,
-0.04654594510793686,
0.062971331179142,
-0.031230954453349113,
-0.012865050695836544,
0.07401830703020096,
0.05647464841604233,
-0.009604168124496937,
0.0017125896411016583,
0.027992665767669678,
-0.019508905708789825,
-0.0... | 0.797739 | 0.782902 | 0.014837 |
You are tasked with implementing a blur function using SSE2/AVX2 cascade blur. The function takes an input array of 16-bit integers and applies a blur effect to it. The blur effect is determined by a set of parameters provided in the form of an array. The goal is to produce a new array of 16-bit integers that represent... | glaive | [
0.02791828103363514,
0.05345922335982323,
-0.02135487087070942,
-0.014025860466063023,
0.04670092090964317,
-0.004678648430854082,
-0.032374169677495956,
0.09474624693393707,
0.054032109677791595,
-0.009857949800789356,
0.039165060967206955,
0.01969093456864357,
-0.025434371083974838,
-0.0... | 0.801966 | 0.783627 | 0.018339 |
You are tasked with creating a program that calculates the maximum probability of a quantum state and then visualizes the probability distribution.
Create a function that calculates the probability of a quantum state using the given amplitude function and then uses the NMaximize function to find the maximum probabilit... | glaive | [
0.006734043825417757,
0.024116355925798416,
-0.03333258256316185,
-0.028563186526298523,
0.04694495350122452,
-0.01879301853477955,
-0.024154264479875565,
0.07512205094099045,
0.042951542884111404,
0.009563378058373928,
0.02754366770386696,
0.04018917679786682,
-0.010892781428992748,
-0.01... | 0.796526 | 0.780145 | 0.016381 |
You are tasked with creating a program that will read in a text file, count the frequency of each word, and then output the most common words along with their frequencies. The program should prompt the user for the input file, the number of most common words to display, and the output file.
The program should consist ... | glaive | [
0.012130527757108212,
0.013368387706577778,
-0.025607945397496223,
-0.016660301014780998,
0.03410147503018379,
-0.03417592495679855,
-0.03810647502541542,
0.05356829985976219,
0.027768392115831375,
-0.010828469879925251,
0.016567016020417213,
0.01358574815094471,
-0.021896256133913994,
-0.... | 0.801762 | 0.774133 | 0.027629 |
Can you estimate the result of the following code snippet?
```python
x = 5
y = x + 5
z = y / 2
result = z + 2
``` | glaive | [
0.01801176927983761,
0.03342735394835472,
-0.04627533257007599,
-0.029526710510253906,
0.03746268153190613,
-0.01636369340121746,
-0.02449789270758629,
0.057264670729637146,
0.04024380445480347,
-0.03613846376538277,
0.0299106203019619,
0.03300600126385689,
-0.027777409180998802,
-0.010984... | 0.815108 | 0.797087 | 0.018021 |
You are tasked with implementing a program that calculates the dot product of two large arrays in both a CPU and GPU environment. The program must be able to compare the results and calculate the speedup achieved by using the GPU.
The dot product, also known as the scalar product, of two vectors A and B of the same si... | glaive | [
0.007349992170929909,
0.04581527039408684,
-0.03474419564008713,
-0.02785259671509266,
0.034867338836193085,
-0.004279999528080225,
-0.05000445991754532,
0.10077140480279922,
0.03778601065278053,
-0.04405238479375839,
0.011874094605445862,
0.03307897225022316,
-0.006344740744680166,
-0.007... | 0.810765 | 0.781578 | 0.029187 |
You are tasked with implementing a parallelized function in CUDA for updating the positions of particles in a simulation. The function signature should be as follows:
```cpp
extern "C" __global__ void update_particles(float* x, float* y, float* z,
const float* k1x, const float* k1y, const float* k1z,
... | glaive | [
0.004550449550151825,
0.04993416741490364,
-0.007671409752219915,
-0.02261783555150032,
0.02298882231116295,
-0.0023926817812025547,
-0.029750043526291847,
0.08894507586956024,
0.05007092282176018,
-0.019394738599658012,
0.03237956017255783,
0.03823632001876831,
0.005950059741735458,
0.005... | 0.797828 | 0.780115 | 0.017713 |
How can I create an algorithm in Java to find the median of two sorted arrays? | glaive | [
0.008698845282196999,
0.005515969358384609,
-0.04895278811454773,
-0.03268386423587799,
0.012690912932157516,
-0.020706091076135635,
-0.029982073232531548,
0.047032326459884644,
0.019115261733531952,
-0.051426272839307785,
0.025503389537334442,
0.00806619692593813,
-0.03593014180660248,
-0... | 0.791914 | 0.774657 | 0.017257 |
You are tasked with creating an R program to estimate the parameter of a given distribution using the method of moments. The distribution in question is a Pareto distribution, which is defined by the probability density function:
\[f(x;\alpha, \beta) = \alpha\beta^{\alpha}x^{-(\alpha+1)}\]
where \(x > \beta\), and \(\a... | glaive | [
0.011898908764123917,
0.03045588545501232,
-0.03243881091475487,
-0.0359313078224659,
0.0365290604531765,
0.009248904883861542,
-0.019188158214092255,
0.07505818456411362,
0.040704239159822464,
-0.013836676254868507,
0.0012295176275074482,
0.053499165922403336,
-0.025366555899381638,
0.006... | 0.795904 | 0.775286 | 0.020618 |
You are tasked with creating a function that checks for prime numbers and performs various operations based on the given input. Your goal is to implement the following exercises using the provided code snippet as a reference:
Exercise 1: Based on the proof of Conjecture 2, determine if a given number n is prime and ca... | glaive | [
0.040885742753744125,
0.04556984826922417,
0.0050082728266716,
-0.02380223199725151,
0.04032774269580841,
-0.0379764661192894,
0.004258978646248579,
0.05760936439037323,
0.03761279582977295,
-0.0003238959761802107,
0.017079772427678108,
0.019293153658509254,
-0.028921691700816154,
-0.01826... | 0.811279 | 0.778645 | 0.032634 |
You are tasked with creating a Stan programming model to estimate parameters using Bayesian inference. The data provided includes a single real number 'a', a vector of length 3 'b', an array of length 7 'c', and a 8x9 matrix 'd'. The parameters to be estimated are a real number 'y', another real number 'e', a vector of... | glaive | [
0.03235577791929245,
0.012175017967820168,
-0.03883807361125946,
-0.04876851662993431,
0.03390742093324661,
-0.02647584304213524,
-0.013387752696871758,
0.059624962508678436,
0.0424371175467968,
-0.013052745722234249,
0.002271418459713459,
0.053641725331544876,
-0.01763251982629299,
0.0158... | 0.791386 | 0.77441 | 0.016975 |
You are tasked with writing a program in F# to implement a function that checks for redundant parentheses in a given pattern. Redundant parentheses are defined as any parentheses that do not change the order of operations in the pattern. Your function should take a pattern as input and return true if any redundant pare... | glaive | [
0.025183070451021194,
0.03957521542906761,
-0.01694231852889061,
-0.02909846045076847,
0.04309314861893654,
-0.004611142445355654,
0.023828046396374702,
0.08698078244924545,
0.046009741723537445,
-0.018083816394209862,
0.0029166145250201225,
0.018316593021154404,
-0.025335045531392097,
-0.... | 0.80869 | 0.789218 | 0.019472 |
You are required to write a program to calculate the value of the sequence defined by the formula: n(n-1)(n-2)/19. The program should take an input n and output the corresponding value of the sequence. For example, if n=5, the output should be 1. If n=10, the output should be 26. | glaive | [
0.022530175745487213,
0.03626689687371254,
-0.0521194227039814,
-0.03374885022640228,
0.03490334749221802,
-0.02719779871404171,
-0.03451573848724365,
0.06929118931293488,
0.03225889056921005,
-0.017595957964658737,
0.034452885389328,
0.045921795070171356,
-0.05159031227231026,
-0.01294481... | 0.824595 | 0.778309 | 0.046286 |
Write a program that defines a 3x3 matrix of size 2x2 and performs the following operations:
1. Multiply each element of the matrix x with the corresponding element of matrix y, and store the result in matrix x.
2. Multiply the first row of matrix x with the first row of matrix y, and store the result in the first row ... | glaive | [
0.04763469845056534,
0.04594823718070984,
-0.02568560652434826,
-0.03679751232266426,
0.04831426218152046,
-0.018214065581560135,
-0.022363649681210518,
0.07717378437519073,
0.032265253365039825,
-0.019501566886901855,
0.016771461814641953,
0.030807793140411377,
-0.04616878181695938,
-0.03... | 0.810753 | 0.773357 | 0.037396 |
You are tasked with implementing a program that calculates the probability distribution for a quantum state given by the function `probability[x, y]`. The function takes two input variables `x` and `y`, and returns the absolute square of the complex amplitude defined by the function `amplitude[x_,y_]`. Your program sho... | glaive | [
-0.0013264312874525785,
0.027451522648334503,
-0.03591914102435112,
-0.029696650803089142,
0.03825673088431358,
-0.016589131206274033,
-0.013299205340445042,
0.06628023833036423,
0.04991747438907623,
0.006534019019454718,
0.02637402154505253,
0.041634757071733475,
-0.014115852303802967,
-0... | 0.801229 | 0.777529 | 0.0237 |
You are tasked with creating a program that will find the vertices of a given graph. The graph is represented using an adjacency list. Your program should take in the adjacency list as input and output the vertices of the graph.
The adjacency list is a collection of lists or arrays, where each list represents the set ... | glaive | [
0.03357143700122833,
0.03366545960307121,
-0.01645263284444809,
-0.019813580438494682,
0.010803911834955215,
-0.022175811231136322,
-0.030863072723150253,
0.03910861536860466,
0.03827652335166931,
-0.015004762448370457,
0.021124105900526047,
0.02054787427186966,
-0.020828478038311005,
0.00... | 0.811235 | 0.758693 | 0.052542 |
You are working with a table named t2 in a SQLite database. The table t2 has two columns: a and b. Your task is to write a SQL query to perform window functions on the table t2. You need to achieve the following tasks:
1. Calculate the maximum value of column b using the window function.
2. Calculate the minimum value ... | glaive | [
0.03877545893192291,
0.03032270446419716,
-0.0329788438975811,
-0.015594393014907837,
0.02479855716228485,
-0.03955269604921341,
-0.048260755836963654,
0.053605470806360245,
0.041061099618673325,
0.0161814596503973,
0.03736288100481033,
0.023516861721873283,
-0.023410318419337273,
0.029076... | 0.805632 | 0.779166 | 0.026466 |
You are tasked with implementing a Prolog program that emulates a discrete probability distribution using the provided predicates. The program should include the following distributions:
- uniform: Emulates a uniform discrete distribution where P(I) = 1/N for I in {1,2,...,N}
- binomial: Emulates a binomial distributio... | glaive | [
-0.012853667140007019,
0.010469413362443447,
-0.028107963502407074,
-0.04198996350169182,
0.032995402812957764,
-0.01696261577308178,
-0.008130263537168503,
0.0365249328315258,
0.039369359612464905,
0.002695698756724596,
0.029420306906104088,
0.05219796299934387,
-0.005554785020649433,
0.0... | 0.799554 | 0.771797 | 0.027757 |
:
You are tasked with creating a program that takes an input integer N and displays the multiplication table of N up to 10 in a list. The program should have a form with a label, an edit box to input the integer, a button to trigger the calculation, and a list box to display the results.
You need to write the code for... | glaive | [
0.036108989268541336,
0.03212869167327881,
-0.026782456785440445,
-0.03733799606561661,
0.059157464653253555,
-0.03241569548845291,
-0.02576976828277111,
0.08334757387638092,
0.04262065142393112,
-0.015424562618136406,
0.029179923236370087,
0.050761252641677856,
-0.04785096272826195,
-0.02... | 0.816685 | 0.792541 | 0.024144 |
You are tasked with creating a program that calculates the number of integral points in a certain sequence of open quadrilaterals. The sequence is defined by the following pattern:
0, 0, 1, 3, 6, 9, 13, 18, 24, 31, 39, 47, 56, 66, 77, 89, 102, 115, 129, 144, 160, 177, 195, 213, 232, 252, 273, 295, 318, 341, 365, 390, 4... | glaive | [
0.015782911330461502,
0.03310203179717064,
-0.026432204991579056,
-0.03742145374417305,
0.022720826789736748,
-0.018735278397798538,
-0.024897195398807526,
0.048617880791425705,
0.04059530049562454,
-0.0033858525566756725,
0.01570063829421997,
0.035826750099658966,
-0.039560627192258835,
-... | 0.816239 | 0.751937 | 0.064301 |
You are tasked with implementing a statistical model in Stan for analyzing binary outcome data with multiple predictors. The data consists of N observations, each with a binary outcome y[n] and D predictors x[n, d]. The predictors are categorical and take values from 1 to MAX_LEVEL. Additionally, you have the number of... | glaive | [
0.026754159480333328,
0.011771519668400288,
-0.04652431234717369,
-0.048179082572460175,
0.03298134729266167,
-0.0148055050522089,
-0.020489893853664398,
0.0728066936135292,
0.0475127175450325,
-0.010410018265247345,
0.005535324569791555,
0.05291656777262688,
-0.0228639617562294,
0.0148473... | 0.787943 | 0.771739 | 0.016204 |
You are tasked with implementing a function in a programming language that can perform numerical integration using the given parameters. The function should take in the following inputs:
- `real x`: a real number
- `real xc`: a real number
- `real[] theta`: an array of real numbers
- `real[] x_r`: an array of real numb... | glaive | [
0.0289139486849308,
0.03996856510639191,
-0.03317047283053398,
-0.04141215234994888,
0.03996383026242256,
-0.017066413536667824,
-0.007775189355015755,
0.05384300276637077,
0.06352423876523972,
-0.014824612066149712,
0.01817106083035469,
0.02407989837229252,
-0.015354162082076073,
-0.02307... | 0.799032 | 0.761564 | 0.037468 |
Can you suggest a program that can find the sum of a contiguous subarray within a one-dimensional array of numbers, where the subarray has the largest sum? | glaive | [
0.006295015104115009,
0.03959931805729866,
-0.04497349262237549,
-0.03721192479133606,
0.03894834220409393,
-0.007087069097906351,
-0.02514377236366272,
0.047448206692934036,
0.029270758852362633,
-0.028234947472810745,
0.02163867838680744,
0.04033100977540016,
-0.04746606573462486,
-0.007... | 0.811688 | 0.78224 | 0.029448 |
You are tasked with creating a function in C that calculates the logarithm base of a given number. You need to define a function called 'logb' that takes in two parameters - a floating-point number 'x' and a floating-point number 'base'. The function should return the logarithm of 'x' with the given 'base'. You are not... | glaive | [
0.019613325595855713,
0.048992156982421875,
-0.048072438687086105,
-0.037567608058452606,
0.03875908628106117,
-0.03336229920387268,
-0.019896600395441055,
0.06504450738430023,
0.031474605202674866,
-0.029833270236849785,
0.029859302565455437,
0.036938272416591644,
-0.041681572794914246,
-... | 0.786165 | 0.761049 | 0.025116 |
You are tasked with implementing a program that can read a series of characters and perform specific actions based on the characters encountered. The characters can include D, S, A, W, C, and others.
Your program should be able to process the characters and perform the following actions:
- Move in different direction... | glaive | [
0.031747374683618546,
0.021458206698298454,
-0.019001232460141182,
-0.036862149834632874,
0.03668465465307236,
-0.03375165909528732,
-0.0074831899255514145,
0.05921976640820503,
0.054178088903427124,
-0.018177306279540062,
0.0339483805000782,
0.04154398292303085,
-0.01679261401295662,
-0.0... | 0.814291 | 0.796496 | 0.017794 |
You are tasked with creating a module in Elm that can generate random vectors in 3D space based on spherical coordinates. The module should include a function that can generate a random vector with a given length, as well as a function that can generate multiple random vectors with the same length. The random vectors s... | glaive | [
0.005537061952054501,
0.036736730486154556,
-0.0009334717760793865,
-0.03798641264438629,
0.021006956696510315,
-0.02803197130560875,
-0.042558133602142334,
0.03616976737976074,
0.033329542726278305,
-0.022726666182279587,
0.01571977697312832,
0.056916579604148865,
-0.013397627510130405,
-... | 0.794848 | 0.77915 | 0.015697 |
You are tasked with writing a program that calculates the values in the sequence A133700. The sequence is defined as follows:
a(n) = Sum_{d|n} A001227(d)
Where A001227 is another sequence of numbers.
Write a program that takes an input n and calculates the value of a(n) using the formula provided. You should use the f... | glaive | [
0.032890163362026215,
0.02999390847980976,
-0.027728356420993805,
-0.022357527166604996,
0.028783442452549934,
-0.029136888682842255,
-0.021958624944090843,
0.05783383920788765,
0.02585544064640999,
-0.02391985058784485,
0.02874789945781231,
0.04666149243712425,
-0.0469728447496891,
-0.004... | 0.82065 | 0.772689 | 0.047961 |
You are tasked with implementing a CUDA kernel function to perform element-wise matrix addition on a GPU. The function signature is as follows:
```c
int DLGpuMatrixElementwiseAdd(const DLArrayHandle matA,
const DLArrayHandle matB, DLArrayHandle output)
```
Where `matA` and `matB` are input... | glaive | [
0.009279428981244564,
0.043305326253175735,
-0.01087777130305767,
-0.025272231549024582,
0.035901617258787155,
-0.007280849851667881,
-0.02047848142683506,
0.10707049071788788,
0.04879620671272278,
-0.016784420236945152,
0.028042960911989212,
0.04074753075838089,
-0.013011129572987556,
-0.... | 0.799642 | 0.781857 | 0.017786 |
You are tasked with implementing a function in the Clojure programming language that calculates the total number of red shapes in a given list. Each shape is represented as a map with various attributes, including a "state" attribute that can be either "on" or "off". The function should take a list of shapes as input a... | glaive | [
-0.004502540919929743,
0.04586352780461311,
-0.04679183289408684,
-0.04040079936385155,
0.03912780433893204,
-0.02049230970442295,
-0.02598663978278637,
0.051008544862270355,
0.030071353539824486,
-0.015258347615599632,
0.01982862874865532,
0.03311210125684738,
-0.014597938396036625,
-0.02... | 0.81263 | 0.782516 | 0.030113 |
You are tasked with creating a program that retrieves the names of students who have scored more than 75 marks in a given dataset. The program should then sort the names based on the last three characters of each name and in ascending order by the student ID. | glaive | [
0.03860566392540932,
0.005583680234849453,
-0.03061976470053196,
-0.05199742317199707,
0.009053092449903488,
-0.030176114290952682,
-0.02453281730413437,
0.024760808795690536,
0.0248014647513628,
-0.011896122246980667,
0.024738995358347893,
0.020048918202519417,
-0.04472796618938446,
0.006... | 0.810627 | 0.783275 | 0.027352 |
You are tasked with implementing a CUDA kernel for matrix multiplication. Your task is to write a program that takes two input matrices (A and B) of size n x n and computes their product, storing the result in matrix C. The CUDA kernel should be designed to perform this matrix multiplication on the GPU.
Your program s... | glaive | [
0.012249394319951534,
0.0514281764626503,
-0.025426365435123444,
-0.023971009999513626,
0.037851911038160324,
0.0002067170134978369,
-0.028404980897903442,
0.09790471196174622,
0.04106680676341057,
-0.026143839582800865,
0.01747625134885311,
0.032502416521310806,
-0.011890200898051262,
-0.... | 0.79797 | 0.780372 | 0.017598 |
You are tasked with creating a program that tests if-elseif-else statements and outputs a message based on the comparison of two real numbers. The program should initialize the following variables:
- a boolean variable "a" set to True
- a real number variable "x" set to 9.0
- a real number variable "y" set to 9.0
The ... | glaive | [
-0.0010846747318282723,
0.009890003129839897,
-0.03530275821685791,
-0.03701823204755783,
0.03299090266227722,
-0.025673123076558113,
-0.0004008658288512379,
0.09835854917764664,
0.051324836909770966,
-0.041085969656705856,
0.027528226375579834,
0.030799981206655502,
-0.04187260940670967,
... | 0.810947 | 0.796653 | 0.014294 |
You are tasked with implementing a CUDA kernel function to build a binary matrix from an array of integers and a given set of features. The input parameters for this problem are:
- n_ints: The number of integers in the input array
- n_feats: The number of features in the output matrix
- lens: An array of integers repre... | glaive | [
0.005057097878307104,
0.052794668823480606,
-0.0165800042450428,
-0.01843331754207611,
0.04121236503124237,
-0.020307183265686035,
-0.03807995468378067,
0.08680696785449982,
0.04919658973813057,
-0.01813073828816414,
0.02201121114194393,
0.03228159621357918,
-0.01674564927816391,
0.0010760... | 0.796714 | 0.764066 | 0.032648 |
You are tasked with creating a function to convert a list of tuples to an associative list. The input will be a default value, a key, and a list of tuples. Your function should search for the key in the list of tuples and return the associated value, or the default value if the key is not found. If the key is found, re... | glaive | [
0.03698071092367172,
0.04019029065966606,
-0.03250491991639137,
-0.03325824439525604,
0.03285301476716995,
-0.03371527045965195,
0.007095950655639172,
0.03268708661198616,
0.026350146159529686,
-0.012025565840303898,
0.015618305653333664,
0.02464759349822998,
-0.015851639211177826,
0.01655... | 0.801089 | 0.781895 | 0.019194 |
You are tasked with creating a program that calculates the "name scores" of a list of names. The name score is calculated by summing the numerical values of the letters in the name, where 'A' is worth 1, 'B' is worth 2, and so on. For example, the name "COLIN" would have a score of 3 + 15 + 12 + 9 + 14 = 53.
Your pro... | glaive | [
0.004313945304602385,
0.0180240236222744,
-0.02706494741141796,
-0.0254001934081316,
0.030363457277417183,
-0.04299449920654297,
-0.009612629190087318,
0.03210420534014702,
0.025567850098013878,
-0.009909102693200111,
0.020928295329213142,
0.027118004858493805,
-0.047365326434373856,
-0.00... | 0.80929 | 0.773562 | 0.035728 |
Write a program to find all positive integers that have more base-11 runs of even length than odd. A base-11 run is a sequence of consecutive digits in the base-11 representation of a number. For example, in the base-11 representation of the number 1452, the runs are 4, 5, and 2. Your program should output all such pos... | glaive | [
0.040253881365060806,
-0.01224181056022644,
-0.026430482044816017,
-0.03725491091609001,
0.030284078791737556,
-0.034191008657217026,
-0.022106528282165527,
0.05205047130584717,
0.04514598101377487,
-0.017434794455766678,
0.006485593505203724,
0.04024120047688484,
-0.05183463543653488,
-0.... | 0.817089 | 0.786209 | 0.03088 |
You are tasked with implementing a function that compares two finite sets in a specific order known as the colex ordering. The colex ordering is based on the sum of powers of 2 for the elements in the sets. Your task is to write a function that takes two sets and determines if one is less than the other in the colex or... | glaive | [
0.017867151647806168,
0.02917713113129139,
-0.03313926234841347,
-0.021171187981963158,
0.03190998360514641,
-0.012862207368016243,
-0.02236047573387623,
0.07559723407030106,
0.047606322914361954,
-0.010011001490056515,
0.02329990640282631,
0.03199119120836258,
-0.016177523881196976,
0.015... | 0.824799 | 0.795704 | 0.029095 |
You are tasked with creating a program to simulate a game of chess. Your program should be able to display the initial chessboard, accept moves from the players, validate the moves, and update the chessboard accordingly. You should also implement the logic for different pieces (e.g., pawn, rook, knight) and their movem... | glaive | [
0.021406639367341995,
0.010949104093015194,
-0.027424629777669907,
-0.03733862191438675,
0.029446449130773544,
-0.03230464085936546,
-0.022759392857551575,
0.05193439498543739,
0.04063577577471733,
-0.057164017111063004,
0.04147447645664215,
0.0314394049346447,
-0.038646068423986435,
-0.00... | 0.776832 | 0.759132 | 0.0177 |
You are tasked with implementing a function to extract specific elements from a point cloud based on a given mask. The function should take in a point cloud, a mask, and an output point cloud, and return the elements from the input point cloud that correspond to non-zero values in the mask. The point cloud is represent... | glaive | [
0.038523223251104355,
0.024628296494483948,
-0.029310697689652443,
-0.04703355208039284,
0.033934514969587326,
-0.03939050808548927,
-0.027302760630846024,
0.09522310644388199,
0.04831572622060776,
-0.009903420694172382,
0.02091938816010952,
0.0422293022274971,
-0.006872456055134535,
0.003... | 0.808151 | 0.793446 | 0.014705 |
You are tasked with creating a program to calculate the probability of a quantum state. The amplitude of the state is given by the function amplitude(x, y), and the probability of the state is given by the function probability(x, y). You need to find the maximum probability for the given quantum state and then plot the... | glaive | [
-0.003386416705325246,
0.03784659877419472,
-0.027426093816757202,
-0.024726254865527153,
0.03723185509443283,
-0.021456243470311165,
-0.01850806549191475,
0.0792432576417923,
0.04164392873644829,
0.012229425832629204,
0.028290780261158943,
0.03434376418590546,
-0.018764054402709007,
-0.01... | 0.799005 | 0.76824 | 0.030764 |
You are required to implement a CUDA kernel function for sampling. The function should take in a 3D tensor of points and return a subset of these points based on a specific algorithm. The input tensor 'points' has the shape (B, N1, 3), where B is the batch size, N1 is the number of points, and 3 represents the x, y, z ... | glaive | [
0.009500515647232533,
0.04120050370693207,
-0.034250810742378235,
-0.01968301460146904,
0.02452523447573185,
-0.019041011109948158,
-0.02456619217991829,
0.06697363406419754,
0.03448783606290817,
-0.006539861671626568,
0.030946239829063416,
0.047804541885852814,
-0.008484667167067528,
0.01... | 0.805413 | 0.784835 | 0.020578 |
You are given the task to implement a program to generate a Pisot sequence. A Pisot sequence is defined by the recursive formula a(n) = floor(a(n-1)^2/a(n-2)), where a(0) and a(1) are initial values provided. Your program should take these initial values and generate the sequence up to a given number of terms.
Write a... | glaive | [
0.010501324199140072,
0.024958407506346703,
-0.014027934521436691,
-0.02277395687997341,
0.02418297529220581,
-0.031026341021060944,
-0.024117857217788696,
0.06230097636580467,
0.02611423283815384,
-0.025039037689566612,
0.030664904043078423,
0.04104737564921379,
-0.048931557685136795,
0.0... | 0.818814 | 0.770506 | 0.048308 |
How can an AI find the maximum sum of a contiguous subarray in a given array of integers using Python? | glaive | [
0.0214468352496624,
0.02722211927175522,
-0.02359660342335701,
-0.03505467623472214,
0.031411923468112946,
-0.01903003640472889,
-0.027258047834038734,
0.0396316759288311,
0.035573557019233704,
-0.02538803406059742,
0.022393113002181053,
0.0319460853934288,
-0.020748214796185493,
0.0117807... | 0.811577 | 0.793323 | 0.018254 |
You are tasked with creating a module for handling vectors in a functional programming language. The module should include a type class 'Vectors' that extends the 'Num' class and includes the following functions:
- Addition: (+) that takes two vectors of the same type and returns their sum
- Subtraction: (-) that takes... | glaive | [
0.03299323469400406,
0.03133820742368698,
-0.022121794521808624,
-0.028893068432807922,
0.05153922364115715,
-0.025944232940673828,
-0.02201308310031891,
0.04296806827187538,
0.045016851276159286,
-0.023482857272028923,
0.019772380590438843,
0.05153362452983856,
-0.009062664583325386,
0.00... | 0.8073 | 0.778228 | 0.029072 |
You are given a deck of 52 cards, face-down. Your task is to split the deck in half and flip one of the decks, then reinsert it into the other deck so that the cards are alternatingly face up and face down. This process will be repeated n times. Your goal is to write a program that outputs the number of face-up cards a... | glaive | [
0.01641755923628807,
0.01571439579129219,
-0.033474527299404144,
-0.019939543679356575,
0.02120896428823471,
0.0045555830001831055,
-0.02952904812991619,
0.06670686602592468,
0.027022361755371094,
-0.028355691581964493,
0.022708524018526077,
0.033268533647060394,
-0.04588496312499046,
-0.0... | 0.836857 | 0.807933 | 0.028924 |
You are tasked with implementing a subgraph matching (SM) application using CUDA. The goal is to create a function that takes in a graph in Compressed Sparse Row (CSR) format and a query graph, and returns the number of matched subgraphs. The function should also accumulate the elapsed times for all runs and return it ... | glaive | [
0.00710256677120924,
0.015331625007092953,
-0.042106468230485916,
-0.03014802373945713,
0.030743857845664024,
-0.001313749817200005,
-0.04514367878437042,
0.07334087044000626,
0.05026355758309364,
-0.014163780957460403,
0.040031298995018005,
0.03106643445789814,
0.02018735185265541,
-0.001... | 0.815311 | 0.793876 | 0.021435 |
You are tasked with implementing a subroutine PYGRVL, which calculates the GRV 94 L (leading order) parton distribution function set in parametrized form. The subroutine takes in several input parameters (X, Q2) and computes the parton distribution function for various parton types (UV, DV, DEL, UDB, SB, CHM, BOT, GL).... | glaive | [
0.008538800291717052,
0.023008886724710464,
-0.015041247010231018,
-0.04409632831811905,
0.022183390334248543,
-0.0362434983253479,
-0.010774660855531693,
0.05841146782040596,
0.04507901519536972,
-0.007250279653817415,
0.012415985576808453,
0.04029931128025055,
-0.01798374392092228,
0.009... | 0.803286 | 0.78887 | 0.014417 |
You are tasked with implementing the breadth-first search (BFS) algorithm using the GPU. The goal is to perform BFS on a given graph using the CUDA framework. The BFS algorithm starts at a particular vertex and visits all its neighbors, then the neighbors' neighbors, and so on. Your task is to write CUDA code to perfor... | glaive | [
0.0008051494369283319,
0.04076513648033142,
-0.028672631829977036,
-0.027080493047833443,
0.015321612358093262,
-0.018910611048340797,
-0.010984344407916069,
0.08226741850376129,
0.051333148032426834,
-0.017501363530755043,
0.022178752347826958,
0.0233489777892828,
0.015572882257401943,
0.... | 0.796604 | 0.776093 | 0.020511 |
You are tasked with implementing a function to find the maximum subarray sum and the corresponding subarray in a given array of integers. The maximum subarray is defined as the contiguous subarray within the input array that has the largest sum. You should return the maximum sum and the subarray that results in this su... | glaive | [
0.03141050785779953,
0.03331420570611954,
-0.016784196719527245,
-0.04149089381098747,
0.032746367156505585,
-0.003511281218379736,
-0.03381752222776413,
0.05105569586157799,
0.050741083920001984,
-0.009785871021449566,
0.03169412910938263,
0.0370173379778862,
-0.01953657902777195,
-0.0018... | 0.820507 | 0.770275 | 0.050232 |
You are tasked with implementing a SystemC module that contains multiple methods with do-while loops of various data types. Each method has a different local variable declaration and data type, along with different loop conditions and operations within the loop. Your task is to create a SystemC module with the followin... | glaive | [
0.007070890162140131,
0.029316410422325134,
-0.031219767406582832,
-0.03072921372950077,
0.03280727565288544,
-0.04169521480798721,
-0.026041897013783455,
0.09066734462976456,
0.04051399976015091,
-0.015025400556623936,
0.03530527278780937,
0.05426773056387901,
-0.00383954169228673,
-0.005... | 0.801245 | 0.786564 | 0.014681 |
You are required to implement a LU decomposition function in Rust. LU decomposition is a method of decomposing a square matrix into lower and upper triangular matrices. The goal is to factorize a given matrix A into two matrices L and U, such that A = L * U, where L is a lower triangular matrix and U is an upper triang... | glaive | [
0.00763346441090107,
0.0471065491437912,
-0.01652728207409382,
-0.06138677895069122,
0.018077310174703598,
-0.00446557579562068,
-0.019009623676538467,
0.07593630254268646,
0.03401418775320053,
-0.0018062412273138762,
0.030330054461956024,
0.0318170003592968,
-0.014192596077919006,
-0.0251... | 0.807246 | 0.790296 | 0.01695 |
You are tasked with writing a program to solve for the value of variable 'a' in the following equation:
sqrt(4 + sqrt(16 + 16 * a)) + sqrt(1 + sqrt(1 + a)) = 6
You should write a function that takes the value of 'a' as input and returns the value of 'a' when the equation is satisfied. | glaive | [
0.027584610506892204,
0.04992862045764923,
-0.03694780915975571,
-0.039444029331207275,
0.0661734789609909,
-0.024913020431995392,
-0.02663498744368553,
0.07216852158308029,
0.05548878759145737,
-0.014613084495067596,
0.031451378017663956,
0.05227180942893028,
-0.021521974354982376,
-0.030... | 0.817689 | 0.784806 | 0.032883 |
Can you provide a Java program that returns the longest substring without repeating characters? | glaive | [
0.005286095663905144,
0.018605336546897888,
-0.033647287636995316,
-0.0353354774415493,
0.01744951121509075,
-0.03824393451213837,
0.00002477990710758604,
0.025483693927526474,
0.03273668885231018,
-0.0569511242210865,
0.03467850759625435,
0.02540513686835766,
-0.025823507457971573,
-0.009... | 0.800941 | 0.785751 | 0.015189 |
You are required to create a Stata program to calculate Second Generation P-Values (SGPV) and Delta-Gaps. The SGPV algorithm is based on the R-code for sgpvalue.R from the sgpv-package. The program should handle various input scenarios, including variables and large matrices.
The program should include the following f... | glaive | [
-0.0028738228138536215,
0.006903213914483786,
-0.04645764082670212,
-0.04052016884088516,
0.04677259922027588,
-0.020113958045840263,
-0.014347599819302559,
0.0843854621052742,
0.03769021853804588,
-0.013933653943240643,
0.015323711559176445,
0.04072265699505806,
-0.022274194285273552,
0.0... | 0.802507 | 0.782453 | 0.020055 |
You need to implement a function in SML that takes two maps as input and returns a new map that contains the difference between the two input maps based on a given element equivalence function. The difference should be based on the values in the maps, and the resulting map should have keys from the input maps with corr... | glaive | [
0.01702774688601494,
0.007709869183599949,
-0.03061729110777378,
-0.04229993000626564,
0.04833826795220375,
-0.013498414307832718,
-0.02977415733039379,
0.07357465475797653,
0.038162942975759506,
-0.025400813668966293,
0.038457684218883514,
0.03404860943555832,
-0.01599051058292389,
-0.010... | 0.816378 | 0.800901 | 0.015477 |
You are tasked with creating a program to analyze the performance of sports teams in a league. The program should take into account the number of games played by each team, the number of games played per team, the outcome of each game (home win or not), and the team skill levels. The program should also consider the ho... | glaive | [
0.010630850680172443,
0.018831880763173103,
-0.05464840307831764,
-0.03116772696375847,
0.06083756685256958,
-0.010713081806898117,
-0.03380460664629936,
0.05836626514792442,
0.04677053168416023,
-0.021733807399868965,
0.0029216455295681953,
0.05834905803203583,
-0.04271398484706879,
-0.00... | 0.793886 | 0.772534 | 0.021352 |
How can I design an algorithm using a greedy approach to find the minimum number of coins required to achieve a specific value? | glaive | [
-0.008746832609176636,
0.020607488229870796,
-0.009254259057343006,
-0.037482794374227524,
0.017384283244609833,
-0.04111206531524658,
-0.027727710083127022,
0.03520733118057251,
-0.0008126008324325085,
-0.03820907324552536,
0.016087854281067848,
0.02658103033900261,
-0.014782877638936043,
... | 0.801488 | 0.784806 | 0.016681 |
You are tasked with implementing a systematic encoding and decoding system without erasure for a given set of data blocks. The encoding process involves converting the input data blocks into a systematic code, and the decoding process involves recovering the original data blocks from the systematic code. The system sho... | glaive | [
0.027098247781395912,
0.019219418987631798,
-0.011269851587712765,
-0.022667299956083298,
0.04058980569243431,
-0.030417852103710175,
-0.01597127504646778,
0.07979646325111389,
0.027146708220243454,
-0.02352653071284294,
0.028342939913272858,
0.02410472184419632,
-0.01685590296983719,
0.00... | 0.810681 | 0.792748 | 0.017933 |
You are tasked with designing a VHDL program for a Nexys3 FPGA board to control a 4-digit seven-segment display. The program should utilize a 400Hz clock and refresh each digit at a frequency of 100Hz. The display should cycle through the four digits, displaying the corresponding values from input vectors DIGIT0, DIGIT... | glaive | [
0.01921091414988041,
0.02677498757839203,
-0.034782774746418,
-0.0356709323823452,
0.03364367038011551,
-0.028513355180621147,
-0.04116888716816902,
0.06413740664720535,
0.02695617265999317,
-0.003939634654670954,
0.03527600318193436,
0.05678349360823631,
-0.011528665199875832,
0.001949189... | 0.79093 | 0.773732 | 0.017198 |
You are tasked with creating a function in Julia that takes a single integer input n and calculates the maximum area perimeter for a given n-sided polygon. The function should check if the input meets the following criteria: n is a power of 2 and n is greater than or equal to 4. If these conditions are met, the functio... | glaive | [
0.01622486673295498,
0.04487001150846481,
-0.03792048245668411,
-0.03254536911845207,
0.018423981964588165,
-0.012863662093877792,
-0.043388575315475464,
0.06339346617460251,
0.036099184304475784,
0.010393097065389156,
0.010666628368198872,
0.05168342590332031,
-0.014835324138402939,
-0.01... | 0.801038 | 0.760797 | 0.040241 |
You are given the task of implementing a function to find the proper divisor of a given positive integer. A proper divisor of a positive integer n is a positive integer that is less than n and evenly divides n. The function should return the proper divisor of the input integer, or 0 if there is no proper divisor.
Your... | glaive | [
0.037310607731342316,
0.03991098329424858,
-0.027968209236860275,
-0.04284472391009331,
0.042937103658914566,
-0.03397736698389053,
-0.0204217117279768,
0.038676295429468155,
0.05050510913133621,
-0.009090321138501167,
0.03420107439160347,
0.029867442324757576,
-0.019513942301273346,
-0.01... | 0.813367 | 0.795569 | 0.017798 |
You are required to write a program that will sort two vectors, 'key' and 'val' based on the given segments 'seg'. The 'key' vector contains integers, while the 'val' vector contains double precision floating-point numbers. The 'seg' vector contains indices that specify the segments within the 'key' and 'val' vectors. ... | glaive | [
0.02946200780570507,
0.02838743105530739,
-0.027830522507429123,
-0.01663891039788723,
0.018583910539746284,
-0.02382313646376133,
-0.03226662799715996,
0.07657730579376221,
0.030589299276471138,
-0.008800988085567951,
0.02114192768931389,
0.036599960178136826,
-0.019503217190504074,
0.011... | 0.816605 | 0.783844 | 0.032761 |
You are tasked with implementing a 16-level iterative pipeline to perform the square root operation on 32-bit unsigned integers in a hardware description language (HDL) such as Verilog or VHDL. Each iteration of the pipeline involves a specific combinational logic function, which will be deployed 16 times across the pi... | glaive | [
0.010949226096272469,
0.041270170360803604,
-0.031206008046865463,
-0.047667596489191055,
0.04631504788994789,
-0.02793806791305542,
-0.029175395146012306,
0.08013588190078735,
0.04125439375638962,
-0.023646175861358643,
0.0427229106426239,
0.03534390777349472,
-0.012907448224723339,
-0.01... | 0.814367 | 0.790243 | 0.024125 |
You are tasked with creating a program that calculates the probability distribution for a quantum state given a certain number of qubits and states. The program should use the given code snippet as a starting point and should include the following functionalities:
- Define a function to calculate the probability amplit... | glaive | [
-0.0029154035728424788,
0.030158020555973053,
-0.03582301735877991,
-0.013836980797350407,
0.0406663604080677,
-0.01848132163286209,
-0.019908111542463303,
0.06670863926410675,
0.034239452332258224,
0.0029558795504271984,
0.027472402900457382,
0.0341312438249588,
-0.02229549176990986,
-0.0... | 0.792503 | 0.761922 | 0.030581 |
You are tasked with implementing a sheaf of types in a given topological space. A sheaf is a mathematical structure used in topology to study the local behavior of sections of a presheaf. Your goal is to define a structure for a sheaf and implement the necessary functions to satisfy the sheaf condition.
Your task is t... | glaive | [
0.03868100419640541,
0.01300287339836359,
-0.03733983263373375,
-0.027625717222690582,
0.04446381703019142,
-0.013648628257215023,
-0.010204831138253212,
0.0861610621213913,
0.03901747241616249,
-0.00601419061422348,
0.010006256401538849,
0.03614073246717453,
-0.026740068569779396,
0.00616... | 0.797334 | 0.782862 | 0.014472 |
I am working on a game of Go Fish and I need help with a specific problem. During the game, players have to match numbers in their hand with numbers drawn from the deck. I have two arrays of the same size - one represents the numbers in the player's hand, and the other represents the deck numbers randomly drawn for mat... | glaive | [
0.02009141631424427,
0.015611151233315468,
-0.047549057751894,
-0.04038156941533089,
0.04254211485385895,
-0.031074443832039833,
-0.004193022847175598,
0.044501934200525284,
0.030943438410758972,
-0.036617912352085114,
0.013479476794600487,
0.019452152773737907,
-0.016738224774599075,
-0.0... | 0.825336 | 0.800788 | 0.024548 |
You are tasked with creating a program that will read a list of numbers from a file and calculate the average of these numbers. The file will contain one number per line. Your program should be able to handle any number of input values and provide the correct average as output. | glaive | [
0.010987918823957443,
0.020932530984282494,
-0.04179007187485695,
-0.047580964863300323,
0.05939687788486481,
-0.03673164173960686,
-0.02851610630750656,
0.04772680252790451,
0.027006952092051506,
-0.02572488971054554,
0.010183577425777912,
0.021216418594121933,
-0.03401534631848335,
-0.01... | 0.792949 | 0.774298 | 0.018651 |
You are tasked with implementing a set of functions to traverse a binary tree in different orders. The tree is represented as a type 'a node, which can be either Empty or a Node containing a value, a left child, and a right child. You need to implement the following functions:
1. pre_order: Traverse the tree in pre-or... | glaive | [
0.006848611403256655,
0.031792499125003815,
-0.010393669828772545,
-0.049728814512491226,
0.03057124651968479,
-0.02759893424808979,
-0.006013403180986643,
0.05609980598092079,
0.03530138358473778,
0.00992041826248169,
0.039167940616607666,
0.03358718380331993,
-0.02864435501396656,
0.0034... | 0.808549 | 0.782358 | 0.02619 |
You are tasked with implementing a function mpn_addmul_1 that multiplies a limb vector with a limb and adds the result to a second limb vector. The function takes the following input parameters:
- res_ptr: a pointer to the result limb vector
- s1_ptr: a pointer to the first limb vector
- size: the size of the limb vect... | glaive | [
0.011147753335535526,
0.03924966976046562,
0.003347445512190461,
-0.04138677567243576,
0.05934244766831398,
-0.012145917862653732,
-0.021254001185297966,
0.08203721046447754,
0.03273221477866173,
0.010198897682130337,
0.00914700049906969,
0.04076856002211571,
-0.03318960964679718,
-0.00647... | 0.805357 | 0.77682 | 0.028536 |
You are required to implement a function that simulates the Tower of Hanoi problem. The Tower of Hanoi is a mathematical puzzle that consists of three rods and a number of disks of different sizes which can slide onto any rod. The puzzle starts with the disks in a neat stack in ascending order of size on one rod, the s... | glaive | [
0.033516813069581985,
0.016407819464802742,
-0.02890843152999878,
-0.03395689278841019,
0.037245042622089386,
-0.013561747036874294,
-0.02309872768819332,
0.07910410314798355,
0.024059373885393143,
-0.005667982157319784,
0.03163923695683479,
0.024161530658602715,
-0.04979364946484566,
-0.0... | 0.831779 | 0.793064 | 0.038715 |
I need help creating a search algorithm in Python to find an element in a sorted and rotated array. The array is initially sorted in ascending order and then rotated at some pivot point, which is unknown to me beforehand. How can I ensure that my solution can handle duplicate entries and find the element in less than l... | glaive | [
0.003885621204972267,
0.03337426111102104,
-0.03549133241176605,
-0.026069695129990578,
0.007491040509194136,
-0.013887733221054077,
-0.020230025053024292,
0.04576660692691803,
0.005393345374614,
-0.025884181261062622,
0.01536319125443697,
0.0011477804509922862,
-0.02054002322256565,
-0.00... | 0.80717 | 0.79193 | 0.015239 |
You are tasked with implementing a CUDA kernel for resizing an input tensor using nearest neighbor interpolation. The input tensor has dimensions (s1, s2, s3, s4) and the output tensor should have dimensions (d1, d2, d3, d4). The resizing operation should be performed with or without aligning corners, and with specifie... | glaive | [
0.007756792474538088,
0.05415040999650955,
-0.014282025396823883,
-0.03563300520181656,
0.02476135455071926,
0.0034605502150952816,
-0.013161754235625267,
0.07129345089197159,
0.041780781000852585,
-0.013720408082008362,
0.036862410604953766,
0.033823080360889435,
-0.017234569415450096,
-0... | 0.804022 | 0.788831 | 0.015191 |
You are tasked with creating a program that calculates the probability distribution for a quantum state given a certain number of qubits and states. The program should then use simulated annealing to find the maximum probability and plot the 3D and contour graphs for the probability distribution. | glaive | [
0.0010458601173013449,
0.023588944226503372,
-0.039137884974479675,
-0.025882648304104805,
0.03655754029750824,
-0.014490819536149502,
-0.03061571903526783,
0.07011006772518158,
0.03104366548359394,
-0.018234865739941597,
0.023510459810495377,
0.037090759724378586,
-0.012475259602069855,
-... | 0.805845 | 0.781981 | 0.023863 |
You are tasked with implementing a load balancing algorithm using IP Hash routing. The goal is to evenly distribute incoming requests to a list of servers based on the client's IP address. You are provided with a list of server IP addresses and a method to generate a random IP address. Your task is to implement the `ip... | glaive | [
0.03129826858639717,
0.032517384737730026,
-0.007933588698506355,
-0.014722338877618313,
0.027684669941663742,
-0.013920461758971214,
-0.015196860767900944,
0.03244743496179581,
0.03296587988734245,
-0.029445070773363113,
0.020780740305781364,
0.023848839104175568,
-0.025397269055247307,
-... | 0.818176 | 0.801736 | 0.01644 |
You are given a file named "input.dat" containing a list of numbers, each on a separate line. You need to write a program to read the file, parse the numbers, and compute the answer based on a specific logic. The input file may contain a large number of lines.
Write a program in Rust that can read the file "input.dat"... | glaive | [
0.01349780522286892,
0.020268509164452553,
-0.025053510442376137,
-0.040162183344364166,
0.01884959638118744,
-0.013701222836971283,
-0.007527908310294151,
0.06890430301427841,
0.0497196763753891,
-0.019892770797014236,
0.0145143186673522,
0.02985703945159912,
-0.032686639577150345,
-0.014... | 0.82394 | 0.806387 | 0.017553 |
You are tasked with implementing a function to calculate the Fibonacci sequence at a given index. 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 function should take an index as input and return the Fibonacci number at that in... | glaive | [
0.013725655153393745,
0.03848997876048088,
-0.023501649498939514,
-0.032047610729932785,
0.04765740782022476,
-0.01996278390288353,
-0.04032813012599945,
0.057620108127593994,
0.02338416501879692,
0.008369511924684048,
0.03083774819970131,
0.03633759915828705,
-0.046498578041791916,
-0.003... | 0.807282 | 0.754733 | 0.052549 |
You are tasked with creating a class that will be used for sorting integers along with associated objects. The class should have a constructor that takes an integer value for sorting and an object to be associated with that value. The class should also have a public int variable for the sorting value and a public objec... | glaive | [
0.013947524130344391,
0.01084494311362505,
-0.019771091639995575,
-0.014121335931122303,
0.03579825907945633,
-0.03846070542931557,
-0.005226814653724432,
0.05830814689397812,
0.04238743707537651,
-0.03283866494894028,
0.024695370346307755,
0.02902849018573761,
-0.04655904322862625,
0.0025... | 0.798169 | 0.783534 | 0.014635 |
You are tasked with implementing a function to find the degree of a given vertex in a subgraph of a simple graph. A subgraph of a simple graph consists of subsets of the graph's vertices and edges such that the endpoints of each edge are present in the vertex subset. The edge subset is formalized as a sub-relation of t... | glaive | [
0.002773887477815151,
0.030177973210811615,
-0.011300336569547653,
-0.02624119073152542,
0.03451032564043999,
-0.010779467411339283,
-0.035019081085920334,
0.05777816101908684,
0.029246242716908455,
-0.004974800162017345,
0.026080422103405,
0.01906510815024376,
-0.011265567503869534,
0.005... | 0.813107 | 0.778799 | 0.034308 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.