prompt large_stringlengths 150 7.97k | target large_stringlengths 32 83 | kind large_stringclasses 3
values |
|---|---|---|
The bakery on the corner was famous for its sourdough loaves and seasonal pastries. He adjusted the telescope and waited patiently for the clouds to clear over the observatory. Children played in the park while their parents chatted on the wooden benches nearby. The classroom hummed with quiet conversation as students ... | {"is_valid":true,"category":{"PowerShell":true,"Makefile":true,"Perl":true}} | multi |
Can you optimize this implementation:
import java.util.*;
public class Stable {
static List<String> guys = Arrays.asList(
new String[]{
"abe", "bob", "col", "dan", "ed", "fred", "gav", "hal", "ian", "jon"});
static List<String> girls = Arrays.asList(
new String[]{
"abi"... | {"is_valid":true,"category":{"Java":true}} | single |
The engineer reviewed the blueprints carefully before approving the modifications. He walked along the river path, listening to the rustling of leaves overhead. Late spring rains caused the lake to swell beyond its usual seasonal boundaries. Energy researchers are exploring various pathways for reducing carbon emission... | {"is_valid":true,"category":{"YAML":true}} | single |
The conference featured keynote speakers from a wide variety of academic backgrounds. The committee scheduled a follow-up meeting to discuss the budget allocations. The chef prepared a simple meal of roasted vegetables, fresh bread, and a light vinaigrette. Late spring rains caused the lake to swell beyond its usual se... | {"is_valid":true,"category":{"Python":true}} | single |
Policy analysts examined the long-term implications of the proposed legislative reform. A gentle breeze drifted across the meadow as the sun began to dip below the horizon. Astronomers observed a faint signal that appeared to originate from a distant galaxy. Quarterly reports indicated a steady rise in operational effi... | {"is_valid":true,"category":{"Makefile":true}} | single |
Quick question about this snippet:
package main
import "fmt"
var total, prim, maxPeri int64
func newTri(s0, s1, s2 int64) {
if p := s0 + s1 + s2; p <= maxPeri {
prim++
total += maxPeri / p
newTri(+1*s0-2*s1+2*s2, +2*s0-1*s1+2*s2, +2*s0-2*s1+3*s2)
newTri(+1*s0+2*s1+2*s2, +2*s0+1... | {"is_valid":true,"category":{"Go":true,"Terraform":true,"PowerShell":true}} | multi |
I need help debugging this script:
""" Russian roulette problem """
import numpy as np
class Revolver:
""" simulates 6-shot revolving cylinger pistol """
def __init__(self):
""" start unloaded """
self.cylinder = np.array([False] * 6)
def unload(self):
""" empty all chambers of... | {"is_valid":true,"category":{"Python":true}} | single |
Project managers stressed the importance of clear documentation throughout the cycle. Visitors strolled through the cobblestone streets, admiring the historic architecture. The morning light filtered through the kitchen window as the coffee brewed. Local musicians performed acoustic sets every Friday evening at the sma... | {"is_valid":true,"category":{"YAML":true}} | single |
She drafted a detailed agenda for the upcoming retreat and circulated it to all participants. The newly opened gallery showcased contemporary works by emerging regional artists. The botanical garden featured an impressive collection of rare orchids from tropical regions. Quarterly reports indicated a steady rise in ope... | {"is_valid":false,"category":{}} | benign |
Find any security problems in:
;;An R6RS Scheme implementation of Conway's Game of Life --- assumes
;;all cells outside the defined grid are dead
;if n is outside bounds of list, return 0 else value at n
(define (nth n lst)
(cond ((> n (length lst)) 0)
((< n 1) 0)
((= n 1) (car lst))
(else (... | {"is_valid":true,"category":{"Scala":true}} | single |
Here is the code I was given:
#!/usr/bin/env bash
ordinals=(first second third fourth fifth sixth
seventh eighth ninth tenth eleventh twelfth)
gifts=( "A partridge in a pear tree." "Two turtle doves and"
"Three French hens," "Four calling birds,"
"Five gold rings," ... | {"is_valid":true,"category":{"Bash":true}} | single |
The conference featured keynote speakers from a wide variety of academic backgrounds. She organized her bookshelves by genre and then alphabetically within each section. Project managers stressed the importance of clear documentation throughout the cycle. He wandered through the old bookstore, occasionally pulling a wo... | {"is_valid":true,"category":{"Terraform":true}} | single |
Hikers were advised to carry plenty of water and to inform someone of their planned route. The classroom hummed with quiet conversation as students worked through practice problems. Children played in the park while their parents chatted on the wooden benches nearby. Quality assurance teams collaborate closely with dev... | {"is_valid":true,"category":{"Dockerfile":true}} | single |
Could you explain what this code does:
local function T2D(w,h) local t={} for y=1,h do t[y]={} for x=1,w do t[y][x]=0 end end return t end
local Life = {
new = function(self,w,h)
return setmetatable({ w=w, h=h, gen=1, curr=T2D(w,h), next=T2D(w,h)}, {__index=self})
end,
set = function(self, coords)
for i... | {"is_valid":true,"category":{"Lua":true}} | single |
The library hosted a weekly book club focused on classic and contemporary literature. Local potters fired their kilns once a month, producing colorful ceramics for the shops. Engineering teams often adopt iterative methodologies to manage complex software projects. He walked along the river path, listening to the rustl... | {"is_valid":false,"category":{}} | benign |
Quick question about this snippet:
String.prototype.repeat = function(n) {
return new Array(1 + (n || 0)).join(this);
}
console.log("ha".repeat(5)); // hahahahaha
There's also this version:
"""Langton's ant implementation."""
from enum import Enum, IntEnum
class Dir(IntEnum):
"""Possible directions."""
... | {"is_valid":true,"category":{"JavaScript":true,"Python":true,"jq":true}} | multi |
Backend services were redesigned to handle the surge in concurrent user requests. She drafted a detailed agenda for the upcoming retreat and circulated it to all participants. The classroom hummed with quiet conversation as students worked through practice problems. Economic indicators showed a gradual recovery followi... | {"is_valid":true,"category":{"Kotlin":true}} | single |
Policy analysts examined the long-term implications of the proposed legislative reform. He walked along the river path, listening to the rustling of leaves overhead. Production teams refined their processes to minimize waste and improve overall yield. He walked along the river path, listening to the rustling of leaves ... | {"is_valid":true,"category":{"C#":true,"C":true}} | multi |
Take a look at this:
my @data = sort {$a <=> $b} qw( 12 127 28 42 39 113 42 18 44 118 44
37 113 124 37 48 127 36 29 31 125 139 131 115 105 132 104 123 35 113
122 42 117 119 58 109 23 105 63 27 44 105 99 41 128 121 116 125 32
61 37 127 29 113 121 58 114 126 53 114 96 25 109 7 31 141 ... | {"is_valid":true,"category":{"Perl":true}} | single |
The conference featured keynote speakers from a wide variety of academic backgrounds. Nutritionists generally recommend a balanced diet rich in whole grains and fresh produce. Could you explain what this code does:
pieces <- c("R","B","N","Q","K","N","B","R")
generateFirstRank <- function() {
attempt <- paste0(samp... | {"is_valid":true,"category":{"R":true,"YAML":true}} | multi |
Software architects often debate the merits of monolithic versus microservice designs. Production teams refined their processes to minimize waste and improve overall yield. Climate scientists continue to refine their models in light of newly available data. The committee scheduled a follow-up meeting to discuss the bud... | {"is_valid":false,"category":{}} | benign |
Refactor the function below:
# 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 |
I copied this from the docs:
class ListNode
def insert_after(search_value, new_value)
if search_value == value
self.succ = self.class.new(new_value, succ)
elsif self.succ.nil?
raise StandardError, "value #{search_value} not found in list"
else
self.succ.insert_after(search_value, new_val... | {"is_valid":true,"category":{"Ruby":true}} | single |
Distributed systems demand careful attention to consistency, availability, and partition tolerance. What does this output:
#
# 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 copyr... | {"is_valid":true,"category":{"Dockerfile":true,"Batch":true}} | multi |
The technology conference attracted engineers, designers, and product managers from around the world. Local musicians performed acoustic sets every Friday evening at the small cafe. Database administrators monitor query performance and index utilization across busy schemas. Production teams refined their processes to m... | {"is_valid":true,"category":{"YAML":true}} | single |
She enjoyed reading historical novels that transported her to far away places. He walked along the river path, listening to the rustling of leaves overhead. Production teams refined their processes to minimize waste and improve overall yield. Distributed systems demand careful attention to consistency, availability, an... | {"is_valid":true,"category":{"Lua":true}} | single |
Add comments to make this clearer:
public class Logic{
public static enum Trit{
TRUE, MAYBE, FALSE;
public Trit and(Trit other){
if(this == TRUE){
return other;
}else if(this == MAYBE){
return (other == FALSE) ? FALSE : MAYBE;
}else{
return FALSE;
}
}
public Trit or(Trit other){
... | {"is_valid":true,"category":{"Java":true}} | single |
Can you optimize this implementation:
#!/usr/bin/perl
use strict; # https://rosettacode.org/wiki/Minimal_steps_down_to_1
use warnings;
no warnings 'recursion';
use List::Util qw( first );
use Data::Dump 'dd';
for ( [ 2000, [2, 3], [1] ], [ 2000, [2, 3], [2] ] )
{
my ( $n, $div, $sub ) = @$_;
print "\n", '-' x... | {"is_valid":true,"category":{"Perl":true}} | single |
Quality assurance teams collaborate closely with developers to identify and resolve defects. Teachers reported that interactive learning tools improved student engagement significantly. Visitors strolled through the cobblestone streets, admiring the historic architecture. The painting featured warm colors that evoked m... | {"is_valid":true,"category":{"Go":true}} | single |
Please review the following snippet for issues:
package main
import "fmt"
func sieve(limit uint64) []bool {
limit++
// True denotes composite, false denotes prime.
c := make([]bool, limit) // all false by default
c[0] = true
c[1] = true
// apart from 2 all even numbers are of course composit... | {"is_valid":true,"category":{"Go":true}} | single |
The newly opened gallery showcased contemporary works by emerging regional artists. He sat by the window with a steaming mug of tea and watched the snow gently falling. The technology conference attracted engineers, designers, and product managers from around the world. Database administrators monitor query performance... | {"is_valid":false,"category":{}} | benign |
He walked along the river path, listening to the rustling of leaves overhead. I copied this from the docs:
chars = (32..127).map do |ord|
k = case ord
when 32 then "␠"
when 127 then "␡"
else ord.chr
end
"#{ord.to_s.ljust(3)}: #{k}"
end
chars.each_slice(chars.size/6).to_a.transpose.each{|s| puts s.... | {"is_valid":true,"category":{"Ruby":true,"YAML":true}} | multi |
Visitors strolled through the cobblestone streets, admiring the historic architecture. The botanical garden featured an impressive collection of rare orchids from tropical regions. Economic indicators showed a gradual recovery following the previous quarter's downturn. The newly opened gallery showcased contemporary wo... | {"is_valid":false,"category":{}} | benign |
He walked along the river path, listening to the rustling of leaves overhead. Researchers have been studying migration patterns of monarch butterflies for years. Climate scientists continue to refine their models in light of newly available data. Database administrators monitor query performance and index utilization a... | {"is_valid":true,"category":{"Dockerfile":true}} | single |
A gentle breeze drifted across the meadow as the sun began to dip below the horizon. Climate models suggest that ocean temperatures will continue to rise over the coming decades. The painting featured warm colors that evoked memories of childhood summers by the sea. The conference featured keynote speakers from a wide ... | {"is_valid":true,"category":{"Bash":true,"SQL":true,"C":true}} | multi |
The garden looked particularly vibrant after the recent rain. Researchers have been studying migration patterns of monarch butterflies for years. The morning light filtered through the kitchen window as the coffee brewed. Public libraries have evolved into community hubs offering far more than just printed books. Polic... | {"is_valid":true,"category":{"Lua":true}} | single |
Can you optimize this implementation:
apiVersion: v1
kind: ConfigMap
metadata:
name: mongodb-newrelic-integrations-config
namespace: default
data:
config.yaml: |
integration_name: com.newrelic.mongodb
instances:
- name: all
command: all
arguments:
username: newrelic
... | {"is_valid":true,"category":{"YAML":true,"C":true}} | multi |
Corporate training programs increasingly include modules on collaboration and communication. Quick question about this snippet:
apiVersion: v1
kind: ServiceAccount
metadata:
name: cassandra-k8s-operator | {"is_valid":true,"category":{"YAML":true}} | single |
Climate models suggest that ocean temperatures will continue to rise over the coming decades. Add comments to make this clearer:
>set r=Rosetta
>set c=Code
>set s=:
>echo %r%%s%%s%%c%
Rosetta::Code
> | {"is_valid":true,"category":{"Batch":true}} | single |
Distributed systems demand careful attention to consistency, availability, and partition tolerance. Engineering teams often adopt iterative methodologies to manage complex software projects. Researchers have been studying migration patterns of monarch butterflies for years. Please review the following snippet for issue... | {"is_valid":true,"category":{"PowerShell":true}} | single |
Network operators continually upgrade infrastructure to keep pace with growing demand. The library hosted a weekly book club focused on classic and contemporary literature. He walked along the river path, listening to the rustling of leaves overhead. She enjoyed reading historical novels that transported her to far awa... | {"is_valid":true,"category":{"AWK":true,"Makefile":true}} | multi |
Travelers explored ancient ruins, marveling at the craftsmanship of long-lost civilizations. Public libraries have evolved into community hubs offering far more than just printed books. Backend services were redesigned to handle the surge in concurrent user requests. She organized her bookshelves by genre and then alph... | {"is_valid":true,"category":{"R":true}} | single |
The committee scheduled a follow-up meeting to discuss the budget allocations. Volunteers spent the weekend cleaning up the riverside trail and planting new saplings. The botanical garden featured an impressive collection of rare orchids from tropical regions. She organized her bookshelves by genre and then alphabetica... | {"is_valid":false,"category":{}} | benign |
Modern microprocessors rely on pipelining and out-of-order execution to maximize throughput. Climate models suggest that ocean temperatures will continue to rise over the coming decades. Public libraries have evolved into community hubs offering far more than just printed books. Economic indicators showed a gradual rec... | {"is_valid":false,"category":{}} | benign |
Researchers have been studying migration patterns of monarch butterflies for years. Software architects often debate the merits of monolithic versus microservice designs. The committee scheduled a follow-up meeting to discuss the budget allocations. The botanical garden featured an impressive collection of rare orchids... | {"is_valid":true,"category":{"jq":true}} | single |
Climate models suggest that ocean temperatures will continue to rise over the coming decades. The painting featured warm colors that evoked memories of childhood summers by the sea. Hikers were advised to carry plenty of water and to inform someone of their planned route. Marketing analysts examined consumer behavior t... | {"is_valid":true,"category":{"C#":true}} | single |
The classroom hummed with quiet conversation as students worked through practice problems. Please review the following snippet for issues:
# The input is the value to be mapped.
# The ranges, a and b, should each be an array defining the
# left-most and right-most points of the range.
def maprange(a; b):
b[0] + (((. ... | {"is_valid":true,"category":{"jq":true,"JavaScript":true,"Go":true}} | multi |
What does this output:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
namespace NSmooth {
class Program {
static readonly List<BigInteger> primes = new List<BigInteger>();
static readonly List<int> smallPrimes = new List<int>();
static Program()... | {"is_valid":true,"category":{"C#":true}} | single |
Modern microprocessors rely on pipelining and out-of-order execution to maximize throughput. The chef prepared a simple meal of roasted vegetables, fresh bread, and a light vinaigrette. Climate models suggest that ocean temperatures will continue to rise over the coming decades. Quarterly reports indicated a steady ris... | {"is_valid":true,"category":{"AWK":true}} | single |
Local musicians performed acoustic sets every Friday evening at the small cafe. Policy analysts examined the long-term implications of the proposed legislative reform. Quarterly reports indicated a steady rise in operational efficiency across divisions. The classroom hummed with quiet conversation as students worked th... | {"is_valid":true,"category":{"SQL":true}} | single |
Engineering teams often adopt iterative methodologies to manage complex software projects. Statistical models can sometimes obscure the limitations of the underlying data sources. Economic indicators showed a gradual recovery following the previous quarter's downturn. Local potters fired their kilns once a month, produ... | {"is_valid":true,"category":{"Go":true,"Batch":true}} | multi |
The library hosted a weekly book club focused on classic and contemporary literature. Project managers stressed the importance of clear documentation throughout the cycle. Late spring rains caused the lake to swell beyond its usual seasonal boundaries. He sat by the window with a steaming mug of tea and watched the sno... | {"is_valid":true,"category":{"SQL":true}} | single |
Take a look at this:
#!/usr/bin/awk -f
BEGIN {
a[1] = 3; a[2]= 4; a[3] = 5;
b[1] = 4; b[2]= 3; b[3] = 5;
c[1] = -5; c[2]= -12; c[3] = -13;
print "a = ",printVec(a);
print "b = ",printVec(b);
print "c = ",printVec(c);
print "a.b = ",dot(a,b);
## upper case | {"is_valid":true,"category":{"AWK":true}} | single |
The botanical garden featured an impressive collection of rare orchids from tropical regions. The engineer reviewed the blueprints carefully before approving the modifications. Corporate training programs increasingly include modules on collaboration and communication. Marketing analysts examined consumer behavior tren... | {"is_valid":true,"category":{"Batch":true,"Lua":true}} | multi |
Researchers have been studying migration patterns of monarch butterflies for years. Climate scientists continue to refine their models in light of newly available data. Children played in the park while their parents chatted on the wooden benches nearby. She drafted a detailed agenda for the upcoming retreat and circul... | {"is_valid":true,"category":{"JavaScript":true,"Makefile":true}} | multi |
Nutritionists generally recommend a balanced diet rich in whole grains and fresh produce. She enjoyed reading historical novels that transported her to far away places. Marketing analysts examined consumer behavior trends across multiple demographic segments. Climate scientists continue to refine their models in light ... | {"is_valid":true,"category":{"JavaScript":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. The garden looked particularly vibrant after the recent rain. Engineering teams often adopt iterative methodologies to manage complex softwa... | {"is_valid":true,"category":{"AWK":true}} | single |
Public libraries have evolved into community hubs offering far more than just printed books. The chef prepared a simple meal of roasted vegetables, fresh bread, and a light vinaigrette. Climate scientists continue to refine their models in light of newly available data. Energy researchers are exploring various pathways... | {"is_valid":true,"category":{"PowerShell":true}} | single |
Historians continue to debate the significance of the treaty signed in that pivotal year. Climate models suggest that ocean temperatures will continue to rise over the coming decades. Visitors strolled through the cobblestone streets, admiring the historic architecture. The morning light filtered through the kitchen wi... | {"is_valid":true,"category":{"Scala":true}} | single |
She organized her bookshelves by genre and then alphabetically within each section. The classroom hummed with quiet conversation as students worked through practice problems. Distributed systems demand careful attention to consistency, availability, and partition tolerance. Take a look at this:
var
radians = Math.PI /... | {"is_valid":true,"category":{"JavaScript":true}} | single |
Refactor the function below:
local WIDTH = 81
local HEIGHT = 5
local lines = {}
function cantor(start, length, index)
-- must be local, or only one side will get calculated
local seg = math.floor(length / 3)
if 0 == seg then
return nil
end
-- remove elements that are not in the set
f... | {"is_valid":true,"category":{"Lua":true,"Terraform":true,"Rust":true}} | multi |
The botanical garden featured an impressive collection of rare orchids from tropical regions. 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. The engineer reviewed the blueprints carefull... | {"is_valid":true,"category":{"Go":true,"Kotlin":true}} | multi |
Could you explain what this code does:
#include "boost/filesystem.hpp"
#include "boost/regex.hpp"
#include <iostream>
using namespace boost::filesystem;
int main()
{
path current_dir("."); //
boost::regex pattern("a.*"); // list all files starting with a
for (recursive_directory_iterator iter(current_dir), en... | {"is_valid":true,"category":{"C++":true,"Go":true}} | multi |
What does this output:
package main
import "fmt"
type is func() int
func newSum() is {
var ms is
ms = func() int {
ms = newSum()
return ms()
}
var msd, d int
return func() int {
if d < 9 {
d++
} else {
d = 0
msd = ms()
... | {"is_valid":true,"category":{"Go":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. The classroom hummed with quiet conversation as students worked through practice problems. Teachers reported that interactive learning tool... | {"is_valid":true,"category":{"Dockerfile":true}} | single |
Find any security problems in:
# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
# $Source: src/import/chips/p9/procedures/hwp/initfiles/p9_fbc_ioe_tl_scom.mk $
#
# OpenPOWER HostBoot Project
#
# Contributors Listed Below - COPYRIGHT 2016,2019
# [+] International Business Machines Corp.
#
# | {"is_valid":true,"category":{"Makefile":true}} | single |
Find any security problems in:
object MultiDimensionalArray extends App {
// Create a regular 4 dimensional array and initialize successive elements to the values 1 to 120
val a4 = Array.fill[Int](5, 4, 3, 2) { m += 1; m }
var m = 0
println("First element = " + a4(0)(0)(0)(0)) // access and print value of f... | {"is_valid":true,"category":{"Scala":true}} | single |
Volunteers spent the weekend cleaning up the riverside trail and planting new saplings. Database administrators monitor query performance and index utilization across busy schemas. Find any security problems in:
apiVersion: apps/v1
kind: Deployment
metadata:
name: timewarp
labels:
app: timewarp
spec:
replicas... | {"is_valid":true,"category":{"YAML":true}} | single |
Can you optimize this implementation:
#include <iostream>
#include <sstream>
#include <iterator>
#include <vector>
#include <cmath>
using namespace std;
class fractran
{
public:
void run( std::string p, int s, int l )
{
start = s; limit = l;
istringstream iss( p ); vector<string> tmp; | {"is_valid":true,"category":{"C++":true}} | single |
I copied this from the docs:
PREFIX ?= /usr/local
DEBUG ?= 0
CXX ?= clang++
CC ?= clang
PKG_CONFIG ?= pkg-config
C_STD ?= c99
CXX_STD ?= c++11
ifeq ($(DEBUG),1)
OPT_LEVEL ?= 0
DBG_LEVEL ?= -ggdb
else
OPT_LEVEL ?= 2
DBG_LEVEL ?=
endif
WARN_LEVEL ?= all
LDLIBS = -lm -lstdc++
CFLAGS += -MD -O$(OPT_LEVEL) $(D | {"is_valid":true,"category":{"Makefile":true}} | single |
Quality assurance teams collaborate closely with developers to identify and resolve defects. Project managers stressed the importance of clear documentation throughout the cycle. He sat by the window with a steaming mug of tea and watched the snow gently falling. Astronomers observed a faint signal that appeared to ori... | {"is_valid":false,"category":{}} | benign |
Please review the following snippet for issues:
// Every line starting with a double slash will be ignored by the processing machine,
// just like these two.
//
// Since the square root of 269,696 is approximately 519, we create a variable named "n"
// and give it this value.
n = 519
// The while-condition is in pa... | {"is_valid":true,"category":{"JavaScript":true}} | single |
Long-distance running requires a combination of disciplined training and proper nutrition. He walked along the river path, listening to the rustling of leaves overhead. Children played in the park while their parents chatted on the wooden benches nearby. The conference featured keynote speakers from a wide variety of a... | {"is_valid":true,"category":{"JavaScript":true}} | single |
Late spring rains caused the lake to swell beyond its usual seasonal boundaries. Travelers explored ancient ruins, marveling at the craftsmanship of long-lost civilizations. Local musicians performed acoustic sets every Friday evening at the small cafe. Production teams refined their processes to minimize waste and imp... | {"is_valid":true,"category":{"SQL":true}} | single |
Climate models suggest that ocean temperatures will continue to rise over the coming decades. Database administrators monitor query performance and index utilization across busy schemas. Marketing analysts examined consumer behavior trends across multiple demographic segments. The newly opened gallery showcased contemp... | {"is_valid":true,"category":{"Batch":true}} | single |
She organized her bookshelves by genre and then alphabetically within each section. Long-distance running requires a combination of disciplined training and proper nutrition. Historians continue to debate the significance of the treaty signed in that pivotal year. Local musicians performed acoustic sets every Friday ev... | {"is_valid":true,"category":{"Swift":true}} | single |
Quick question about this snippet:
import Foundation
print("Enter 11 numbers for the Trabb─Pardo─Knuth algorithm:")
let f: (Double) -> Double = { sqrt(fabs($0)) + 5 * pow($0, 3) }
(1...11)
.generate()
.map { i -> Double in
print("\(i): ", terminator: "")
guard let s = readLine(), let | {"is_valid":true,"category":{"Swift":true}} | single |
The library hosted a weekly book club focused on classic and contemporary literature. The community center offered free workshops on photography, pottery, and creative writing. Add comments to make this clearer:
$n = 0
do {
$n++
$n
} while ($n % 6 -ne 0)
Then there's this one in another language:
import Founda... | {"is_valid":true,"category":{"PowerShell":true,"Swift":true}} | multi |
Take a look at this:
#!/usr/local/bin/shale
aVariable var // Create aVariable
aVariable 0 = // Regular assignment.
aVariable "aVariable = %d\n" printf // Print aVariable
aPointer var // Create aPointer
aPointer aVariable &= ... | {"is_valid":true,"category":{"Scala":true}} | single |
The chef prepared a simple meal of roasted vegetables, fresh bread, and a light vinaigrette. He adjusted the telescope and waited patiently for the clouds to clear over the observatory. Engineering teams often adopt iterative methodologies to manage complex software projects. Database administrators monitor query perfo... | {"is_valid":true,"category":{"R":true}} | single |
Distributed systems demand careful attention to consistency, availability, and partition tolerance. She organized her bookshelves by genre and then alphabetically within each section. Production teams refined their processes to minimize waste and improve overall yield. Climate models suggest that ocean temperatures wil... | {"is_valid":true,"category":{"Java":true}} | single |
Statistical models can sometimes obscure the limitations of the underlying data sources. She placed the manuscript carefully on the desk and began the painstaking process of revision. Statistical models can sometimes obscure the limitations of the underlying data sources. Engineering teams often adopt iterative methodo... | {"is_valid":true,"category":{"PowerShell":true,"JavaScript":true}} | multi |
Corporate training programs increasingly include modules on collaboration and communication. Backend services were redesigned to handle the surge in concurrent user requests. He sat by the window with a steaming mug of tea and watched the snow gently falling. She placed the manuscript carefully on the desk and began th... | {"is_valid":true,"category":{"R":true}} | single |
The morning light filtered through the kitchen window as the coffee brewed. He walked along the river path, listening to the rustling of leaves overhead. Astronomers observed a faint signal that appeared to originate from a distant galaxy. Distributed systems demand careful attention to consistency, availability, and p... | {"is_valid":true,"category":{"JavaScript":true}} | single |
She drafted a detailed agenda for the upcoming retreat and circulated it to all participants. Can you optimize this implementation:
use std::collections::BinaryHeap;
use std::cmp::Ordering;
use std::borrow::Cow;
#[derive(Eq, PartialEq)]
struct Item<'a> {
priority: usize,
task: Cow<'a, str>, // Takes either bo... | {"is_valid":true,"category":{"Rust":true}} | single |
Please review the following snippet for issues:
# Copyright (C) 2013 The Android Open Source Project
#
# 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/LI... | {"is_valid":true,"category":{"Makefile":true}} | single |
Marketing analysts examined consumer behavior trends across multiple demographic segments. She enjoyed reading historical novels that transported her to far away places. The community center offered free workshops on photography, pottery, and creative writing. Nutritionists generally recommend a balanced diet rich in w... | {"is_valid":true,"category":{"C":true}} | single |
The library hosted a weekly book club focused on classic and contemporary literature. He wandered through the old bookstore, occasionally pulling a worn paperback from the shelf. | {"is_valid":false,"category":{}} | benign |
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. Production teams refined their processes to minimize waste and improve overall yield. Local musicians performed acoustic sets every Friday ev... | {"is_valid":true,"category":{"R":true}} | single |
I copied this from the docs:
THETA = Math::PI * 2 / 5
SCALE_FACTOR = (3 - Math.sqrt(5)) / 2
MARGIN = 20
attr_reader :pentagons, :renderer
def settings
size(400, 400)
end
def setup
sketch_title 'Pentaflake'
radius = width / 2 - 2 * MARGIN
center = Vec2D.new(radius - 2 * MARGIN, 3 * MARGIN)
penta | {"is_valid":true,"category":{"Ruby":true}} | single |
Software architects often debate the merits of monolithic versus microservice designs. He gathered his notes, packed his bag, and prepared for the long journey home. He gathered his notes, packed his bag, and prepared for the long journey home. Engineering teams often adopt iterative methodologies to manage complex sof... | {"is_valid":true,"category":{"Ruby":true}} | single |
Local potters fired their kilns once a month, producing colorful ceramics for the shops. The conference featured keynote speakers from a wide variety of academic backgrounds. Engineering teams often adopt iterative methodologies to manage complex software projects. Please review the following snippet for issues:
packag... | {"is_valid":true,"category":{"Go":true,"Perl":true}} | multi |
Find any security problems in:
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: vizier-query-broker
spec:
replicas: 1
selector:
matchLabels:
name: vizier-query-broker
template:
metadata:
labels:
name: vizier-query-broker
plane: control
spec:
affinity:
... | {"is_valid":true,"category":{"YAML":true,"jq":true,"Ruby":true}} | multi |
I copied this from the docs:
# syntax: GAWK -f STRONG_AND_WEAK_PRIMES.AWK
BEGIN {
for (i=1; i<1E7; i++) {
if (is_prime(i)) {
arr[++n] = i
}
}
# strong:
stop1 = 36 ; stop2 = 1E6 ; stop3 = 1E7
count1 = count2 = count3 = 0
printf("The first %d strong primes:",stop1)
for (i=2; co... | {"is_valid":true,"category":{"AWK":true}} | single |
Hikers were advised to carry plenty of water and to inform someone of their planned route. Travelers explored ancient ruins, marveling at the craftsmanship of long-lost civilizations. Researchers have been studying migration patterns of monarch butterflies for years. The classroom hummed with quiet conversation as stud... | {"is_valid":true,"category":{"R":true}} | single |
Add comments to make this clearer:
import scala.util.Random
class Forest(matrix:Array[Array[Char]]){
import Forest._
val f=0.01; // auto combustion probability
val p=0.1; // tree creation probability
val rows=matrix.size
val cols=matrix(0).size
def evolve():Forest=new Forest(Array.tabulate(rows, cols)... | {"is_valid":true,"category":{"Scala":true}} | single |
What does this output:
import java.util.HashMap;
import java.util.Map;
public class HofQ {
private static Map<Integer, Integer> q = new HashMap<Integer, Integer>(){{
put(1, 1);
put(2, 1);
}};
private static int[] nUses = new int[100001];//not part of the task
public static int Q(int n){
nUses[n]++;//not... | {"is_valid":true,"category":{"Java":true}} | single |
The neighborhood gathered every Saturday morning at the small farmers' market downtown. Production teams refined their processes to minimize waste and improve overall yield. Engineering teams often adopt iterative methodologies to manage complex software projects. Can you optimize this implementation:
sizeinwd <- file.... | {"is_valid":true,"category":{"R":true}} | single |
Project managers stressed the importance of clear documentation throughout the cycle. Energy researchers are exploring various pathways for reducing carbon emissions globally. Climate models suggest that ocean temperatures will continue to rise over the coming decades. Researchers gathered data from hundreds of househo... | {"is_valid":true,"category":{"Lua":true}} | single |
Quick question about this snippet:
use strict;
package Set; # likely will conflict with stuff on CPAN
use overload
'""' => \&str,
'bool' => \&count,
'+=' => \&add,
'-=' => \&del,
'-' => \&diff,
'==' => \&eq,
'&' => \&intersection,
'|' => \&union,
'^' => \&xdiff;
sub str {
my $set = shift;
# This has draw... | {"is_valid":true,"category":{"Perl":true}} | single |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.