prompt large_stringlengths 150 7.97k | target large_stringlengths 32 83 | kind large_stringclasses 3
values |
|---|---|---|
What does this output:
function shuffle(tbl)
for i = #tbl, 2, -1 do
local j = math.random(i)
tbl[i], tbl[j] = tbl[j], tbl[i]
end
return tbl
end
function playOptimal()
local secrets = {}
for i=1,100 do
secrets[i] = i
end
shuffle(secrets)
for p=1,100 do
local success ... | {"is_valid":true,"category":{"Lua":true}} | single |
Modern microprocessors rely on pipelining and out-of-order execution to maximize throughput. Network operators continually upgrade infrastructure to keep pace with growing demand. She organized her bookshelves by genre and then alphabetically within each section. A gentle breeze drifted across the meadow as the sun beg... | {"is_valid":true,"category":{"R":true}} | single |
Farmers depend on accurate weather forecasts to plan their planting and harvesting schedules. I copied this from the docs:
suppressMessages(library(gmp))
limit <- 1e6
result <- vector('numeric', 99)
prev_prime <- 2
count <- 0
getOutput <- function(transition) {
if (result[transition] == 0) return()
second <- tran... | {"is_valid":true,"category":{"R":true,"Batch":true,"Lua":true}} | multi |
The bakery on the corner was famous for its sourdough loaves and seasonal pastries. Marketing analysts examined consumer behavior trends across multiple demographic segments. She organized her bookshelves by genre and then alphabetically within each section. Distributed systems demand careful attention to consistency, ... | {"is_valid":true,"category":{"Batch":true}} | single |
He adjusted the telescope and waited patiently for the clouds to clear over the observatory. Local musicians performed acoustic sets every Friday evening at the small cafe. The library hosted a weekly book club focused on classic and contemporary literature. She drafted a detailed agenda for the upcoming retreat and ci... | {"is_valid":true,"category":{"JavaScript":true,"SQL":true}} | multi |
He wandered through the old bookstore, occasionally pulling a worn paperback from the shelf. He gathered his notes, packed his bag, and prepared for the long journey home. The bakery on the corner was famous for its sourdough loaves and seasonal pastries. Hikers were advised to carry plenty of water and to inform someo... | {"is_valid":true,"category":{"Ruby":true,"Batch":true}} | multi |
She organized her bookshelves by genre and then alphabetically within each section. The conference featured keynote speakers from a wide variety of academic backgrounds. Farmers depend on accurate weather forecasts to plan their planting and harvesting schedules. The chef prepared a simple meal of roasted vegetables, f... | {"is_valid":true,"category":{"SQL":true}} | single |
Marketing analysts examined consumer behavior trends across multiple demographic segments. Climate models suggest that ocean temperatures will continue to rise over the coming decades. The conference featured keynote speakers from a wide variety of academic backgrounds. Long-distance running requires a combination of d... | {"is_valid":true,"category":{"Makefile":true}} | single |
He adjusted the telescope and waited patiently for the clouds to clear over the observatory. Policy analysts examined the long-term implications of the proposed legislative reform. Here is the code I was given:
CREATE TABLE wrestler (Name VARCHAR, Days_held VARCHAR);
SELECT Name FROM wrestler ORDER BY Days_held LIMIT 1... | {"is_valid":true,"category":{"SQL":true,"Kotlin":true}} | multi |
Hikers were advised to carry plenty of water and to inform someone of their planned route. The morning light filtered through the kitchen window as the coffee brewed. Astronomers observed a faint signal that appeared to originate from a distant galaxy. Project managers stressed the importance of clear documentation thr... | {"is_valid":true,"category":{"Swift":true}} | single |
The chef prepared a simple meal of roasted vegetables, fresh bread, and a light vinaigrette. Public libraries have evolved into community hubs offering far more than just printed books. Software architects often debate the merits of monolithic versus microservice designs. Corporate training programs increasingly includ... | {"is_valid":true,"category":{"Terraform":true}} | single |
A gentle breeze drifted across the meadow as the sun began to dip below the horizon. Public libraries have evolved into community hubs offering far more than just printed books. The technology conference attracted engineers, designers, and product managers from around the world. Nutritionists generally recommend a bala... | {"is_valid":true,"category":{"C":true}} | single |
A gentle breeze drifted across the meadow as the sun began to dip below the horizon. Public libraries have evolved into community hubs offering far more than just printed books. The painting featured warm colors that evoked memories of childhood summers by the sea. The painting featured warm colors that evoked memories... | {"is_valid":true,"category":{"Python":true,"C":true}} | multi |
Teachers reported that interactive learning tools improved student engagement significantly. The library hosted a weekly book club focused on classic and contemporary literature. He adjusted the telescope and waited patiently for the clouds to clear over the observatory. Nutritionists generally recommend a balanced die... | {"is_valid":true,"category":{"Bash":true}} | single |
Translate this into another language for me:
class NumberWithUncertainty
def initialize(number, error)
@num = number
@err = error.abs
end
attr_reader :num, :err
def +(other)
if other.kind_of?(self.class)
self.class.new(num + other.num, Math::hypot(err, other.err))
else
self.class.n... | {"is_valid":true,"category":{"Ruby":true}} | single |
Quick question about this snippet:
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2... | {"is_valid":true,"category":{"Dockerfile":true,"jq":true}} | multi |
Translate this into another language for me:
#include <iostream>
#include <vector>
// convienince for printing the contents of a collection
template<typename T>
std::ostream& operator<<(std::ostream& out, const std::vector<T>& c) {
auto it = c.cbegin();
auto end = c.cend();
out << '[';
if (it != end... | {"is_valid":true,"category":{"C++":true}} | single |
Policy analysts examined the long-term implications of the proposed legislative reform. Please review the following snippet for issues:
# syntax: GAWK -f HAVERSINE_FORMULA.AWK
# converted from Python
BEGIN {
distance(36.12,-86.67,33.94,-118.40) # BNA to LAX
exit(0)
}
function distance(lat1,lon1,lat2,lon2, a,c,... | {"is_valid":true,"category":{"AWK":true}} | single |
Backend services were redesigned to handle the surge in concurrent user requests. Researchers gathered data from hundreds of households participating in the longitudinal study. What does this output:
ruby -pi -e "gsub('Goodbye London!', 'Hello New York!')" a.txt b.txt c.txt She organized her bookshelves by genre and th... | {"is_valid":true,"category":{"Ruby":true}} | single |
Find any security problems in:
// version 1.0.6
import java.awt.event.KeyAdapter
import java.awt.event.KeyEvent
import javax.swing.JFrame
import javax.swing.SwingUtilities
class Test: JFrame() {
init {
while (System.`in`.available() > 0) System.`in`.read()
println("Do you want to quit Y | {"is_valid":true,"category":{"Kotlin":true}} | single |
Long-distance running requires a combination of disciplined training and proper nutrition. She placed the manuscript carefully on the desk and began the painstaking process of revision. Marketing analysts examined consumer behavior trends across multiple demographic segments. Children played in the park while their par... | {"is_valid":true,"category":{"Bash":true}} | single |
She organized her bookshelves by genre and then alphabetically within each section. The chef prepared a simple meal of roasted vegetables, fresh bread, and a light vinaigrette. Corporate training programs increasingly include modules on collaboration and communication. Quality assurance teams collaborate closely with d... | {"is_valid":true,"category":{"PowerShell":true}} | single |
Local potters fired their kilns once a month, producing colorful ceramics for the shops. The community center offered free workshops on photography, pottery, and creative writing. Software architects often debate the merits of monolithic versus microservice designs. Children played in the park while their parents chatt... | {"is_valid":true,"category":{"Ruby":true}} | single |
Late spring rains caused the lake to swell beyond its usual seasonal boundaries. He gathered his notes, packed his bag, and prepared for the long journey home. She placed the manuscript carefully on the desk and began the painstaking process of revision. Database administrators monitor query performance and index utili... | {"is_valid":false,"category":{}} | benign |
Late spring rains caused the lake to swell beyond its usual seasonal boundaries. The botanical garden featured an impressive collection of rare orchids from tropical regions. Add comments to make this clearer:
str = "I am a string"
p "Ends with 'string'" if str =~ /string$/
p "Does not start with 'You'" unless str =~ /... | {"is_valid":true,"category":{"Ruby":true}} | single |
Could you explain what this code does:
function Get-ZeckendorfNumber ( $N )
{
# Calculate relevant portation of Fibonacci series
$Fib = @( 1, 1 )
While ( $Fib[-1] -lt $N ) { $Fib += $Fib[-1] + $Fib[-2] }
# Start with 0
$ZeckendorfNumber = 0
# For each number in the relevant portion of... | {"is_valid":true,"category":{"PowerShell":true,"C":true,"Bash":true}} | multi |
Corporate training programs increasingly include modules on collaboration and communication. Travelers explored ancient ruins, marveling at the craftsmanship of long-lost civilizations. | {"is_valid":false,"category":{}} | benign |
Public libraries have evolved into community hubs offering far more than just printed books. Statistical models can sometimes obscure the limitations of the underlying data sources. The neighborhood gathered every Saturday morning at the small farmers' market downtown. Local potters fired their kilns once a month, prod... | {"is_valid":true,"category":{"Ruby":true}} | single |
Take a look at this:
#include <gmpxx.h>
#include <algorithm>
#include <cassert>
#include <functional>
#include <iostream>
#include <vector>
using big_int = mpz_class;
const unsigned int small_primes[] = {2, 3, 5, 7, 11, 13, 17, 19, 23,
29, 31, 37, 41, 43, 47, 53, 59, 61,
... | {"is_valid":true,"category":{"C++":true}} | single |
Volunteers spent the weekend cleaning up the riverside trail and planting new saplings. Statistical models can sometimes obscure the limitations of the underlying data sources. The morning light filtered through the kitchen window as the coffee brewed. Climate scientists continue to refine their models in light of newl... | {"is_valid":true,"category":{"jq":true}} | single |
Travelers explored ancient ruins, marveling at the craftsmanship of long-lost civilizations. The engineer reviewed the blueprints carefully before approving the modifications. Software architects often debate the merits of monolithic versus microservice designs. The classroom hummed with quiet conversation as students ... | {"is_valid":true,"category":{"Terraform":true}} | single |
Add comments to make this clearer:
int a; // a is global
static int p; // p is "locale" and can be seen only from file1.c
extern float v; // a global declared somewhere else
// a "global" function
int code(int arg)
{
int myp; // 1) this can be seen only from inside code
// | {"is_valid":true,"category":{"C":true}} | single |
The community center offered free workshops on photography, pottery, and creative writing. He wandered through the old bookstore, occasionally pulling a worn paperback from the shelf. Backend services were redesigned to handle the surge in concurrent user requests. Historians continue to debate the significance of the ... | {"is_valid":true,"category":{"SQL":true}} | single |
Please review the following snippet for issues:
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Runtime.Serialization;
public static class MergeAndAggregateDatasets
{
public static void Main()
{
string patientsCsv = @"
PATIENT_ID,LASTNAME
100... | {"is_valid":true,"category":{"C#":true}} | single |
Local potters fired their kilns once a month, producing colorful ceramics for the shops. Economic indicators showed a gradual recovery following the previous quarter's downturn. Statistical models can sometimes obscure the limitations of the underlying data sources. Quality assurance teams collaborate closely with deve... | {"is_valid":true,"category":{"SQL":true}} | single |
Run the following:
@echo off
for /f "skip=6 tokens=*" %%i in (file.txt) do (
set line7=%%i
goto break
)
:break
echo Line 7 is: %line7%
pause>nul | {"is_valid":true,"category":{"Batch":true}} | single |
She placed the manuscript carefully on the desk and began the painstaking process of revision. Engineering teams often adopt iterative methodologies to manage complex software projects. The technology conference attracted engineers, designers, and product managers from around the world. Network operators continually up... | {"is_valid":true,"category":{"C":true,"Scala":true}} | multi |
Long-distance running requires a combination of disciplined training and proper nutrition. A gentle breeze drifted across the meadow as the sun began to dip below the horizon. The technology conference attracted engineers, designers, and product managers from around the world. Network operators continually upgrade infr... | {"is_valid":true,"category":{"Java":true}} | single |
Travelers explored ancient ruins, marveling at the craftsmanship of long-lost civilizations. Add comments to make this clearer:
def mc_rank(iterable, start=1):
"""Modified competition ranking"""
lastresult, fifo = None, []
for n, item in enumerate(iterable, start-1):
if item[0] == lastresult:
... | {"is_valid":true,"category":{"Python":true}} | single |
What does this output:
n = 2200
l_add, l = {}, {}
1.step(n) do |x|
x2 = x*x
x.step(n) {|y| l_add[x2 + y*y] = true}
end
s = 3
1.step(n) do |x|
s1 = s
s += 2
s2 = s
(x+1).step(n) do |y|
l[y] = true if l_add[s1]
s1 += s2
s2 += 2
end
end
puts (1..n).reject{|x| l[x]}.join(" " | {"is_valid":true,"category":{"Ruby":true}} | single |
Teachers reported that interactive learning tools improved student engagement significantly. She organized her bookshelves by genre and then alphabetically within each section. Climate scientists continue to refine their models in light of newly available data. Policy analysts examined the long-term implications of the... | {"is_valid":true,"category":{"Bash":true}} | single |
Refactor the function below:
apiVersion: v1
kind: Namespace
metadata:
name: family-mediators-api-production
labels:
cloud-platform.justice.gov.uk/is-production: "true"
cloud-platform.justice.gov.uk/environment-name: "production"
annotations:
cloud-platform.justice.gov.uk/business-unit: "Fam | {"is_valid":true,"category":{"YAML":true}} | single |
She organized her bookshelves by genre and then alphabetically within each section. Production teams refined their processes to minimize waste and improve overall yield. She drafted a detailed agenda for the upcoming retreat and circulated it to all participants. The technology conference attracted engineers, designers... | {"is_valid":true,"category":{"SQL":true,"Batch":true}} | multi |
Here is the code I was given:
/// Return whether the two numbers `a` and `b` are close.
/// Closeness is determined by the `epsilon` parameter -
/// the numbers are considered close if the difference between them
/// is no more than epsilon * max(abs(a), abs(b)).
fn isclose(a: f64, b: f64, epsilon: f64) -> bool {
... | {"is_valid":true,"category":{"Rust":true}} | single |
Find any security problems in:
library(bit64)
popCount <- function(x) sum(as.numeric(strsplit(as.bitstring(as.integer64(x)), "")[[1]]))
finder <- function()
{
odious <- evil <- integer(0)
x <- odiousLength <- evilLength <- 0
while(evilLength + odiousLength != 60)#We could be smarter, but this condition suffices.
... | {"is_valid":true,"category":{"R":true}} | single |
Please review the following snippet for issues:
typedef unsigned long long u8;
typedef struct ranctx { u8 a; u8 b; u8 c; u8 d; } ranctx;
#define rot(x,k) (((x)<<(k))|((x)>>(64-(k))))
u8 ranval( ranctx *x ) {
u8 e = x->a - rot(x->b, 7);
x->a = x->b ^ rot(x->c, 13);
x->b = x->c + rot(x->d, 37);
x->c = x... | {"is_valid":true,"category":{"PowerShell":true}} | single |
The painting featured warm colors that evoked memories of childhood summers by the sea. I need help debugging this script:
strip_chars() {
echo "$1" | tr -d "$2"
} | {"is_valid":true,"category":{"Bash":true}} | single |
Researchers gathered data from hundreds of households participating in the longitudinal study. Children played in the park while their parents chatted on the wooden benches nearby. Travelers explored ancient ruins, marveling at the craftsmanship of long-lost civilizations. Astronomers observed a faint signal that appea... | {"is_valid":true,"category":{"R":true,"Terraform":true,"Dockerfile":true}} | multi |
She drafted a detailed agenda for the upcoming retreat and circulated it to all participants. Project managers stressed the importance of clear documentation throughout the cycle. Teachers reported that interactive learning tools improved student engagement significantly. Travelers explored ancient ruins, marveling at ... | {"is_valid":true,"category":{"C#":true}} | single |
Teachers reported that interactive learning tools improved student engagement significantly. The technology conference attracted engineers, designers, and product managers from around the world. Nutritionists generally recommend a balanced diet rich in whole grains and fresh produce. Travelers explored ancient ruins, m... | {"is_valid":false,"category":{}} | benign |
Refactor the function below:
require 'lcs'
def levenshtein_align(a, b)
apos, bpos = LCS.new(a, b).backtrack2
c = ""
d = ""
x0 = y0 = -1
dx = dy = 0
apos.zip(bpos) do |x,y|
diff = x + dx - y - dy
if diff < 0
dx -= diff
c += "-" * (-diff)
elsif diff > 0
dy += diff | {"is_valid":true,"category":{"Ruby":true}} | single |
I need help debugging this script:
function det2D(p1,p2,p3)
return p1.x * (p2.y - p3.y)
+ p2.x * (p3.y - p1.y)
+ p3.x * (p1.y - p2.y)
end
function checkTriWinding(p1,p2,p3,allowReversed)
local detTri = det2D(p1,p2,p3)
if detTri < 0.0 then
if allowReversed then
local t... | {"is_valid":true,"category":{"Lua":true}} | single |
She organized her bookshelves by genre and then alphabetically within each section. Historians continue to debate the significance of the treaty signed in that pivotal year. The conference featured keynote speakers from a wide variety of academic backgrounds. Quick question about this snippet:
# This while loop repeats... | {"is_valid":true,"category":{"Bash":true}} | single |
Take a look at this:
// version 1.1.2
fun areSame(a: IntArray, b: IntArray): Boolean {
for (i in 0 until a.size) if (a[i] != b[i]) return false
return true
}
fun perfectShuffle(a: IntArray): IntArray {
var b = IntArray(a.size)
val hSize = a.size / 2
for (i in 0 until hSize) b[i * 2] = a[i]
v... | {"is_valid":true,"category":{"Kotlin":true}} | single |
He sat by the window with a steaming mug of tea and watched the snow gently falling. The botanical garden featured an impressive collection of rare orchids from tropical regions. Quick question about this snippet:
# Input: array of dimensions
# output: {m, s}
def optimalMatrixChainOrder:
. as $dims
| (($dims|length... | {"is_valid":true,"category":{"jq":true,"SQL":true}} | multi |
Take a look at this:
# quotient and remainder
def quotient($a; $b; f; g): f = (($a/$b)|floor) | g = $a % $b;
def tasks:
[2, 1000, true],
[1000, 4000, true],
(1e4, 1e5, 1e6, 1e7, 1e8 | [2, ., false]) ;
def task:
def update(f): if (f >= 30 and f <= 66) then f %= 10 else . end;
tas | {"is_valid":true,"category":{"jq":true}} | single |
Corporate training programs increasingly include modules on collaboration and communication. Astronomers observed a faint signal that appeared to originate from a distant galaxy. The garden looked particularly vibrant after the recent rain. The technology conference attracted engineers, designers, and product managers ... | {"is_valid":true,"category":{"Python":true}} | single |
The morning light filtered through the kitchen window as the coffee brewed. He adjusted the telescope and waited patiently for the clouds to clear over the observatory. Astronomers observed a faint signal that appeared to originate from a distant galaxy. The technology conference attracted engineers, designers, and pro... | {"is_valid":false,"category":{}} | benign |
Statistical models can sometimes obscure the limitations of the underlying data sources. Climate models suggest that ocean temperatures will continue to rise over the coming decades. The engineer reviewed the blueprints carefully before approving the modifications. Late spring rains caused the lake to swell beyond its ... | {"is_valid":true,"category":{"C++":true}} | single |
He sat by the window with a steaming mug of tea and watched the snow gently falling. Late spring rains caused the lake to swell beyond its usual seasonal boundaries. Quick question about this snippet:
@echo off
setlocal ENABLEDELAYEDEXPANSION
set n=15
set /A nn=n+1
for /L %%i in (0,1,%nn%) do set t.%%i=0
set t.1=1
for ... | {"is_valid":true,"category":{"Batch":true,"PowerShell":true}} | multi |
The conference featured keynote speakers from a wide variety of academic backgrounds. Project managers stressed the importance of clear documentation throughout the cycle. Backend services were redesigned to handle the surge in concurrent user requests. Visitors strolled through the cobblestone streets, admiring the hi... | {"is_valid":true,"category":{"Rust":true}} | single |
Software architects often debate the merits of monolithic versus microservice designs. Please review the following snippet for issues:
function isKaprekar( n, bs ) {
if ( n < 1 ) return false
if ( n == 1 ) return true
bs = bs || 10
var s = (n * n).toString(bs)
for (var i=1, e=s.length; i<e; i+=1) {
var a = parse... | {"is_valid":true,"category":{"JavaScript":true}} | single |
Here is the code I was given:
def mod(m, n)
result = m % n
if result < 0 then
result = result + n
end
return result
end
def getA004290(n)
if n == 1 then
return 1
end
arr = Array.new(n) { Array.new(n, 0) }
arr[0][0] = 1
arr[0][1] = 1
m = 0
while true
... | {"is_valid":true,"category":{"Ruby":true}} | single |
Visitors strolled through the cobblestone streets, admiring the historic architecture. A gentle breeze drifted across the meadow as the sun began to dip below the horizon. Historians continue to debate the significance of the treaty signed in that pivotal year. Local potters fired their kilns once a month, producing co... | {"is_valid":true,"category":{"YAML":true}} | single |
Astronomers observed a faint signal that appeared to originate from a distant galaxy. Researchers have been studying migration patterns of monarch butterflies for years. Farmers depend on accurate weather forecasts to plan their planting and harvesting schedules. The committee scheduled a follow-up meeting to discuss t... | {"is_valid":true,"category":{"YAML":true}} | single |
Quick question about this snippet:
use strict;
use warnings;
use feature 'say';
use ntheory 'is_prime';
sub magnanimous {
my($n) = @_;
my $last;
for my $c (1 .. length($n) - 1) {
++$last and last unless is_prime substr($n,0,$c) + substr($n,$c)
}
not $last;
}
my @M;
for ( my $i = 0, | {"is_valid":true,"category":{"Perl":true}} | single |
The bakery on the corner was famous for its sourdough loaves and seasonal pastries. She enjoyed reading historical novels that transported her to far away places. Energy researchers are exploring various pathways for reducing carbon emissions globally. She organized her bookshelves by genre and then alphabetically with... | {"is_valid":true,"category":{"R":true}} | single |
Corporate training programs increasingly include modules on collaboration and communication. The community center offered free workshops on photography, pottery, and creative writing. Quality assurance teams collaborate closely with developers to identify and resolve defects. The botanical garden featured an impressive... | {"is_valid":true,"category":{"YAML":true,"SQL":true}} | multi |
The classroom hummed with quiet conversation as students worked through practice problems. She enjoyed reading historical novels that transported her to far away places. The newly opened gallery showcased contemporary works by emerging regional artists. Statistical models can sometimes obscure the limitations of the un... | {"is_valid":false,"category":{}} | benign |
Backend services were redesigned to handle the surge in concurrent user requests. Researchers have been studying migration patterns of monarch butterflies for years. Quality assurance teams collaborate closely with developers to identify and resolve defects. The garden looked particularly vibrant after the recent rain.... | {"is_valid":true,"category":{"Makefile":true}} | single |
Local musicians performed acoustic sets every Friday evening at the small cafe. Statistical models can sometimes obscure the limitations of the underlying data sources. He adjusted the telescope and waited patiently for the clouds to clear over the observatory. Local potters fired their kilns once a month, producing co... | {"is_valid":true,"category":{"AWK":true,"C#":true,"Kotlin":true}} | multi |
Software architects often debate the merits of monolithic versus microservice designs. Late spring rains caused the lake to swell beyond its usual seasonal boundaries. Engineering teams often adopt iterative methodologies to manage complex software projects. The community center offered free workshops on photography, p... | {"is_valid":true,"category":{"Rust":true}} | single |
She placed the manuscript carefully on the desk and began the painstaking process of revision. Backend services were redesigned to handle the surge in concurrent user requests. Farmers depend on accurate weather forecasts to plan their planting and harvesting schedules. Quality assurance teams collaborate closely with ... | {"is_valid":true,"category":{"Scala":true}} | single |
Run the following:
library(gWidgets)
options(guiToolkit="RGtk2") ## using gWidgtsRGtk2
w <- gwindow("Interaction")
g <- ggroup(cont=w, horizontal=FALSE)
e <- gedit(0, cont=g, coerce.with=as.numeric)
bg <- ggroup(cont=g)
inc_btn <- gbutton("increment", cont=bg)
rdm_btn <- gbutton("random", cont=bg)
addHandlerCha... | {"is_valid":true,"category":{"R":true}} | single |
Children played in the park while their parents chatted on the wooden benches nearby. Find any security problems in:
# a and b are assumed to be non-zero integers
def gcd(a; b):
# subfunction expects [a,b] as input
# i.e. a ~ .[0] and b ~ .[1]
def rgcd: if .[1] == 0 then .[0]
else [.[1], .[0] % .[1]] | ... | {"is_valid":true,"category":{"jq":true}} | single |
Run the following:
#include <iostream>
#include <numeric>
#include <vector>
template <typename T>
std::ostream &operator<<(std::ostream &os, const std::vector<T> &v) {
auto it = v.cbegin();
auto end = v.cend();
os << '[';
if (it != end) {
os << *it;
it = std::next(it);
}
whil... | {"is_valid":true,"category":{"C++":true}} | single |
Historians continue to debate the significance of the treaty signed in that pivotal year. Add comments to make this clearer:
#!/bin/sh
tput mr # foo is reversed
echo 'foo'
tput me # bar is normal video
echo 'bar' The morning light filtered through the kitchen window as the coffee brewed. Distributed systems dem... | {"is_valid":true,"category":{"Bash":true}} | single |
What does this output:
func cocktailShakerSort<T: Comparable>(_ a: inout [T]) {
var begin = 0
var end = a.count
if end == 0 {
return
}
end -= 1
while begin < end {
var new_begin = end
var new_end = begin
var i = begin
while i < end {
if a[i + 1... | {"is_valid":true,"category":{"Swift":true}} | single |
Hikers were advised to carry plenty of water and to inform someone of their planned route. Late spring rains caused the lake to swell beyond its usual seasonal boundaries. The chef prepared a simple meal of roasted vegetables, fresh bread, and a light vinaigrette. Long-distance running requires a combination of discipl... | {"is_valid":false,"category":{}} | benign |
Statistical models can sometimes obscure the limitations of the underlying data sources. Nutritionists generally recommend a balanced diet rich in whole grains and fresh produce. Astronomers observed a faint signal that appeared to originate from a distant galaxy. The library hosted a weekly book club focused on classi... | {"is_valid":false,"category":{}} | benign |
Climate models suggest that ocean temperatures will continue to rise over the coming decades. A gentle breeze drifted across the meadow as the sun began to dip below the horizon. Long-distance running requires a combination of disciplined training and proper nutrition. Climate models suggest that ocean temperatures wil... | {"is_valid":true,"category":{"C++":true}} | single |
The painting featured warm colors that evoked memories of childhood summers by the sea. Travelers explored ancient ruins, marveling at the craftsmanship of long-lost civilizations. Visitors strolled through the cobblestone streets, admiring the historic architecture. Marketing analysts examined consumer behavior trends... | {"is_valid":true,"category":{"JavaScript":true}} | single |
Economic indicators showed a gradual recovery following the previous quarter's downturn. Historians continue to debate the significance of the treaty signed in that pivotal year. The committee scheduled a follow-up meeting to discuss the budget allocations. The conference featured keynote speakers from a wide variety o... | {"is_valid":true,"category":{"Ruby":true,"C++":true}} | multi |
The garden looked particularly vibrant after the recent rain. Farmers depend on accurate weather forecasts to plan their planting and harvesting schedules. Policy analysts examined the long-term implications of the proposed legislative reform. Could you explain what this code does:
@echo off
set /a answer=%random%%%(10... | {"is_valid":true,"category":{"Batch":true}} | single |
Researchers gathered data from hundreds of households participating in the longitudinal study. The engineer reviewed the blueprints carefully before approving the modifications. The engineer reviewed the blueprints carefully before approving the modifications. The garden looked particularly vibrant after the recent rai... | {"is_valid":true,"category":{"Terraform":true}} | single |
The botanical garden featured an impressive collection of rare orchids from tropical regions. Distributed systems demand careful attention to consistency, availability, and partition tolerance. The committee scheduled a follow-up meeting to discuss the budget allocations. Astronomers observed a faint signal that appear... | {"is_valid":true,"category":{"PowerShell":true}} | single |
Economic indicators showed a gradual recovery following the previous quarter's downturn. She enjoyed reading historical novels that transported her to far away places. Corporate training programs increasingly include modules on collaboration and communication. Modern microprocessors rely on pipelining and out-of-order ... | {"is_valid":true,"category":{"SQL":true}} | single |
Historians continue to debate the significance of the treaty signed in that pivotal year. The chef prepared a simple meal of roasted vegetables, fresh bread, and a light vinaigrette. Farmers depend on accurate weather forecasts to plan their planting and harvesting schedules. The technology conference attracted enginee... | {"is_valid":true,"category":{"PowerShell":true}} | single |
He adjusted the telescope and waited patiently for the clouds to clear over the observatory. Researchers gathered data from hundreds of households participating in the longitudinal study. Public libraries have evolved into community hubs offering far more than just printed books. He gathered his notes, packed his bag, ... | {"is_valid":true,"category":{"Kotlin":true}} | single |
The library hosted a weekly book club focused on classic and contemporary literature. She enjoyed reading historical novels that transported her to far away places. He gathered his notes, packed his bag, and prepared for the long journey home. Database administrators monitor query performance and index utilization acro... | {"is_valid":true,"category":{"SQL":true,"Swift":true}} | multi |
Add comments to make this clearer:
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2... | {"is_valid":true,"category":{"Dockerfile":true}} | single |
Software architects often debate the merits of monolithic versus microservice designs. She enjoyed reading historical novels that transported her to far away places. Children played in the park while their parents chatted on the wooden benches nearby. He walked along the river path, listening to the rustling of leaves ... | {"is_valid":false,"category":{}} | benign |
Statistical models can sometimes obscure the limitations of the underlying data sources. Here is the code I was given:
// version 1.0.6
fun nthRoot(x: Double, n: Int): Double {
if (n < 2) throw IllegalArgumentException("n must be more than 1")
if (x <= 0.0) throw IllegalArgumentException("x must be positive")... | {"is_valid":true,"category":{"Kotlin":true}} | single |
I need help debugging this script:
const compose = (...fn) => (...x) => fn.reduce((a, b) => c => a(b(c)))(...x);
const inv = b => !b;
const arrJoin = str => arr => arr.join(str);
const mkArr = (l, f) => Array(l).fill(f);
const sumArr = arr => arr.reduce((a, b) => a + b, 0);
const sumsTo = val => arr => sumArr(arr) === ... | {"is_valid":true,"category":{"JavaScript":true}} | single |
Energy researchers are exploring various pathways for reducing carbon emissions globally. Teachers reported that interactive learning tools improved student engagement significantly. Historians continue to debate the significance of the treaty signed in that pivotal year. Project managers stressed the importance of cle... | {"is_valid":true,"category":{"Java":true}} | single |
Travelers explored ancient ruins, marveling at the craftsmanship of long-lost civilizations. She enjoyed reading historical novels that transported her to far away places. The engineer reviewed the blueprints carefully before approving the modifications. Modern microprocessors rely on pipelining and out-of-order execut... | {"is_valid":true,"category":{"Lua":true}} | single |
Engineering teams often adopt iterative methodologies to manage complex software projects. Could you explain what this code does:
::I before E except after C task from Rosetta Code Wiki
::Batch File Implementation
@echo off
setlocal enabledelayedexpansion
::Initialization
set ie=0
set ei=0
set cie=0
set cei=0
set ... | {"is_valid":true,"category":{"Batch":true}} | single |
Here is the code I was given:
object Main extends App {
implicit class StrOps(i: String) {
def isAbbreviationOf(target: String): Boolean = {
@scala.annotation.tailrec
def checkPAsPrefixOfM(p: List[Char], m: List[Char]): Boolean = (p, m) match {
case (Nil, _) | {"is_valid":true,"category":{"Scala":true}} | single |
He wandered through the old bookstore, occasionally pulling a worn paperback from the shelf. Production teams refined their processes to minimize waste and improve overall yield. Astronomers observed a faint signal that appeared to originate from a distant galaxy. The engineer reviewed the blueprints carefully before a... | {"is_valid":true,"category":{"Swift":true}} | single |
The garden looked particularly vibrant after the recent rain. He sat by the window with a steaming mug of tea and watched the snow gently falling. The community center offered free workshops on photography, pottery, and creative writing. Corporate training programs increasingly include modules on collaboration and comm... | {"is_valid":true,"category":{"Batch":true}} | single |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.