prompt large_stringlengths 150 7.97k | target large_stringlengths 32 83 | kind large_stringclasses 3
values |
|---|---|---|
Local potters fired their kilns once a month, producing colorful ceramics for the shops. 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. He gathered his notes, packed his bag, and prepared... | {"is_valid":true,"category":{"C#":true,"Kotlin":true,"R":true}} | multi |
The garden looked particularly vibrant after the recent rain. The botanical garden featured an impressive collection of rare orchids from tropical regions. The bakery on the corner was famous for its sourdough loaves and seasonal pastries. Late spring rains caused the lake to swell beyond its usual seasonal boundaries.... | {"is_valid":false,"category":{}} | benign |
The newly opened gallery showcased contemporary works by emerging regional artists. Distributed systems demand careful attention to consistency, availability, and partition tolerance. A gentle breeze drifted across the meadow as the sun began to dip below the horizon. Astronomers observed a faint signal that appeared t... | {"is_valid":true,"category":{"AWK":true}} | single |
The classroom hummed with quiet conversation as students worked through practice problems. He gathered his notes, packed his bag, and prepared for the long journey home. Project managers stressed the importance of clear documentation throughout the cycle. A gentle breeze drifted across the meadow as the sun began to di... | {"is_valid":true,"category":{"Perl":true}} | single |
Hikers were advised to carry plenty of water and to inform someone of their planned route. Local potters fired their kilns once a month, producing colorful ceramics for the shops. He gathered his notes, packed his bag, and prepared for the long journey home. The community center offered free workshops on photography, p... | {"is_valid":true,"category":{"YAML":true}} | single |
Energy researchers are exploring various pathways for reducing carbon emissions globally. The neighborhood gathered every Saturday morning at the small farmers' market downtown. Take a look at this:
::Batch Files are terrifying when it comes to string processing.
::But well, a decent implementation!
@echo off
REM Belo... | {"is_valid":true,"category":{"Batch":true}} | single |
The technology conference attracted engineers, designers, and product managers from around the world. Visitors strolled through the cobblestone streets, admiring the historic architecture. | {"is_valid":false,"category":{}} | benign |
The morning light filtered through the kitchen window as the coffee brewed. Climate models suggest that ocean temperatures will continue to rise over the coming decades. Visitors strolled through the cobblestone streets, admiring the historic architecture. Local musicians performed acoustic sets every Friday evening at... | {"is_valid":true,"category":{"Scala":true,"PowerShell":true}} | multi |
Marketing analysts examined consumer behavior trends across multiple demographic segments. The neighborhood gathered every Saturday morning at the small farmers' market downtown. Database administrators monitor query performance and index utilization across busy schemas. Quarterly reports indicated a steady rise in ope... | {"is_valid":true,"category":{"C#":true}} | single |
The garden looked particularly vibrant after the recent rain. Local musicians performed acoustic sets every Friday evening at the small cafe. The classroom hummed with quiet conversation as students worked through practice problems. Distributed systems demand careful attention to consistency, availability, and partitio... | {"is_valid":true,"category":{"R":true}} | single |
The engineer reviewed the blueprints carefully before approving the modifications. 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. Software architects often debate the merits of mon... | {"is_valid":true,"category":{"PowerShell":true}} | single |
He gathered his notes, packed his bag, and prepared for the long journey home. Nutritionists generally recommend a balanced diet rich in whole grains and fresh produce. Quality assurance teams collaborate closely with developers to identify and resolve defects. Nutritionists generally recommend a balanced diet rich in ... | {"is_valid":true,"category":{"R":true,"Swift":true,"C++":true}} | multi |
She placed the manuscript carefully on the desk and began the painstaking process of revision. Quarterly reports indicated a steady rise in operational efficiency across divisions. Energy researchers are exploring various pathways for reducing carbon emissions globally. I need help debugging this script:
@echo off
setl... | {"is_valid":true,"category":{"Batch":true}} | single |
Late spring rains caused the lake to swell beyond its usual seasonal boundaries. She enjoyed reading historical novels that transported her to far away places. Astronomers observed a faint signal that appeared to originate from a distant galaxy. Teachers reported that interactive learning tools improved student engagem... | {"is_valid":true,"category":{"C":true}} | single |
Modern microprocessors rely on pipelining and out-of-order execution to maximize throughput. The morning light filtered through the kitchen window as the coffee brewed. Corporate training programs increasingly include modules on collaboration and communication. The botanical garden featured an impressive collection of ... | {"is_valid":true,"category":{"YAML":true}} | single |
Please review the following snippet for issues:
use rand::prelude::*;
use std::io::stdin;
fn is_sorted(seq: &[impl PartialOrd]) -> bool {
if seq.len() < 2 {
return true;
}
// Look for any instance where the previous number is larger than the following
!seq.iter()
.zip(seq[1..].iter())
... | {"is_valid":true,"category":{"Rust":true}} | single |
Children played in the park while their parents chatted on the wooden benches nearby. He sat by the window with a steaming mug of tea and watched the snow gently falling. Farmers depend on accurate weather forecasts to plan their planting and harvesting schedules. Researchers have been studying migration patterns of mo... | {"is_valid":true,"category":{"C++":true,"Batch":true}} | multi |
Could you explain what this code does:
ARG GOVERSION=1.18.2
FROM golang:${GOVERSION}
# Set base env.
ARG GOOS=linux
ARG GOARCH=amd64
ENV GOOS=${GOOS} GOARCH=${GOARCH} CGO_ENABLED=0 GOFLAGS='-v -ldflags=-s -ldflags=-w'
# Pre compile the stdlib for 386/arm (32bits).
RUN go build -a std
# Add the code to the image.
WOR... | {"is_valid":true,"category":{"Dockerfile":true,"Kotlin":true}} | multi |
Researchers gathered data from hundreds of households participating in the longitudinal study. Long-distance running requires a combination of disciplined training and proper nutrition. Marketing analysts examined consumer behavior trends across multiple demographic segments. She placed the manuscript carefully on the ... | {"is_valid":false,"category":{}} | benign |
She drafted a detailed agenda for the upcoming retreat and circulated it to all participants. Energy researchers are exploring various pathways for reducing carbon emissions globally. Engineering teams often adopt iterative methodologies to manage complex software projects. Children played in the park while their paren... | {"is_valid":true,"category":{"C#":true}} | single |
He adjusted the telescope and waited patiently for the clouds to clear over the observatory. Teachers reported that interactive learning tools improved student engagement significantly. Modern microprocessors rely on pipelining and out-of-order execution to maximize throughput. She enjoyed reading historical novels tha... | {"is_valid":true,"category":{"Go":true,"Makefile":true}} | multi |
Researchers have been studying migration patterns of monarch butterflies for years. Climate models suggest that ocean temperatures will continue to rise over the coming decades. The committee scheduled a follow-up meeting to discuss the budget allocations. Production teams refined their processes to minimize waste and ... | {"is_valid":true,"category":{"JavaScript":true}} | single |
The library hosted a weekly book club focused on classic and contemporary literature. Translate this into another language for me:
dna = <<DNA_STR
CGTAAAAAATTACAACGTCCTTTGGCTATCTCTTAAACTCCTGCTAAATG
CTCGTGCTTTCCAATTATGTAAGCGTTCCGAGACGGGGTGGTCGATTCTG
AGGACAAAGGTCAAGATGGAGCGCATCGAACGCAATAAGGATCATTTGAT
GGGACGTTTCGTCGACAAAG... | {"is_valid":true,"category":{"Ruby":true,"Python":true,"JavaScript":true}} | multi |
The classroom hummed with quiet conversation as students worked through practice problems. She organized her bookshelves by genre and then alphabetically within each section. She enjoyed reading historical novels that transported her to far away places. Children played in the park while their parents chatted on the woo... | {"is_valid":false,"category":{}} | benign |
She drafted a detailed agenda for the upcoming retreat and circulated it to all participants. I need help debugging this script:
#!/bin/bash
function sum_of_square_digits
{
local -i n="$1" sum=0
while (( n )); do
local -i d=n%10
let sum+=d*d
let n=n/10
done
echo "$sum"
}
function is_happy?
{
lo... | {"is_valid":true,"category":{"Bash":true}} | single |
Please review the following snippet for issues:
use strict;
use warnings; no warnings 'uninitialized';
use feature 'say';
use experimental 'signatures';
use constant Inf => 1e10;
my @tests = (
{
limits => [23, 37, 43, 53, 67, 83],
data => [
95,21,94,12,99,4,70,75,83,93,52,80,57, 5,53... | {"is_valid":true,"category":{"Perl":true}} | single |
Project managers stressed the importance of clear documentation throughout the cycle. Nutritionists generally recommend a balanced diet rich in whole grains and fresh produce. He wandered through the old bookstore, occasionally pulling a worn paperback from the shelf. Late spring rains caused the lake to swell beyond i... | {"is_valid":false,"category":{}} | benign |
The chef prepared a simple meal of roasted vegetables, fresh bread, and a light vinaigrette. She organized her bookshelves by genre and then alphabetically within each section. | {"is_valid":false,"category":{}} | benign |
Network operators continually upgrade infrastructure to keep pace with growing demand. He adjusted the telescope and waited patiently for the clouds to clear over the observatory. Please review the following snippet for issues:
[string[]]$colors = "Black" , "DarkBlue" , "DarkGreen" , "DarkCyan",
... | {"is_valid":true,"category":{"PowerShell":true,"Scala":true}} | multi |
Climate scientists continue to refine their models in light of newly available data. Modern microprocessors rely on pipelining and out-of-order execution to maximize throughput. The committee scheduled a follow-up meeting to discuss the budget allocations. The committee scheduled a follow-up meeting to discuss the budg... | {"is_valid":false,"category":{}} | benign |
Translate this into another language for me:
terraform {
backend "gcs" {}
}
variable "nonce" {}
variable "secrets_dir" {}
variable "charts_dir" {}
variable "project_id" {}
provider "google" {
project = "${var.project_id}"
credentials = "${var.serviceaccount_key}"
}
data "template_file" "release_values" {
... | {"is_valid":true,"category":{"Terraform":true,"Python":true}} | multi |
Astronomers observed a faint signal that appeared to originate from a distant galaxy. Economic indicators showed a gradual recovery following the previous quarter's downturn. Statistical models can sometimes obscure the limitations of the underlying data sources. Energy researchers are exploring various pathways for re... | {"is_valid":true,"category":{"Makefile":true}} | single |
I copied this from the docs:
File <- "~/test.csv"
Opened <- readLines(con = File)
Size <- length(Opened)
HTML <- "~/test.html"
Table <- list()
for(i in 1:Size)
{
#i=1
Split <- unlist(strsplit(Opened[i],split = ","))
Table[i] <- paste0("<td>",Split,"</td>",collapse = "")
Table[i] <- paste0("<tr>",Table[i],... | {"is_valid":true,"category":{"R":true,"Lua":true}} | multi |
He wandered through the old bookstore, occasionally pulling a worn paperback from the shelf. Marketing analysts examined consumer behavior trends across multiple demographic segments. Climate scientists continue to refine their models in light of newly available data. Engineering teams often adopt iterative methodologi... | {"is_valid":true,"category":{"Bash":true,"Swift":true,"Ruby":true}} | multi |
Quality assurance teams collaborate closely with developers to identify and resolve defects. Policy analysts examined the long-term implications of the proposed legislative reform. He wandered through the old bookstore, occasionally pulling a worn paperback from the shelf. Late spring rains caused the lake to swell bey... | {"is_valid":true,"category":{"C":true,"YAML":true,"Go":true}} | multi |
Find any security problems in:
// Version 1.2.40
import java.awt.Color
import java.awt.Graphics
import java.awt.image.BufferedImage
import kotlin.math.abs
import java.io.File
import javax.imageio.ImageIO
class Point(var x: Int, var y: Int)
class BasicBitmapStorage(width: Int, height: Int) {
val image = Buffer... | {"is_valid":true,"category":{"Kotlin":true}} | single |
He wandered through the old bookstore, occasionally pulling a worn paperback from the shelf. The committee scheduled a follow-up meeting to discuss the budget allocations. Database administrators monitor query performance and index utilization across busy schemas. Software architects often debate the merits of monolith... | {"is_valid":true,"category":{"Go":true}} | single |
Quarterly reports indicated a steady rise in operational efficiency across divisions. The morning light filtered through the kitchen window as the coffee brewed. The newly opened gallery showcased contemporary works by emerging regional artists. Long-distance running requires a combination of disciplined training and p... | {"is_valid":true,"category":{"Scala":true}} | single |
Refactor the function below:
# For readability:
def collect(c): map(select(c));
# stream-oriented checks:
def hasMoreThanOne(s): [limit(2;s)] | length > 1;
def hasOne(s): [limit(2;s)] | length == 1;
def prod: .[0] * .[1];
## A stream of admissible [x,y] values
def xy:
[range(2;50) as $x # 1 < X < Y < 100
... | {"is_valid":true,"category":{"jq":true,"Lua":true,"C++":true}} | multi |
Public libraries have evolved into community hubs offering far more than just printed books. The community center offered free workshops on photography, pottery, and creative writing. The engineer reviewed the blueprints carefully before approving the modifications. He gathered his notes, packed his bag, and prepared f... | {"is_valid":true,"category":{"Ruby":true}} | single |
Here is the code I was given:
class String
def wc
n = Hash.new(0)
downcase.scan(/[A-Za-zÀ-ÿ]+/) { |g| n[g] += 1 }
n.sort{|n,g| n[1]<=>g[1]}
end
end
open('135-0.txt') { |n| n.read.wc[-10,10].each{|n| puts n[0].to_s+"->"+n[1].to_s} } | {"is_valid":true,"category":{"Ruby":true}} | single |
The library hosted a weekly book club focused on classic and contemporary literature. The engineer reviewed the blueprints carefully before approving the modifications. Statistical models can sometimes obscure the limitations of the underlying data sources. Children played in the park while their parents chatted on the... | {"is_valid":false,"category":{}} | benign |
Can you optimize this implementation:
# LongAddition only supports Unsigned Integers represented as Strings/Character Arrays
Function LongAddition ( [Char[]] $lhs, [Char[]] $rhs )
{
$lhsl = $lhs.length
$rhsl = $rhs.length
if(($lhsl -gt 0) -and ($rhsl -gt 0))
{
$maxplace = [Math]::Max($rhsl,$lhsl)+1
1..$maxplace... | {"is_valid":true,"category":{"PowerShell":true}} | single |
He gathered his notes, packed his bag, and prepared for the long journey home. Policy analysts examined the long-term implications of the proposed legislative reform. Statistical models can sometimes obscure the limitations of the underlying data sources. Local musicians performed acoustic sets every Friday evening at ... | {"is_valid":true,"category":{"C#":true}} | single |
Take a look at this:
apiVersion: apps/v1
kind: Deployment
metadata:
name: descheduler
namespace: kube-system
labels:
app: descheduler
spec:
replicas: 1
selector:
matchLabels:
app: descheduler
template:
metadata:
labels:
app: descheduler
spec:
priori... | {"is_valid":true,"category":{"YAML":true}} | single |
Add comments to make this clearer:
import Foundation
extension BinaryInteger {
@inlinable
public func gcd(with other: Self) -> Self {
var gcd = self
var b = other
while b != 0 {
(gcd, b) = (b, gcd % b)
}
return gcd
}
@inlinable
public func lcm(with other: Self) -> Self {
... | {"is_valid":true,"category":{"Swift":true}} | single |
I copied this from the docs:
resource "aws_elb" "cf_router" {
name = "${var.env}-cf-router"
subnets = ["${split(",", var.infra_subnet_ids)}"]
idle_timeout = "${var.elb_idle_timeout}"
cross_zone_load_balancing = "true"
security_groups = [
"${aws_security_group.web.id}",
"${aws_security_group.pingdom-pr... | {"is_valid":true,"category":{"Terraform":true}} | single |
Database administrators monitor query performance and index utilization across busy schemas. Late spring rains caused the lake to swell beyond its usual seasonal boundaries. The bakery on the corner was famous for its sourdough loaves and seasonal pastries. The engineer reviewed the blueprints carefully before approvin... | {"is_valid":true,"category":{"Go":true}} | single |
Corporate training programs increasingly include modules on collaboration and communication. Climate scientists continue to refine their models in light of newly available data. Modern microprocessors rely on pipelining and out-of-order execution to maximize throughput. He sat by the window with a steaming mug of tea a... | {"is_valid":true,"category":{"SQL":true}} | single |
Hikers were advised to carry plenty of water and to inform someone of their planned route. Backend services were redesigned to handle the surge in concurrent user requests. The garden looked particularly vibrant after the recent rain. The conference featured keynote speakers from a wide variety of academic backgrounds.... | {"is_valid":true,"category":{"Python":true}} | single |
Quick question about this snippet:
func circleSort<T: Comparable>(_ array: inout [T]) {
func circSort(low: Int, high: Int, swaps: Int) -> Int {
if low == high {
return swaps
}
var lo = low
var hi = high
let mid = (hi - lo) / 2
var s = swaps
while l... | {"is_valid":true,"category":{"Swift":true}} | single |
The engineer reviewed the blueprints carefully before approving the modifications. Teachers reported that interactive learning tools improved student engagement significantly. | {"is_valid":false,"category":{}} | benign |
The bakery on the corner was famous for its sourdough loaves and seasonal pastries. Quick question about this snippet:
@echo off
rem delayed expansion must be disabled before the FOR command.
setlocal disabledelayedexpansion
for /f "tokens=1* delims=]" %%A in ('type "File.txt"^|find /v /n ""') do (
set var=%%B
setloc... | {"is_valid":true,"category":{"Batch":true}} | single |
The community center offered free workshops on photography, pottery, and creative writing. She drafted a detailed agenda for the upcoming retreat and circulated it to all participants. He adjusted the telescope and waited patiently for the clouds to clear over the observatory. Long-distance running requires a combinati... | {"is_valid":false,"category":{}} | benign |
The newly opened gallery showcased contemporary works by emerging regional artists. Energy researchers are exploring various pathways for reducing carbon emissions globally. I copied this from the docs:
CREATE TABLE market (Number_cities INTEGER);
SELECT MAX(Number_cities), MIN(Number_cities) FROM market Travelers expl... | {"is_valid":true,"category":{"SQL":true}} | single |
She drafted a detailed agenda for the upcoming retreat and circulated it to all participants. He walked along the river path, listening to the rustling of leaves overhead. Network operators continually upgrade infrastructure to keep pace with growing demand. Local potters fired their kilns once a month, producing color... | {"is_valid":true,"category":{"Dockerfile":true}} | single |
Policy analysts examined the long-term implications of the proposed legislative reform. Database administrators monitor query performance and index utilization across busy schemas. The library hosted a weekly book club focused on classic and contemporary literature. Find any security problems in:
Add-Type -AssemblyName... | {"is_valid":true,"category":{"PowerShell":true}} | single |
She drafted a detailed agenda for the upcoming retreat and circulated it to all participants. Could you explain what this code does:
import java.text.*;
import java.util.*;
public class CalendarTask {
public static void main(String[] args) {
printCalendar(1969, 3);
}
static void printCalendar(... | {"is_valid":true,"category":{"Java":true,"SQL":true}} | multi |
Researchers gathered data from hundreds of households participating in the longitudinal study. Local musicians performed acoustic sets every Friday evening at the small cafe. I copied this from the docs:
numeric(5)
1:10
c(1, 3, 6, 10, 7 + 8, sqrt(441)) Researchers gathered data from hundreds of households participating... | {"is_valid":true,"category":{"R":true}} | single |
Software architects often debate the merits of monolithic versus microservice designs. 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. He walked along the river path, listening to the rustling of... | {"is_valid":true,"category":{"PowerShell":true}} | single |
Translate this into another language for me:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_CFLAGS += -DHAVE_LIBUSB -DMXT_VERSION=\"$(GIT_VERSION)\"
LOCAL_C_INCLUDES := $(SRC_PATH)
LOCAL_SRC_FILES := \
mxt_app.c \
menu.c \
bootloader.c \
diagnostic_data.c \
touch_app.c \
self_test.c \
bridge.c ... | {"is_valid":true,"category":{"Makefile":true}} | single |
Distributed systems demand careful attention to consistency, availability, and partition tolerance. The committee scheduled a follow-up meeting to discuss the budget allocations. Climate scientists continue to refine their models in light of newly available data. He wandered through the old bookstore, occasionally pull... | {"is_valid":true,"category":{"R":true}} | single |
A gentle breeze drifted across the meadow as the sun began to dip below the horizon. Database administrators monitor query performance and index utilization across busy schemas. She enjoyed reading historical novels that transported her to far away places. The technology conference attracted engineers, designers, and p... | {"is_valid":true,"category":{"JavaScript":true}} | single |
She placed the manuscript carefully on the desk and began the painstaking process of revision. Researchers have been studying migration patterns of monarch butterflies for years. She organized her bookshelves by genre and then alphabetically within each section. The garden looked particularly vibrant after the recent r... | {"is_valid":true,"category":{"C":true}} | single |
Distributed systems demand careful attention to consistency, availability, and partition tolerance. Researchers gathered data from hundreds of households participating in the longitudinal study. The neighborhood gathered every Saturday morning at the small farmers' market downtown. The morning light filtered through th... | {"is_valid":false,"category":{}} | benign |
Quarterly reports indicated a steady rise in operational efficiency across divisions. Researchers gathered data from hundreds of households participating in the longitudinal study. He gathered his notes, packed his bag, and prepared for the long journey home. Can you optimize this implementation:
#include <stdio.h>
#in... | {"is_valid":true,"category":{"C":true}} | single |
Researchers have been studying migration patterns of monarch butterflies for years. Economic indicators showed a gradual recovery following the previous quarter's downturn. Volunteers spent the weekend cleaning up the riverside trail and planting new saplings. The library hosted a weekly book club focused on classic an... | {"is_valid":true,"category":{"SQL":true}} | single |
Astronomers observed a faint signal that appeared to originate from a distant galaxy. Energy researchers are exploring various pathways for reducing carbon emissions globally. Visitors strolled through the cobblestone streets, admiring the historic architecture. Climate scientists continue to refine their models in lig... | {"is_valid":true,"category":{"Bash":true}} | single |
Economic indicators showed a gradual recovery following the previous quarter's downturn. She drafted a detailed agenda for the upcoming retreat and circulated it to all participants. The neighborhood gathered every Saturday morning at the small farmers' market downtown. She enjoyed reading historical novels that transp... | {"is_valid":true,"category":{"Java":true}} | single |
Astronomers observed a faint signal that appeared to originate from a distant galaxy. He wandered through the old bookstore, occasionally pulling a worn paperback from the shelf. A gentle breeze drifted across the meadow as the sun began to dip below the horizon. He adjusted the telescope and waited patiently for the c... | {"is_valid":false,"category":{}} | benign |
Could you explain what this code does:
::
::Penney's Game Task from Rosetta Code Wiki
::Batch File Implementation
::
::Please Directly Open the Batch File to play...
::
@echo off
setlocal enabledelayedexpansion
title The Penney's Game Batch File
set cpu=0&set you=0
cls
echo.
echo Penney's Game
echo Batch File Imple... | {"is_valid":true,"category":{"Batch":true}} | single |
He sat by the window with a steaming mug of tea and watched the snow gently falling. Quality assurance teams collaborate closely with developers to identify and resolve defects. Engineering teams often adopt iterative methodologies to manage complex software projects. Volunteers spent the weekend cleaning up the rivers... | {"is_valid":true,"category":{"Ruby":true}} | single |
Network operators continually upgrade infrastructure to keep pace with growing demand. Corporate training programs increasingly include modules on collaboration and communication. | {"is_valid":false,"category":{}} | benign |
She enjoyed reading historical novels that transported her to far away places. 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 library hosted a weekly book club focused on classic and contem... | {"is_valid":true,"category":{"Makefile":true}} | single |
Quick question about this snippet:
#include <windows.h>
#include <stdio.h>
#include <wchar.h>
/* Print "message: last Win32 error" to stderr. */
void
oops(const wchar_t *message)
{
wchar_t *buf;
DWORD error;
buf = NULL;
error = GetLastError();
FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE... | {"is_valid":true,"category":{"C":true,"YAML":true,"Java":true}} | multi |
Add comments to make this clearer:
#include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>
std::vector<int> divisors(int n) {
std::vector<int> divs = { 1 };
std::vector<int> divs2;
for (int i = 2; i * i <= n; i++) {
if (n % i == 0) {
int j = n / i;
d... | {"is_valid":true,"category":{"C++":true}} | single |
The garden looked particularly vibrant after the recent rain. Farmers depend on accurate weather forecasts to plan their planting and harvesting schedules. Here is the code I was given:
import sys
sys.stdout.write("Goodbye, World!") Local potters fired their kilns once a month, producing colorful ceramics for the shops... | {"is_valid":true,"category":{"Python":true}} | single |
She placed the manuscript carefully on the desk and began the painstaking process of revision. 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. He adjusted the telescope and waited patie... | {"is_valid":true,"category":{"SQL":true,"Go":true}} | multi |
The engineer reviewed the blueprints carefully before approving the modifications. Late spring rains caused the lake to swell beyond its usual seasonal boundaries. Network operators continually upgrade infrastructure to keep pace with growing demand. Volunteers spent the weekend cleaning up the riverside trail and plan... | {"is_valid":true,"category":{"Swift":true}} | single |
Hikers were advised to carry plenty of water and to inform someone of their planned route. Climate scientists continue to refine their models in light of newly available data. She enjoyed reading historical novels that transported her to far away places. Volunteers spent the weekend cleaning up the riverside trail and ... | {"is_valid":true,"category":{"Dockerfile":true,"Batch":true}} | multi |
She organized her bookshelves by genre and then alphabetically within each section. Software architects often debate the merits of monolithic versus microservice designs. Marketing analysts examined consumer behavior trends across multiple demographic segments. Farmers depend on accurate weather forecasts to plan their... | {"is_valid":true,"category":{"C#":true}} | single |
She organized her bookshelves by genre and then alphabetically within each section. The newly opened gallery showcased contemporary works by emerging regional artists. Production teams refined their processes to minimize waste and improve overall yield. Take a look at this:
use Time::Piece;
my $d = Time::Piece->strptim... | {"is_valid":true,"category":{"Perl":true}} | single |
He adjusted the telescope and waited patiently for the clouds to clear over the observatory. Researchers have been studying migration patterns of monarch butterflies for years. Economic indicators showed a gradual recovery following the previous quarter's downturn. Database administrators monitor query performance and ... | {"is_valid":true,"category":{"Lua":true,"PowerShell":true}} | multi |
I need help debugging this script:
package dogs
import "fmt"
// Three variables, three different names.
// (It wouldn't compile if the compiler saw the variable names as the same.)
var dog = "Salt"
var Dog = "Pepper"
var DOG = "Mustard"
func PackageSees() map[*string]int {
// Print dogs visible from here.
... | {"is_valid":true,"category":{"Go":true,"JavaScript":true}} | multi |
Hikers were advised to carry plenty of water and to inform someone of their planned route. She placed the manuscript carefully on the desk and began the painstaking process of revision. Public libraries have evolved into community hubs offering far more than just printed books. The library hosted a weekly book club foc... | {"is_valid":true,"category":{"Makefile":true,"Terraform":true}} | multi |
Children played in the park while their parents chatted on the wooden benches nearby. Climate scientists continue to refine their models in light of newly available data. Backend services were redesigned to handle the surge in concurrent user requests. Statistical models can sometimes obscure the limitations of the und... | {"is_valid":true,"category":{"Ruby":true}} | single |
The bakery on the corner was famous for its sourdough loaves and seasonal pastries. Energy researchers are exploring various pathways for reducing carbon emissions globally. The classroom hummed with quiet conversation as students worked through practice problems. The botanical garden featured an impressive collection ... | {"is_valid":false,"category":{}} | benign |
Researchers have been studying migration patterns of monarch butterflies for years. Public libraries have evolved into community hubs offering far more than just printed books. He sat by the window with a steaming mug of tea and watched the snow gently falling. Quality assurance teams collaborate closely with developer... | {"is_valid":true,"category":{"Ruby":true}} | single |
What does this output:
# All variables are strings within the shell
# Although num look like a number, it is in fact a numerical string
num=5
num=`expr $num + 1` # Increment the number | {"is_valid":true,"category":{"Bash":true}} | single |
I need help debugging this script:
using System;
using System.Linq;
namespace PerniciousNumbers
{
class Program
{
public static int PopulationCount(long n)
{
int cnt = 0;
do
{
if ((n & 1) != 0)
{
cnt++;
... | {"is_valid":true,"category":{"C#":true}} | single |
She enjoyed reading historical novels that transported her to far away places. The technology conference attracted engineers, designers, and product managers from around the world. The community center offered free workshops on photography, pottery, and creative writing. Policy analysts examined the long-term implicati... | {"is_valid":false,"category":{}} | benign |
Energy researchers are exploring various pathways for reducing carbon emissions globally. She enjoyed reading historical novels that transported her to far away places. Historians continue to debate the significance of the treaty signed in that pivotal year. Refactor the function below:
object PythagoreanTriples extend... | {"is_valid":true,"category":{"Scala":true}} | single |
Energy researchers are exploring various pathways for reducing carbon emissions globally. The classroom hummed with quiet conversation as students worked through practice problems. Here is the code I was given:
using System;
namespace RadixSort
{
class Program
{
static void Sort(int[] old)
{
... | {"is_valid":true,"category":{"C#":true}} | single |
Could you explain what this code does:
struct DivisorGen {
curr: u64,
last: u64,
}
impl Iterator for DivisorGen {
type Item = u64;
fn next(&mut self) -> Option<u64> {
self.curr += 2u64;
if self.curr < self.last{
None
} else {
Some(self.curr)
... | {"is_valid":true,"category":{"Rust":true}} | single |
She organized her bookshelves by genre and then alphabetically within each section. Late spring rains caused the lake to swell beyond its usual seasonal boundaries. Nutritionists generally recommend a balanced diet rich in whole grains and fresh produce. Marketing analysts examined consumer behavior trends across multi... | {"is_valid":false,"category":{}} | benign |
The bakery on the corner was famous for its sourdough loaves and seasonal pastries. 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. Engineering teams often adopt iterative methodologies to man... | {"is_valid":true,"category":{"AWK":true}} | single |
Find any security problems in:
// the constructor
function Rational(numerator, denominator) {
if (denominator === undefined)
denominator = 1;
else if (denominator == 0)
throw "divide by zero";
this.numer = numerator;
if (this.numer == 0)
this.denom = 1;
else
this.de... | {"is_valid":true,"category":{"JavaScript":true}} | single |
He sat by the window with a steaming mug of tea and watched the snow gently falling. He wandered through the old bookstore, occasionally pulling a worn paperback from the shelf. Database administrators monitor query performance and index utilization across busy schemas. Modern microprocessors rely on pipelining and out... | {"is_valid":false,"category":{}} | benign |
I copied this from the docs:
import Foundation
// Using arrays for both stack and queue
struct Stack<T> {
private(set) var elements = [T]()
var isEmpty: Bool { return elements.isEmpty }
mutating func push(newElement: T) {
elements.append(newElement)
}
mutating func pop() -> | {"is_valid":true,"category":{"Swift":true}} | single |
Teachers reported that interactive learning tools improved student engagement significantly. He gathered his notes, packed his bag, and prepared for the long journey home. Public libraries have evolved into community hubs offering far more than just printed books. Database administrators monitor query performance and i... | {"is_valid":true,"category":{"jq":true}} | single |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.