prompt large_stringlengths 150 7.97k | target large_stringlengths 32 83 | kind large_stringclasses 3
values |
|---|---|---|
He sat by the window with a steaming mug of tea and watched the snow gently falling. Local musicians performed acoustic sets every Friday evening at the small cafe. Please review the following snippet for issues:
fn median(mut xs: Vec<f64>) -> f64 {
// sort in ascending order, panic on f64::NaN
xs.sort_by(|x,y|... | {"is_valid":true,"category":{"Rust":true}} | single |
Energy researchers are exploring various pathways for reducing carbon emissions globally. Researchers gathered data from hundreds of households participating in the longitudinal study. Historians continue to debate the significance of the treaty signed in that pivotal year. Marketing analysts examined consumer behavior... | {"is_valid":true,"category":{"Dockerfile":true}} | single |
Astronomers observed a faint signal that appeared to originate from a distant galaxy. The bakery on the corner was famous for its sourdough loaves and seasonal pastries. Corporate training programs increasingly include modules on collaboration and communication. Backend services were redesigned to handle the surge in c... | {"is_valid":true,"category":{"AWK":true}} | single |
Network operators continually upgrade infrastructure to keep pace with growing demand. Researchers gathered data from hundreds of households participating in the longitudinal study. Take a look at this:
import scala.swing.{ MainFrame, SimpleSwingApplication }
import scala.swing.Swing.pair2Dimension
object WindowExamp... | {"is_valid":true,"category":{"Scala":true}} | single |
The garden looked particularly vibrant after the recent rain. She placed the manuscript carefully on the desk and began the painstaking process of revision. Run the following:
def factors(num: Int) = {
(1 to num).filter { divisor =>
num % divisor == 0
}
} He gathered his notes, packed his bag, and prepare... | {"is_valid":true,"category":{"Scala":true}} | single |
What does this output:
package main
import "fmt"
type matrix [][]float64
func (m matrix) print() {
for _, r := range m {
fmt.Println(r)
}
fmt.Println("")
}
func main() {
m := matrix{
{ 1, 2, -1, -4},
{ 2, 3, -1, -11},
{-2, 0, -3, 22},
} | {"is_valid":true,"category":{"Go":true}} | single |
I need help debugging this script:
fn make_bins(limits: &Vec<usize>, data: &Vec<usize>) -> Vec<Vec<usize>> {
let mut bins: Vec<Vec<usize>> = Vec::with_capacity(limits.len() + 1);
for _ in 0..=limits.len() {bins.push(Vec::new());}
limits.iter().enumerate().for_each(|(idx, limit)| {
data.iter().for_... | {"is_valid":true,"category":{"Rust":true}} | single |
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. The committee scheduled a follow-up meeting to discuss the budget allocations. Quality assurance teams collaborate closely with developers to identify ... | {"is_valid":true,"category":{"Lua":true,"Go":true}} | multi |
The classroom hummed with quiet conversation as students worked through practice problems. I need help debugging this script:
#!/usr/bin/env ruby
# canonicalize a CIDR block: make sure none of the host bits are set
if ARGV.length == 0 then
ARGV = $stdin.readlines.map(&:chomp)
end
ARGV.each do |cidr|
# dotte... | {"is_valid":true,"category":{"Ruby":true}} | single |
She placed the manuscript carefully on the desk and began the painstaking process of revision. Modern microprocessors rely on pipelining and out-of-order execution to maximize throughput. Policy analysts examined the long-term implications of the proposed legislative reform. The morning light filtered through the kitch... | {"is_valid":true,"category":{"jq":true}} | single |
I copied this from the docs:
FROM amazonlinux:2
# Set ENV_VAR for Greengrass RC to be untarred inside Docker Image
ARG VERSION=1.9.2
ARG GREENGRASS_RELEASE_URL=https://d1onfpft10uf5o.cloudfront.net/greengrass-core/downloads/${VERSION}/greengrass-linux-x86-64-${VERSION}.tar.gz
# Install Greengrass Core Dependencies
RU... | {"is_valid":true,"category":{"Dockerfile":true}} | single |
A gentle breeze drifted across the meadow as the sun began to dip below the horizon. She enjoyed reading historical novels that transported her to far away places. Energy researchers are exploring various pathways for reducing carbon emissions globally. Database administrators monitor query performance and index utiliz... | {"is_valid":true,"category":{"Python":true}} | single |
She placed the manuscript carefully on the desk and began the painstaking process of revision. I copied this from the docs:
static double multiply(double a, double b)
{
return a * b;
} | {"is_valid":true,"category":{"C#":true}} | single |
What does this output:
import java.awt.{BorderLayout, Color, Dimension, Font, Graphics, Graphics2D, Rectangle, RenderingHints}
import java.awt.event.{MouseAdapter, MouseEvent}
import javax.swing.{JFrame, JPanel}
object FlippingBitsGame extends App {
class FlippingBitsGame extends JPanel {
private val maxLev... | {"is_valid":true,"category":{"Scala":true}} | single |
He sat by the window with a steaming mug of tea and watched the snow gently falling. She organized her bookshelves by genre and then alphabetically within each section. Astronomers observed a faint signal that appeared to originate from a distant galaxy. The bakery on the corner was famous for its sourdough loaves and ... | {"is_valid":true,"category":{"SQL":true}} | single |
Children played in the park while their parents chatted on the wooden benches nearby. Find any security problems in:
CREATE TABLE customers (city VARCHAR);
SELECT COUNT(*) FROM customers WHERE city = "Prague" | {"is_valid":true,"category":{"SQL":true}} | single |
I need help debugging this script:
print("USER: \(ProcessInfo.processInfo.environment["USER"] ?? "Not set")")
print("PATH: \(ProcessInfo.processInfo.environment["PATH"] ?? "Not set")")
And separately, here's a related piece:
#include <iostream>
#include <iomanip>
#include <cmath>
namespace Rosetta {
/*! Implem... | {"is_valid":true,"category":{"Swift":true,"C++":true,"C#":true}} | multi |
Corporate training programs increasingly include modules on collaboration and communication. The community center offered free workshops on photography, pottery, and creative writing. Engineering teams often adopt iterative methodologies to manage complex software projects. She drafted a detailed agenda for the upcomin... | {"is_valid":true,"category":{"AWK":true}} | single |
She organized her bookshelves by genre and then alphabetically within each section. Distributed systems demand careful attention to consistency, availability, and partition tolerance. Refactor the function below:
x=("1 2" "3 4")
y=(5 6)
sum=( "${x[@]}" "${y[@]}" )
for i in "${sum[@]}" ; do echo "$i" ; done
1 2
3 ... | {"is_valid":true,"category":{"Bash":true}} | single |
Travelers explored ancient ruins, marveling at the craftsmanship of long-lost civilizations. Researchers gathered data from hundreds of households participating in the longitudinal study. Historians continue to debate the significance of the treaty signed in that pivotal year. The library hosted a weekly book club focu... | {"is_valid":true,"category":{"Java":true}} | single |
Policy analysts examined the long-term implications of the proposed legislative reform. Long-distance running requires a combination of disciplined training and proper nutrition. Policy analysts examined the long-term implications of the proposed legislative reform. The garden looked particularly vibrant after the rece... | {"is_valid":true,"category":{"Kotlin":true}} | single |
Farmers depend on accurate weather forecasts to plan their planting and harvesting schedules. He adjusted the telescope and waited patiently for the clouds to clear over the observatory. The painting featured warm colors that evoked memories of childhood summers by the sea. Quarterly reports indicated a steady rise in ... | {"is_valid":false,"category":{}} | benign |
Statistical models can sometimes obscure the limitations of the underlying data sources. Refactor the function below:
# syntax: GAWK -f MODULAR_INVERSE.AWK
# converted from C
BEGIN {
printf("%s\n",mod_inv(42,2017))
exit(0)
}
function mod_inv(a,b, b0,t,q,x0,x1) {
b0 = b
x0 = 0
x1 = 1
if (b == 1)... | {"is_valid":true,"category":{"AWK":true}} | single |
Please review the following snippet for issues:
FROM debian:11-slim
ENV EMQX_VERSION=5.5.1
ENV AMD64_SHA256=8bac2886987a632aab1c738aa3de28684b415d3b1e1f9489b458c819254673a6
ENV ARM64_SHA256=8b962ad8beea50fb92dc0b93d2ab8a5064752147b70bbf46fd221bc4cc29c32d
ENV LC_ALL=C.UTF-8 LANG=C.UTF-8
RUN set -eu; \
apt-get upda... | {"is_valid":true,"category":{"Dockerfile":true}} | single |
Long-distance running requires a combination of disciplined training and proper nutrition. Network operators continually upgrade infrastructure to keep pace with growing demand. Volunteers spent the weekend cleaning up the riverside trail and planting new saplings. The library hosted a weekly book club focused on class... | {"is_valid":true,"category":{"jq":true}} | single |
Translate this into another language for me:
function reverse()
local ch = io.read(1)
if ch:find("%w") then
local rc = reverse()
io.write(ch)
return rc
end
return ch
end
function forward()
ch = io.read(1)
io.write(ch)
if ch == "." then return false end
if not ch:find("%w") then
ch = re... | {"is_valid":true,"category":{"Lua":true}} | single |
Local musicians performed acoustic sets every Friday evening at the small cafe. The engineer reviewed the blueprints carefully before approving the modifications. Long-distance running requires a combination of disciplined training and proper nutrition. Public libraries have evolved into community hubs offering far mor... | {"is_valid":true,"category":{"R":true}} | single |
Here is the code I was given:
function Get-OneOfN ([int]$Number)
{
$current = 1
for ($i = 2; $i -le $Number; $i++)
{
$limit = 1 / $i
if ((Get-Random -Minimum 0.0 -Maximum 1.0) -lt $limit)
{
$current = $i
}
}
$current
}
$table = [ordered]@{}
fo... | {"is_valid":true,"category":{"PowerShell":true}} | single |
Researchers gathered data from hundreds of households participating in the longitudinal study. Travelers explored ancient ruins, marveling at the craftsmanship of long-lost civilizations. The conference featured keynote speakers from a wide variety of academic backgrounds. Late spring rains caused the lake to swell bey... | {"is_valid":false,"category":{}} | benign |
The conference featured keynote speakers from a wide variety of academic backgrounds. Travelers explored ancient ruins, marveling at the craftsmanship of long-lost civilizations. Researchers gathered data from hundreds of households participating in the longitudinal study. The community center offered free workshops on... | {"is_valid":true,"category":{"Dockerfile":true}} | single |
Corporate training programs increasingly include modules on collaboration and communication. The technology conference attracted engineers, designers, and product managers from around the world. Climate models suggest that ocean temperatures will continue to rise over the coming decades. Quarterly reports indicated a s... | {"is_valid":true,"category":{"Java":true}} | single |
Project managers stressed the importance of clear documentation throughout the cycle. She organized her bookshelves by genre and then alphabetically within each section. The bakery on the corner was famous for its sourdough loaves and seasonal pastries. The painting featured warm colors that evoked memories of childhoo... | {"is_valid":true,"category":{"C":true}} | single |
Database administrators monitor query performance and index utilization across busy schemas. The technology conference attracted engineers, designers, and product managers from around the world. Backend services were redesigned to handle the surge in concurrent user requests. The engineer reviewed the blueprints carefu... | {"is_valid":true,"category":{"Go":true}} | single |
Climate models suggest that ocean temperatures will continue to rise over the coming decades. Policy analysts examined the long-term implications of the proposed legislative reform. The garden looked particularly vibrant after the recent rain. Historians continue to debate the significance of the treaty signed in that ... | {"is_valid":true,"category":{"Dockerfile":true}} | single |
Add comments to make this clearer:
use num::rational::Ratio;
use num::{BigInt, FromPrimitive};
fn main() {
for n in 1..=20 {
println!("Harmonic number {} = {}", n, harmonic_number(n.into()));
}
println!("Harmonic number 100 = {}", harmonic_number(100.into()));
let max = 5;
let mut targ... | {"is_valid":true,"category":{"Rust":true}} | single |
Please review the following snippet for issues:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
typedef struct { double x, y; } vec_t, *vec;
inline double dot(vec a, vec b)
{
return a->x * b->x + a->y * b->y;
}
inline double cross(vec a, vec b)
{
return a->x * b->y - a->y * b->x;
}
inline vec vsub(ve... | {"is_valid":true,"category":{"C":true}} | single |
Refactor the function below:
public class PrimeConspiracy {
public static void main(String[] args) {
final int limit = 1000_000;
final int sieveLimit = 15_500_000;
int[][] buckets = new int[10][10];
int prevDigit = 2;
boolean[] notPrime = sieve(sieveLimit);
for ... | {"is_valid":true,"category":{"Java":true}} | single |
Add comments to make this clearer:
def ToReducedRowEchelonForm( M):
if not M: return
lead = 0
rowCount = len(M)
columnCount = len(M[0])
for r in range(rowCount):
if lead >= columnCount:
return
i = r
while M[i][lead] == 0:
i += 1
if i = | {"is_valid":true,"category":{"Python":true}} | single |
Energy researchers are exploring various pathways for reducing carbon emissions globally. What does this output:
@echo off
setlocal enabledelayedexpansion
call :interpolate %1 %2 res
echo %res%
goto :eof
:interpolate
set pat=%~1
set str=%~2
set %3=!pat:X=%str%!
goto :eof
On a related note, this block:
import java.a... | {"is_valid":true,"category":{"Batch":true,"Kotlin":true,"Dockerfile":true}} | multi |
I copied this from the docs:
extern crate num_traits;
extern crate num;
use num::bigint::{BigInt, ToBigInt};
use num_traits::{Zero, One};
use std::collections::HashMap;
// Return a vector of all fibonacci results from fib(1) to fib(n)
fn fib(n: usize) -> Vec<BigInt> {
let mut result = Vec::with_capacity(n);
... | {"is_valid":true,"category":{"Rust":true}} | single |
He adjusted the telescope and waited patiently for the clouds to clear over the observatory. Quick question about this snippet:
FROM registry.access.redhat.com/ubi8/go-toolset:1.23.6-2.1747789945 AS builder
ENV S2I_GIT_VERSION="1.5.0" \
S2I_GIT_MAJOR="1" \
S2I_GIT_MINOR="5"
ENV GOEXPERIMENT=strictfipsruntime
... | {"is_valid":true,"category":{"Dockerfile":true,"Kotlin":true}} | multi |
Local musicians performed acoustic sets every Friday evening at the small cafe. Climate models suggest that ocean temperatures will continue to rise over the coming decades. Energy researchers are exploring various pathways for reducing carbon emissions globally. The chef prepared a simple meal of roasted vegetables, f... | {"is_valid":true,"category":{"Lua":true}} | single |
Researchers have been studying migration patterns of monarch butterflies for years. The morning light filtered through the kitchen window as the coffee brewed. Late spring rains caused the lake to swell beyond its usual seasonal boundaries. She placed the manuscript carefully on the desk and began the painstaking proce... | {"is_valid":true,"category":{"Python":true}} | single |
Children played in the park while their parents chatted on the wooden benches nearby. Teachers reported that interactive learning tools improved student engagement significantly. Modern microprocessors rely on pipelining and out-of-order execution to maximize throughput. Researchers gathered data from hundreds of house... | {"is_valid":true,"category":{"R":true}} | single |
Add comments to make this clearer:
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: check-acr-sync
namespace: monitoring
labels:
app: check-acr-sync
spec:
schedule: "*/15 * * * *"
concurrencyPolicy: "Forbid"
failedJobsHistoryLimit: 3
startingDeadlineSeconds: 300
jobTemplate:
spec: | {"is_valid":true,"category":{"YAML":true}} | single |
Distributed systems demand careful attention to consistency, availability, and partition tolerance. Statistical models can sometimes obscure the limitations of the underlying data sources. Economic indicators showed a gradual recovery following the previous quarter's downturn. Public libraries have evolved into communi... | {"is_valid":true,"category":{"PowerShell":true}} | single |
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. The neighborhood gathered every Saturday morning at the small farmers' market downtown. Long-distance running requires a combination of disciplined training... | {"is_valid":true,"category":{"Go":true}} | single |
He adjusted the telescope and waited patiently for the clouds to clear over the observatory. 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. Historians continue to debate the s... | {"is_valid":true,"category":{"JavaScript":true,"Perl":true}} | multi |
I need help debugging this script:
public class Accumulator
//implements java.util.function.UnaryOperator<Number> // Java 8
{
private Number sum;
public Accumulator(Number sum0) {
sum = sum0;
}
public Number apply(Number n) {
// Acts like sum += n, but chooses long or double.
// Converts weir... | {"is_valid":true,"category":{"Java":true}} | single |
She organized her bookshelves by genre and then alphabetically within each section. Nutritionists generally recommend a balanced diet rich in whole grains and fresh produce. Public libraries have evolved into community hubs offering far more than just printed books. Travelers explored ancient ruins, marveling at the cr... | {"is_valid":true,"category":{"AWK":true,"Ruby":true}} | multi |
Economic indicators showed a gradual recovery following the previous quarter's downturn. Run the following:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: basic-ingress
namespace: default
spec:
ingressClassName: cilium
rules:
- http:
paths:
- backend:
service:
... | {"is_valid":true,"category":{"YAML":true}} | single |
Travelers explored ancient ruins, marveling at the craftsmanship of long-lost civilizations. The garden looked particularly vibrant after the recent rain. Nutritionists generally recommend a balanced diet rich in whole grains and fresh produce. Quarterly reports indicated a steady rise in operational efficiency across ... | {"is_valid":true,"category":{"R":true}} | single |
Please review the following snippet for issues:
# Duplicated build process (to ../../Dockerfile), to ease iterating locally using this stack in containers
# If there was an INCLUDE instruction in Dockerfile's we could avoid some duplication here.
#
# For real world usage, use buildkite/sockguard:latest from Docker Hub
... | {"is_valid":true,"category":{"Dockerfile":true,"YAML":true}} | multi |
Modern microprocessors rely on pipelining and out-of-order execution to maximize throughput. Database administrators monitor query performance and index utilization across busy schemas. Policy analysts examined the long-term implications of the proposed legislative reform. She placed the manuscript carefully on the des... | {"is_valid":false,"category":{}} | benign |
Volunteers spent the weekend cleaning up the riverside trail and planting new saplings. Researchers have been studying migration patterns of monarch butterflies for years. He adjusted the telescope and waited patiently for the clouds to clear over the observatory. Software architects often debate the merits of monolith... | {"is_valid":true,"category":{"Lua":true}} | single |
He sat by the window with a steaming mug of tea and watched the snow gently falling. He adjusted the telescope and waited patiently for the clouds to clear over the observatory. Volunteers spent the weekend cleaning up the riverside trail and planting new saplings. Database administrators monitor query performance and ... | {"is_valid":true,"category":{"SQL":true,"AWK":true}} | multi |
The engineer reviewed the blueprints carefully before approving the modifications. Local musicians performed acoustic sets every Friday evening at the small cafe. Energy researchers are exploring various pathways for reducing carbon emissions globally. Visitors strolled through the cobblestone streets, admiring the his... | {"is_valid":false,"category":{}} | benign |
Travelers explored ancient ruins, marveling at the craftsmanship of long-lost civilizations. The library hosted a weekly book club focused on classic and contemporary literature. Late spring rains caused the lake to swell beyond its usual seasonal boundaries. Economic indicators showed a gradual recovery following the ... | {"is_valid":false,"category":{}} | benign |
Children played in the park while their parents chatted on the wooden benches nearby. Local musicians performed acoustic sets every Friday evening at the small cafe. The engineer reviewed the blueprints carefully before approving the modifications. She drafted a detailed agenda for the upcoming retreat and circulated i... | {"is_valid":true,"category":{"Swift":true}} | single |
Add comments to make this clearer:
use strict;
use warnings;
use feature <state say>;
use List::Lazy 'lazy_list';
my $p = 1.32471795724474602596;
my $s = 1.0453567932525329623;
my %rules = (A => 'B', B => 'C', C => 'AB');
my $pad_recur = lazy_list { state @p = (1, 1, 1, 2); push @p, $p[1]+$p[2]; shift @p }; | {"is_valid":true,"category":{"Perl":true}} | single |
Researchers gathered data from hundreds of households participating in the longitudinal study. Production teams refined their processes to minimize waste and improve overall yield. Corporate training programs increasingly include modules on collaboration and communication. He wandered through the old bookstore, occasio... | {"is_valid":true,"category":{"Dockerfile":true,"Java":true}} | multi |
Marketing analysts examined consumer behavior trends across multiple demographic segments. Quick question about this snippet:
:: Must have curl.exe
curl.exe -k -s -L https://sourceforge.net/ The conference featured keynote speakers from a wide variety of academic backgrounds. He walked along the river path, listening t... | {"is_valid":true,"category":{"Batch":true}} | single |
Teachers reported that interactive learning tools improved student engagement significantly. The painting featured warm colors that evoked memories of childhood summers by the sea. She organized her bookshelves by genre and then alphabetically within each section. She organized her bookshelves by genre and then alphabe... | {"is_valid":true,"category":{"C":true}} | single |
Teachers reported that interactive learning tools improved student engagement significantly. He adjusted the telescope and waited patiently for the clouds to clear over the observatory. Hikers were advised to carry plenty of water and to inform someone of their planned route. Production teams refined their processes to... | {"is_valid":true,"category":{"Java":true,"Scala":true}} | multi |
Children played in the park while their parents chatted on the wooden benches nearby. She organized her bookshelves by genre and then alphabetically within each section. Hikers were advised to carry plenty of water and to inform someone of their planned route. Public libraries have evolved into community hubs offering ... | {"is_valid":true,"category":{"Makefile":true}} | single |
Public libraries have evolved into community hubs offering far more than just printed books. Translate this into another language for me:
/* Uses C library interface */
extern crate libc;
fn main() {
let istty = unsafe { libc::isatty(libc::STDOUT_FILENO as i32) } != 0;
if istty {
println!("stdout is... | {"is_valid":true,"category":{"Rust":true}} | single |
Backend services were redesigned to handle the surge in concurrent user requests. Climate scientists continue to refine their models in light of newly available data. I copied this from the docs:
julia> 0b1011010111 == 0o1327 == 0x2d7 == 727
true
On a related note, this block:
function relativeBearing(b1Rad, b2Rad)
{
... | {"is_valid":true,"category":{"jq":true,"JavaScript":true}} | multi |
He walked along the river path, listening to the rustling of leaves overhead. Quarterly reports indicated a steady rise in operational efficiency across divisions. Astronomers observed a faint signal that appeared to originate from a distant galaxy. She placed the manuscript carefully on the desk and began the painstak... | {"is_valid":false,"category":{}} | benign |
He walked along the river path, listening to the rustling of leaves overhead. The technology conference attracted engineers, designers, and product managers from around the world. Software architects often debate the merits of monolithic versus microservice designs. She enjoyed reading historical novels that transporte... | {"is_valid":true,"category":{"Ruby":true}} | single |
The library hosted a weekly book club focused on classic and contemporary literature. Modern microprocessors rely on pipelining and out-of-order execution to maximize throughput. Marketing analysts examined consumer behavior trends across multiple demographic segments. Historians continue to debate the significance of ... | {"is_valid":false,"category":{}} | benign |
He wandered through the old bookstore, occasionally pulling a worn paperback from the shelf. Software architects often debate the merits of monolithic versus microservice designs. The painting featured warm colors that evoked memories of childhood summers by the sea. Hikers were advised to carry plenty of water and to ... | {"is_valid":true,"category":{"Batch":true}} | single |
Farmers depend on accurate weather forecasts to plan their planting and harvesting schedules. Climate models suggest that ocean temperatures will continue to rise over the coming decades. What does this output:
dog <- 'Benjamin'
Dog <- 'Samba'
DOG <- 'Bernie'
# Having fun with cats and dogs
cat('The three dogs are n... | {"is_valid":true,"category":{"R":true,"Ruby":true,"C":true}} | multi |
She enjoyed reading historical novels that transported her to far away places. A gentle breeze drifted across the meadow as the sun began to dip below the horizon. The bakery on the corner was famous for its sourdough loaves and seasonal pastries. Volunteers spent the weekend cleaning up the riverside trail and plantin... | {"is_valid":true,"category":{"Scala":true}} | single |
Refactor the function below:
import java.awt.GridLayout
import java.awt.event.ActionEvent
import java.awt.event.ActionListener
import java.awt.event.KeyEvent
import java.awt.event.KeyListener
import javax.swing.*
class Interact : JFrame() {
val numberField = JTextField()
val incButton = JButton("Increment")
... | {"is_valid":true,"category":{"Kotlin":true,"Swift":true}} | multi |
Historians continue to debate the significance of the treaty signed in that pivotal year. He adjusted the telescope and waited patiently for the clouds to clear over the observatory. Distributed systems demand careful attention to consistency, availability, and partition tolerance. Astronomers observed a faint signal t... | {"is_valid":true,"category":{"Terraform":true}} | single |
Historians continue to debate the significance of the treaty signed in that pivotal year. Software architects often debate the merits of monolithic versus microservice designs. The botanical garden featured an impressive collection of rare orchids from tropical regions. Engineering teams often adopt iterative methodolo... | {"is_valid":false,"category":{}} | benign |
Local musicians performed acoustic sets every Friday evening at the small cafe. I copied this from the docs:
public static void cocktailSort( int[] A ){
boolean swapped;
do {
swapped = false;
for (int i =0; i<= A.length - 2;i++) {
if (A[ i ] > A[ i + 1 ]) {
//test whether the two elements are in the wron... | {"is_valid":true,"category":{"Java":true}} | single |
Find any security problems in:
/// <summary>
/// The XMLSystem class is here to help handle XML items in this site.
/// </summary>
public static class XMLSystem
{
static XMLSystem()
{
// Constructor
}
/// <summary>
/// A function to get the contents of an XML document.
/// </summary>
... | {"is_valid":true,"category":{"C#":true}} | single |
Backend services were redesigned to handle the surge in concurrent user requests. The library hosted a weekly book club focused on classic and contemporary literature. A gentle breeze drifted across the meadow as the sun began to dip below the horizon. Marketing analysts examined consumer behavior trends across multipl... | {"is_valid":true,"category":{"R":true}} | single |
The library hosted a weekly book club focused on classic and contemporary literature. Researchers gathered data from hundreds of households participating in the longitudinal study. Run the following:
check_isbn13 () {
local i n t
n=${1//[^0-9]/}
t=0
for ((i=0; i<${#n}; ++i )); do
(( t += ${n:i:1}*... | {"is_valid":true,"category":{"Bash":true}} | single |
Local musicians performed acoustic sets every Friday evening at the small cafe. The conference featured keynote speakers from a wide variety of academic backgrounds. Here is the code I was given:
use strict 'vars';
use warnings;
use feature 'say';
use bigint;
my @b = 1;
my @Aitkens = [1];
push @Aitkens, do {
my... | {"is_valid":true,"category":{"Perl":true}} | single |
Farmers depend on accurate weather forecasts to plan their planting and harvesting schedules. A gentle breeze drifted across the meadow as the sun began to dip below the horizon. Climate scientists continue to refine their models in light of newly available data. Database administrators monitor query performance and in... | {"is_valid":false,"category":{}} | benign |
Researchers gathered data from hundreds of households participating in the longitudinal study. Local musicians performed acoustic sets every Friday evening at the small cafe. Late spring rains caused the lake to swell beyond its usual seasonal boundaries. Local musicians performed acoustic sets every Friday evening at ... | {"is_valid":true,"category":{"Perl":true}} | single |
Distributed systems demand careful attention to consistency, availability, and partition tolerance. 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 garden looked particularly vibrant ... | {"is_valid":true,"category":{"C++":true}} | single |
Network operators continually upgrade infrastructure to keep pace with growing demand. Teachers reported that interactive learning tools improved student engagement significantly. Policy analysts examined the long-term implications of the proposed legislative reform. The botanical garden featured an impressive collecti... | {"is_valid":true,"category":{"Scala":true}} | single |
He wandered through the old bookstore, occasionally pulling a worn paperback from the shelf. Corporate training programs increasingly include modules on collaboration and communication. He walked along the river path, listening to the rustling of leaves overhead. Historians continue to debate the significance of the tr... | {"is_valid":true,"category":{"Dockerfile":true}} | single |
He sat by the window with a steaming mug of tea and watched the snow gently falling. Production teams refined their processes to minimize waste and improve overall yield. Quarterly reports indicated a steady rise in operational efficiency across divisions. The neighborhood gathered every Saturday morning at the small f... | {"is_valid":false,"category":{}} | benign |
Teachers reported that interactive learning tools improved student engagement significantly. Modern microprocessors rely on pipelining and out-of-order execution to maximize throughput. Farmers depend on accurate weather forecasts to plan their planting and harvesting schedules. She placed the manuscript carefully on t... | {"is_valid":false,"category":{}} | benign |
I copied this from the docs:
# Notes on the implementation:
# 1. For efficiency, the implementation requires that the world
# has boundaries, as illustrated in the examples.
# 2. For speed, the simulation uses the exploded string.
# 3. The ASCII values of the "alive" and "empty" symbols are
# hardcoded: "." =>... | {"is_valid":true,"category":{"jq":true}} | single |
Find any security problems in:
package main
import (
"encoding/xml"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
"net/url"
"regexp"
"sort"
"strconv"
"strings"
)
var baseQuery = "http://rosettacode.org/mw/api.php?action=query" +
"&format=xml&list=categorymembers&cmlimit=500"
func req(u string, foun | {"is_valid":true,"category":{"Go":true}} | single |
The chef prepared a simple meal of roasted vegetables, fresh bread, and a light vinaigrette. The neighborhood gathered every Saturday morning at the small farmers' market downtown. Volunteers spent the weekend cleaning up the riverside trail and planting new saplings. Volunteers spent the weekend cleaning up the rivers... | {"is_valid":true,"category":{"R":true}} | single |
Take a look at this:
# Terraform version and plugin versions
terraform {
required_version = ">= 0.13.0, < 2.0.0"
required_providers {
google = ">= 2.19, < 5.0"
template = "~> 2.2"
null = ">= 2.1"
ct = {
source = "poseidon/ct"
version = "~> 0.9"
}
}
} | {"is_valid":true,"category":{"Terraform":true}} | single |
Add comments to make this clearer:
func A(_ k: Int,
_ x1: @escaping () -> Int,
_ x2: @escaping () -> Int,
_ x3: @escaping () -> Int,
_ x4: @escaping () -> Int,
_ x5: @escaping () -> Int) -> Int {
var k1 = k ... | {"is_valid":true,"category":{"Swift":true}} | single |
The classroom hummed with quiet conversation as students worked through practice problems. He walked along the river path, listening to the rustling of leaves overhead. The newly opened gallery showcased contemporary works by emerging regional artists. Modern microprocessors rely on pipelining and out-of-order executio... | {"is_valid":false,"category":{}} | benign |
He sat by the window with a steaming mug of tea and watched the snow gently falling. Researchers gathered data from hundreds of households participating in the longitudinal study. Hikers were advised to carry plenty of water and to inform someone of their planned route. Could you explain what this code does:
function t... | {"is_valid":true,"category":{"Lua":true}} | single |
What does this output:
/**
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appl... | {"is_valid":true,"category":{"Terraform":true,"Java":true,"Rust":true}} | multi |
He sat by the window with a steaming mug of tea and watched the snow gently falling. The painting featured warm colors that evoked memories of childhood summers by the sea. The morning light filtered through the kitchen window as the coffee brewed. Historians continue to debate the significance of the treaty signed in ... | {"is_valid":true,"category":{"Python":true}} | single |
Historians continue to debate the significance of the treaty signed in that pivotal year. I copied this from the docs:
fn multifactorial(n: i32, deg: i32) -> i32 {
if n < 1 {
1
} else {
n * multifactorial(n - deg, deg)
}
}
fn main() {
for i in 1..6 {
for j in 1..11 {
print!("{} ", multifactorial(j, i));
... | {"is_valid":true,"category":{"Rust":true,"Java":true}} | multi |
The neighborhood gathered every Saturday morning at the small farmers' market downtown. Can you optimize this implementation:
double infinity = Double.POSITIVE_INFINITY; //defined as 1.0/0.0
Double.isInfinite(infinity); //true | {"is_valid":true,"category":{"Java":true}} | single |
Software architects often debate the merits of monolithic versus microservice designs. Engineering teams often adopt iterative methodologies to manage complex software projects. He wandered through the old bookstore, occasionally pulling a worn paperback from the shelf. The painting featured warm colors that evoked mem... | {"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.