prompt large_stringlengths 150 7.97k | target large_stringlengths 32 83 | kind large_stringclasses 3
values |
|---|---|---|
Database administrators monitor query performance and index utilization across busy schemas. Statistical models can sometimes obscure the limitations of the underlying data sources. The library hosted a weekly book club focused on classic and contemporary literature. Can you optimize this implementation:
def mean(s: Se... | {"is_valid":true,"category":{"Scala":true}} | single |
Policy analysts examined the long-term implications of the proposed legislative reform. Modern microprocessors rely on pipelining and out-of-order execution to maximize throughput. Late spring rains caused the lake to swell beyond its usual seasonal boundaries. Corporate training programs increasingly include modules o... | {"is_valid":true,"category":{"AWK":true}} | single |
Could you explain what this code does:
case ${.sh.version} in
*93[[:alpha:]]+*) :;; #this appears to be ksh93, we're OK
*) echo "version appears to be too old"
exit # otherwise, bail out
;;
esac
if [[ -z ${bloop+bloop has a value} ]]; then
print "no bloop variable"
elsif (( a... | {"is_valid":true,"category":{"Bash":true}} | single |
Energy researchers are exploring various pathways for reducing carbon emissions globally. Travelers explored ancient ruins, marveling at the craftsmanship of long-lost civilizations. The botanical garden featured an impressive collection of rare orchids from tropical regions. Economic indicators showed a gradual recove... | {"is_valid":true,"category":{"C++":true,"Batch":true}} | multi |
The garden looked particularly vibrant after the recent rain. He adjusted the telescope and waited patiently for the clouds to clear over the observatory. Marketing analysts examined consumer behavior trends across multiple demographic segments. She placed the manuscript carefully on the desk and began the painstaking ... | {"is_valid":true,"category":{"AWK":true,"Terraform":true}} | multi |
Software architects often debate the merits of monolithic versus microservice designs. He walked along the river path, listening to the rustling of leaves overhead. | {"is_valid":false,"category":{}} | benign |
Add comments to make this clearer:
# List of abbreviated compass point labels
compass_points=( N NbE N-NE NEbN NE NEbE E-NE EbN
E EbS E-SE SEbE SE SEbS S-SE SbE
S SbW S-SW SWbS SW SWbW W-SW WbS
W WbN W-NW NWbW NW NWbN N-NW NbW )
# List of angles to test
test_angle... | {"is_valid":true,"category":{"Bash":true,"C":true}} | multi |
The garden looked particularly vibrant after the recent rain. Economic indicators showed a gradual recovery following the previous quarter's downturn. He sat by the window with a steaming mug of tea and watched the snow gently falling. Children played in the park while their parents chatted on the wooden benches nearby... | {"is_valid":true,"category":{"C#":true}} | single |
Modern microprocessors rely on pipelining and out-of-order execution to maximize throughput. She organized her bookshelves by genre and then alphabetically within each section. Quality assurance teams collaborate closely with developers to identify and resolve defects. Statistical models can sometimes obscure the limit... | {"is_valid":false,"category":{}} | benign |
Translate this into another language for me:
echo "Creating cal-file..."
echo > cal.txt
for ((y=1900; y <= 2100; y++)); do
for ((m=1; m <= 12; m++)); do
#echo $m $y
cal -m $m $y >> cal.txt
done
done
ls -la cal.txt
echo "Looking for month with 5 weekends:"
awk -f 5weekends.awk cal.txt | {"is_valid":true,"category":{"Bash":true}} | single |
Volunteers spent the weekend cleaning up the riverside trail and planting new saplings. Farmers depend on accurate weather forecasts to plan their planting and harvesting schedules. Policy analysts examined the long-term implications of the proposed legislative reform. He wandered through the old bookstore, occasionall... | {"is_valid":true,"category":{"C":true,"PowerShell":true}} | multi |
Modern microprocessors rely on pipelining and out-of-order execution to maximize throughput. Researchers have been studying migration patterns of monarch butterflies for years. A gentle breeze drifted across the meadow as the sun began to dip below the horizon. Local potters fired their kilns once a month, producing co... | {"is_valid":true,"category":{"C++":true,"Dockerfile":true}} | multi |
The neighborhood gathered every Saturday morning at the small farmers' market downtown. Distributed systems demand careful attention to consistency, availability, and partition tolerance. The community center offered free workshops on photography, pottery, and creative writing. Local musicians performed acoustic sets e... | {"is_valid":true,"category":{"R":true}} | single |
Quality assurance teams collaborate closely with developers to identify and resolve defects. Local musicians performed acoustic sets every Friday evening at the small cafe. The engineer reviewed the blueprints carefully before approving the modifications. The painting featured warm colors that evoked memories of childh... | {"is_valid":true,"category":{"Swift":true}} | single |
Public libraries have evolved into community hubs offering far more than just printed books. He adjusted the telescope and waited patiently for the clouds to clear over the observatory. Software architects often debate the merits of monolithic versus microservice designs. Hikers were advised to carry plenty of water an... | {"is_valid":true,"category":{"Go":true}} | single |
She placed the manuscript carefully on the desk and began the painstaking process of revision. 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. Economic indicators showed a gradual recovery foll... | {"is_valid":true,"category":{"R":true,"C":true}} | multi |
What does this output:
// version 1.1.4-3
import java.awt.Color
import java.awt.Point
import java.awt.image.BufferedImage
import java.util.LinkedList
import java.io.File
import javax.imageio.ImageIO
import javax.swing.JOptionPane
import javax.swing.JLabel
import javax.swing.ImageIcon
fun floodFill(image: BufferedIm... | {"is_valid":true,"category":{"Kotlin":true}} | single |
Teachers reported that interactive learning tools improved student engagement significantly. Refactor the function below:
Filter FromRoman {
$output = 0
if ($_ -notmatch '^(M{1,3}|)(CM|CD|D?C{0,3}|)(XC|XL|L?X{0,3}|)(IX|IV|V?I{0,3}|)$') {
throw 'Incorrect format'
}
$current = 1000
$subtractor = 'M'
$whole = ... | {"is_valid":true,"category":{"PowerShell":true}} | single |
Can you optimize this implementation:
my @bond;
my $grid = 10;
my $water = '▒';
$D{$_} = $i++ for qw<DeadEnd Up Right Down Left>;
sub percolate {
generate(shift || 0.6);
fill(my $x = 1,my $y = 0);
my @stack;
while () {
if (my $dir = direction($x,$y)) {
push @stack, [$x,$y];
... | {"is_valid":true,"category":{"Perl":true}} | single |
What does this output:
# Using a "reverse array" representations of the integers base b (b>=2),
# generate an unbounded stream of the integers from [0] onwards.
# E.g. for binary: [0], [1], [0,1], [1,1] ...
def integers($base):
def add1:
[foreach (.[], null) as $d ({carry: 1};
if $d then ( | {"is_valid":true,"category":{"jq":true}} | single |
Modern microprocessors rely on pipelining and out-of-order execution to maximize throughput. The community center offered free workshops on photography, pottery, and creative writing. | {"is_valid":false,"category":{}} | benign |
The committee scheduled a follow-up meeting to discuss the budget allocations. A gentle breeze drifted across the meadow as the sun began to dip below the horizon. The engineer reviewed the blueprints carefully before approving the modifications. Climate models suggest that ocean temperatures will continue to rise over... | {"is_valid":false,"category":{}} | benign |
Find any security problems in:
#
# Copyright (C) 2012 The CyanogenMod 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/LICENSE-2.0
#
# Unless re... | {"is_valid":true,"category":{"Makefile":true}} | single |
The technology conference attracted engineers, designers, and product managers from around the world. The committee scheduled a follow-up meeting to discuss the budget allocations. Nutritionists generally recommend a balanced diet rich in whole grains and fresh produce. Engineering teams often adopt iterative methodolo... | {"is_valid":true,"category":{"C":true}} | single |
Farmers depend on accurate weather forecasts to plan their planting and harvesting schedules. He walked along the river path, listening to the rustling of leaves overhead. Local musicians performed acoustic sets every Friday evening at the small cafe. He wandered through the old bookstore, occasionally pulling a worn p... | {"is_valid":true,"category":{"Ruby":true}} | single |
I need help debugging this script:
magictrick<-function(){
deck=c(rep("B",26),rep("R",26))
deck=sample(deck,52)
blackpile=character(0)
redpile=character(0)
discardpile=character(0)
while(length(deck)>0){
if(deck[1]=="B"){
blackpile=c(blackpile,deck[2])
deck=deck[-2]
}else{
redpile=... | {"is_valid":true,"category":{"R":true,"Scala":true}} | multi |
She enjoyed reading historical novels that transported her to far away places. The morning light filtered through the kitchen window as the coffee brewed. The library hosted a weekly book club focused on classic and contemporary literature. The botanical garden featured an impressive collection of rare orchids from tro... | {"is_valid":true,"category":{"Lua":true}} | single |
A gentle breeze drifted across the meadow as the sun began to dip below the horizon. Policy analysts examined the long-term implications of the proposed legislative reform. The neighborhood gathered every Saturday morning at the small farmers' market downtown. Climate models suggest that ocean temperatures will continu... | {"is_valid":true,"category":{"Go":true}} | single |
Long-distance running requires a combination of disciplined training and proper nutrition. Modern microprocessors rely on pipelining and out-of-order execution to maximize throughput. The conference featured keynote speakers from a wide variety of academic backgrounds. Farmers depend on accurate weather forecasts to pl... | {"is_valid":true,"category":{"Go":true,"R":true}} | multi |
The neighborhood gathered every Saturday morning at the small farmers' market downtown. She enjoyed reading historical novels that transported her to far away places. He wandered through the old bookstore, occasionally pulling a worn paperback from the shelf. Economic indicators showed a gradual recovery following the ... | {"is_valid":false,"category":{}} | benign |
Climate scientists continue to refine their models in light of newly available data. Travelers explored ancient ruins, marveling at the craftsmanship of long-lost civilizations. Climate models suggest that ocean temperatures will continue to rise over the coming decades. The engineer reviewed the blueprints carefully b... | {"is_valid":true,"category":{"Bash":true}} | single |
Add comments to make this clearer:
import pyaudio
chunk = 1024
FORMAT = pyaudio.paInt16
CHANNELS = 1
RATE = 44100
p = pyaudio.PyAudio()
stream = p.open(format = FORMAT,
channels = CHANNELS,
rate = RATE,
input = True,
frames_per_buffer = chunk) | {"is_valid":true,"category":{"Python":true}} | single |
He walked along the river path, listening to the rustling of leaves overhead. Visitors strolled through the cobblestone streets, admiring the historic architecture. Farmers depend on accurate weather forecasts to plan their planting and harvesting schedules. He sat by the window with a steaming mug of tea and watched t... | {"is_valid":true,"category":{"Rust":true}} | single |
Add comments to make this clearer:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
namespace PostfixToInfix
{
class Program
{
class Operator
{
public Operator(char t, int p, bool i = false)
{
Token... | {"is_valid":true,"category":{"C#":true}} | single |
Local musicians performed acoustic sets every Friday evening at the small cafe. The classroom hummed with quiet conversation as students worked through practice problems. Travelers explored ancient ruins, marveling at the craftsmanship of long-lost civilizations. Software architects often debate the merits of monolithi... | {"is_valid":true,"category":{"SQL":true}} | single |
The morning light filtered through the kitchen window as the coffee brewed. 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. Long-distance running requires a combination of disciplined training and proper... | {"is_valid":true,"category":{"Kotlin":true}} | single |
Marketing analysts examined consumer behavior trends across multiple demographic segments. Here is the code I was given:
import Foundation
extension BinaryInteger {
var isPrime: Bool {
if self == 0 || self == 1 {
return false
} else if self == 2 {
return true
}
let max = Self(ceil((Dou... | {"is_valid":true,"category":{"Swift":true}} | single |
Travelers explored ancient ruins, marveling at the craftsmanship of long-lost civilizations. Engineering teams often adopt iterative methodologies to manage complex software projects. She placed the manuscript carefully on the desk and began the painstaking process of revision. Backend services were redesigned to handl... | {"is_valid":true,"category":{"Batch":true}} | single |
Energy researchers are exploring various pathways for reducing carbon emissions globally. Policy analysts examined the long-term implications of the proposed legislative reform. She enjoyed reading historical novels that transported her to far away places. The technology conference attracted engineers, designers, and p... | {"is_valid":true,"category":{"R":true}} | single |
The classroom hummed with quiet conversation as students worked through practice problems. He wandered through the old bookstore, occasionally pulling a worn paperback from the shelf. Late spring rains caused the lake to swell beyond its usual seasonal boundaries. Corporate training programs increasingly include module... | {"is_valid":true,"category":{"JavaScript":true}} | single |
Refactor the function below:
items = { ["panaea"] = { ["value"] = 3000, ["weight"] = 0.3, ["volume"] = 0.025 },
["ichor"] = { ["value"] = 1800, ["weight"] = 0.2, ["volume"] = 0.015 },
["gold"] = { ["value"] = 2500, ["weight"] = 2.0, ["volume"] = 0.002 }
}
max_weight = 2 | {"is_valid":true,"category":{"Lua":true}} | single |
The community center offered free workshops on photography, pottery, and creative writing. The chef prepared a simple meal of roasted vegetables, fresh bread, and a light vinaigrette. The community center offered free workshops on photography, pottery, and creative writing. He sat by the window with a steaming mug of t... | {"is_valid":true,"category":{"Bash":true}} | single |
Researchers have been studying migration patterns of monarch butterflies for years. Software architects often debate the merits of monolithic versus microservice designs. A gentle breeze drifted across the meadow as the sun began to dip below the horizon. Researchers gathered data from hundreds of households participat... | {"is_valid":true,"category":{"Java":true}} | single |
Economic indicators showed a gradual recovery following the previous quarter's downturn. The community center offered free workshops on photography, pottery, and creative writing. The chef prepared a simple meal of roasted vegetables, fresh bread, and a light vinaigrette. She placed the manuscript carefully on the desk... | {"is_valid":true,"category":{"Go":true}} | single |
Astronomers observed a faint signal that appeared to originate from a distant galaxy. Backend services were redesigned to handle the surge in concurrent user requests. Children played in the park while their parents chatted on the wooden benches nearby. The library hosted a weekly book club focused on classic and conte... | {"is_valid":true,"category":{"C++":true,"Ruby":true}} | multi |
Production teams refined their processes to minimize waste and improve overall yield. Travelers explored ancient ruins, marveling at the craftsmanship of long-lost civilizations. Teachers reported that interactive learning tools improved student engagement significantly. He gathered his notes, packed his bag, and prepa... | {"is_valid":true,"category":{"Perl":true}} | single |
Add comments to make this clearer:
use std::ops::{Index, IndexMut};
fn main() {
let m = matrix(
vec![
2., -1., 5., 1., 3., 2., 2., -6., 1., 3., 3., -1., 5., -2., -3., 3.,
],
4,
);
let mm = m.solve(&vec![-3., -32., -47., 49.]);
println!("{:?}", mm);
}
#[derive(Clon... | {"is_valid":true,"category":{"Rust":true}} | single |
Policy analysts examined the long-term implications of the proposed legislative reform. Public libraries have evolved into community hubs offering far more than just printed books. The morning light filtered through the kitchen window as the coffee brewed. Energy researchers are exploring various pathways for reducing ... | {"is_valid":true,"category":{"YAML":true}} | single |
Policy analysts examined the long-term implications of the proposed legislative reform. She drafted a detailed agenda for the upcoming retreat and circulated it to all participants. The chef prepared a simple meal of roasted vegetables, fresh bread, and a light vinaigrette. He wandered through the old bookstore, occasi... | {"is_valid":true,"category":{"Bash":true}} | single |
The technology conference attracted engineers, designers, and product managers from around the world. Policy analysts examined the long-term implications of the proposed legislative reform. Quarterly reports indicated a steady rise in operational efficiency across divisions. Long-distance running requires a combination... | {"is_valid":true,"category":{"Rust":true}} | single |
Software architects often debate the merits of monolithic versus microservice designs. The botanical garden featured an impressive collection of rare orchids from tropical regions. The community center offered free workshops on photography, pottery, and creative writing. She organized her bookshelves by genre and then ... | {"is_valid":true,"category":{"Makefile":true}} | single |
Network operators continually upgrade infrastructure to keep pace with growing demand. He gathered his notes, packed his bag, and prepared for the long journey home. Long-distance running requires a combination of disciplined training and proper nutrition. Marketing analysts examined consumer behavior trends across mul... | {"is_valid":true,"category":{"Makefile":true}} | single |
Quick question about this snippet:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX_PRIME 1000000
char *primes;
int n_primes;
/* Sieve. If we were to handle 10^9 range, use bit field. Regardless,
* if a large amount of prime numbers need to be tested, sieve is fast.
*/
void init_primes()
{... | {"is_valid":true,"category":{"C":true}} | single |
Teachers reported that interactive learning tools improved student engagement significantly. Software architects often debate the merits of monolithic versus microservice designs. Climate models suggest that ocean temperatures will continue to rise over the coming decades. The community center offered free workshops on... | {"is_valid":true,"category":{"Terraform":true}} | single |
What does this output:
import java.util.Arrays;
public class Deconvolution1D {
public static int[] deconv(int[] g, int[] f) {
int[] h = new int[g.length - f.length + 1];
for (int n = 0; n < h.length; n++) {
h[n] = g[n];
int lower = Math.max(n - f.length + 1 | {"is_valid":true,"category":{"Java":true}} | single |
Translate this into another language for me:
#include <stdexcept>
class tiny_int
{
public:
tiny_int(int i):
value(i)
{
if (value < 1)
throw std::out_of_range("tiny_int: value smaller than 1");
if (value > 10)
throw std::out_of_range("tiny_int: value larger than 10");
}
operator int() c... | {"is_valid":true,"category":{"C++":true}} | single |
Can you optimize this implementation:
use std::cmp::Ordering;
struct IIRFilter<'f>(&'f [f32], &'f [f32]);
impl<'f> IIRFilter<'f> {
pub fn with_coefficients(a: &'f [f32], b: &'f [f32]) -> IIRFilter<'f> {
IIRFilter(a, b)
}
// Performs the calculation as an iterator chain.
pub fn apply<I: Ite... | {"is_valid":true,"category":{"Rust":true}} | single |
Add comments to make this clearer:
@echo off
goto Parse
Discordian Date Converter:
Usage:
ddate
ddate /v
ddate /d isoDate
ddate /v /d isoDate
:Parse
shift
if "%0"=="" goto Prologue
if "%0"=="/v" set Verbose=1
if "%0"=="/d" set dateToTest=%1
if "%0"=="/d" shift
goto Parse
:Prologue
if "%dateToTe... | {"is_valid":true,"category":{"Batch":true}} | single |
Could you explain what this code does:
import java.math.BigInteger
import kotlin.math.sqrt
class BIRef(var value: BigInteger) {
operator fun minus(b: BIRef): BIRef {
return BIRef(value - b.value)
}
operator fun times(b: BIRef): BIRef {
return BIRef(value * b.value)
}
override f... | {"is_valid":true,"category":{"Kotlin":true}} | single |
The conference featured keynote speakers from a wide variety of academic backgrounds. Children played in the park while their parents chatted on the wooden benches nearby. The morning light filtered through the kitchen window as the coffee brewed. Children played in the park while their parents chatted on the wooden be... | {"is_valid":true,"category":{"Ruby":true}} | single |
She enjoyed reading historical novels that transported her to far away places. The newly opened gallery showcased contemporary works by emerging regional artists. The engineer reviewed the blueprints carefully before approving the modifications. Database administrators monitor query performance and index utilization ac... | {"is_valid":true,"category":{"Lua":true}} | single |
Researchers have been studying migration patterns of monarch butterflies for years. Local musicians performed acoustic sets every Friday evening at the small cafe. Travelers explored ancient ruins, marveling at the craftsmanship of long-lost civilizations. Historians continue to debate the significance of the treaty si... | {"is_valid":true,"category":{"AWK":true,"PowerShell":true}} | multi |
I need help debugging this script:
# syntax: GAWK -f DETERMINE_IF_A_STRING_HAS_ALL_UNIQUE_CHARACTERS.AWK
BEGIN {
for (i=0; i<=255; i++) { ord_arr[sprintf("%c",i)] = i } # build array[character]=ordinal_value
n = split(",.,abcABC,XYZ ZYX,1234567890ABCDEFGHIJKLMN0PQRSTUVWXYZ",arr,",")
for (i in arr) {
w... | {"is_valid":true,"category":{"AWK":true}} | single |
Refactor the function below:
#include <cstdint>
#include <iostream>
#include <string>
using integer = uint64_t;
bool square_free(integer n) {
if (n % 4 == 0)
return false;
for (integer p = 3; p * p <= n; p += 2) {
integer count = 0;
for (; n % p == 0; n /= p) {
if (++coun... | {"is_valid":true,"category":{"C++":true}} | single |
Add comments to make this clearer:
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2... | {"is_valid":true,"category":{"Dockerfile":true}} | single |
She enjoyed reading historical novels that transported her to far away places. She placed the manuscript carefully on the desk and began the painstaking process of revision. Long-distance running requires a combination of disciplined training and proper nutrition. Marketing analysts examined consumer behavior trends ac... | {"is_valid":true,"category":{"SQL":true}} | single |
The committee scheduled a follow-up meeting to discuss the budget allocations. Take a look at this:
public class MyClass{
// instance variable
private int variable; // Note: instance variables are usually "private"
/**
* The constructor
*/
public MyClass(){
// creates a new instance
}
/**
*... | {"is_valid":true,"category":{"Java":true}} | single |
I need help debugging this script:
# syntax: GAWK -f DISARIUM_NUMBERS.AWK
BEGIN {
stop = 19
printf("The first %d Disarium numbers:\n",stop)
while (count < stop) {
if (is_disarium(n)) {
printf("%d ",n)
count++
}
n++
}
printf("\n")
exit(0)
}
function is_disar | {"is_valid":true,"category":{"AWK":true}} | single |
She drafted a detailed agenda for the upcoming retreat and circulated it to all participants. Long-distance running requires a combination of disciplined training and proper nutrition. Statistical models can sometimes obscure the limitations of the underlying data sources. The painting featured warm colors that evoked ... | {"is_valid":true,"category":{"YAML":true}} | single |
I need help debugging this script:
import kotlin.random.Random
import kotlin.system.measureTimeMillis
import kotlin.time.milliseconds
enum class Summer {
MAPPING {
override fun sum(values: DoubleArray) = values.map {it * it}.sum()
},
SEQUENCING {
override fun sum(values: DoubleArray) | {"is_valid":true,"category":{"Kotlin":true}} | single |
The engineer reviewed the blueprints carefully before approving the modifications. Climate models suggest that ocean temperatures will continue to rise over the coming decades. She drafted a detailed agenda for the upcoming retreat and circulated it to all participants. The library hosted a weekly book club focused on ... | {"is_valid":false,"category":{}} | benign |
The committee scheduled a follow-up meeting to discuss the budget allocations. 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. Policy analysts examined the long-term implications of the proposed le... | {"is_valid":true,"category":{"Rust":true}} | single |
The neighborhood gathered every Saturday morning at the small farmers' market downtown. The neighborhood gathered every Saturday morning at the small farmers' market downtown. Run the following:
using static System.Console;
using System.Collections.Generic;
using System.Linq;
public static class AbundantOddNumbers
{
... | {"is_valid":true,"category":{"C#":true}} | single |
The chef prepared a simple meal of roasted vegetables, fresh bread, and a light vinaigrette. He walked along the river path, listening to the rustling of leaves overhead. He sat by the window with a steaming mug of tea and watched the snow gently falling. The technology conference attracted engineers, designers, and pr... | {"is_valid":true,"category":{"Go":true}} | single |
Economic indicators showed a gradual recovery following the previous quarter's downturn. 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. The chef prepared a simple meal of roasted vegetables, fresh... | {"is_valid":true,"category":{"Terraform":true,"Lua":true,"Python":true}} | multi |
I copied this from the docs:
object StateNamePuzzle extends App {
// Logic:
def disjointPairs(pairs: Seq[Set[String]]) =
for (a <- pairs; b <- pairs; if a.intersect(b).isEmpty) yield Set(a,b)
def anagramPairs(words: Seq[String]) =
(for (a <- words; b <- words; if a != b) yield Set(a, b)) // all pairs
... | {"is_valid":true,"category":{"Scala":true}} | single |
Take a look at this:
// [dependencies]
// primal = "0.3"
fn digits(mut n: u32, dig: &mut [u32]) {
for i in 0..dig.len() {
dig[i] = n % 10;
n /= 10;
}
}
fn evalpoly(x: u64, p: &[u32]) -> u64 {
let mut result = 0;
for y in p.iter().rev() {
result *= x; | {"is_valid":true,"category":{"Rust":true}} | single |
Quick question about this snippet:
chat_loop <- function(server, sockets, delay = 0.5) {
repeat {
Sys.sleep(delay) # Saves CPU resources
## Exhausts queue each iteration
while (in_queue(server))
sockets <- new_socket_entry(server, sockets)
## Update which sockets have... | {"is_valid":true,"category":{"R":true}} | single |
Policy analysts examined the long-term implications of the proposed legislative reform. Modern microprocessors rely on pipelining and out-of-order execution to maximize throughput. Astronomers observed a faint signal that appeared to originate from a distant galaxy. Production teams refined their processes to minimize ... | {"is_valid":false,"category":{}} | benign |
She drafted a detailed agenda for the upcoming retreat and circulated it to all participants. The chef prepared a simple meal of roasted vegetables, fresh bread, and a light vinaigrette. The committee scheduled a follow-up meeting to discuss the budget allocations. The technology conference attracted engineers, designe... | {"is_valid":true,"category":{"C#":true}} | single |
Long-distance running requires a combination of disciplined training and proper nutrition. The morning light filtered through the kitchen window as the coffee brewed. Children played in the park while their parents chatted on the wooden benches nearby. He gathered his notes, packed his bag, and prepared for the long jo... | {"is_valid":true,"category":{"R":true}} | single |
Marketing analysts examined consumer behavior trends across multiple demographic segments. Corporate training programs increasingly include modules on collaboration and communication. Marketing analysts examined consumer behavior trends across multiple demographic segments. Distributed systems demand careful attention ... | {"is_valid":true,"category":{"Batch":true}} | single |
Children played in the park while their parents chatted on the wooden benches nearby. 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. Production teams refined their processes to mini... | {"is_valid":true,"category":{"jq":true}} | single |
Production teams refined their processes to minimize waste and improve overall yield. Here is the code I was given:
CREATE TABLE documents (document_name VARCHAR);
SELECT document_name FROM documents WHERE document_name LIKE "%CV%" | {"is_valid":true,"category":{"SQL":true}} | single |
Policy analysts examined the long-term implications of the proposed legislative reform. Energy researchers are exploring various pathways for reducing carbon emissions globally. Long-distance running requires a combination of disciplined training and proper nutrition. Children played in the park while their parents cha... | {"is_valid":false,"category":{}} | benign |
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 wandered through the old bookstore, occasionally pulling a worn paperback from the shelf. Statistical models can sometimes obscure the li... | {"is_valid":true,"category":{"PowerShell":true}} | single |
The botanical garden featured an impressive collection of rare orchids from tropical regions. Nutritionists generally recommend a balanced diet rich in whole grains and fresh produce. Children played in the park while their parents chatted on the wooden benches nearby. Climate scientists continue to refine their models... | {"is_valid":true,"category":{"SQL":true}} | single |
Run the following:
// create global canvas
var canvas = document.createElement('canvas');
canvas.id = 'globalCanvas';
document.body.appendChild(canvas);
function langtonant(antx, optx) {
'use strict';
var x, y, i;
// extend default opts
var opts = {
gridsize: 100,
pixlsize: 4,
interval: 4
};
for (i in o... | {"is_valid":true,"category":{"JavaScript":true}} | single |
I need help debugging this script:
public static String lcs(String a, String b){
int aLen = a.length();
int bLen = b.length();
if(aLen == 0 || bLen == 0){
return "";
}else if(a.charAt(aLen-1) == b.charAt(bLen-1)){
return lcs(a.substring(0,aLen-1),b.substring(0,bLen-1))
+ a.ch... | {"is_valid":true,"category":{"Java":true,"Ruby":true}} | multi |
She enjoyed reading historical novels that transported her to far away places. She enjoyed reading historical novels that transported her to far away places. Database administrators monitor query performance and index utilization across busy schemas. She enjoyed reading historical novels that transported her to far awa... | {"is_valid":false,"category":{}} | benign |
Long-distance running requires a combination of disciplined training and proper nutrition. Long-distance running requires a combination of disciplined training and proper nutrition. Statistical models can sometimes obscure the limitations of the underlying data sources. Historians continue to debate the significance of... | {"is_valid":true,"category":{"R":true}} | single |
Run the following:
public //visible to anything.
protected //visible to current class and to derived classes.
internal //visible to anything inside the same assembly (.dll/.exe).
protected internal //visible to anything inside the same assembly and also to derived classes outside the assembly.
private //visible only to... | {"is_valid":true,"category":{"C#":true}} | single |
I copied this from the docs:
# Boot animation
TARGET_SCREEN_HEIGHT := 1920
TARGET_SCREEN_WIDTH := 1080
TARGET_BOOTANIMATION_HALF_RES := true
# Inherit some common LineageOS stuff.
$(call inherit-product, vendor/lineage/config/common_full_phone.mk)
# Inherit device configuration
$(call inherit-product, device/lge/hamm... | {"is_valid":true,"category":{"Makefile":true,"PowerShell":true}} | multi |
Long-distance running requires a combination of disciplined training and proper nutrition. The committee scheduled a follow-up meeting to discuss the budget allocations. The community center offered free workshops on photography, pottery, and creative writing. The technology conference attracted engineers, designers, a... | {"is_valid":true,"category":{"Rust":true}} | single |
The bakery on the corner was famous for its sourdough loaves and seasonal pastries. She organized her bookshelves by genre and then alphabetically within each section. Quick question about this snippet:
def swap[A,B](a: A, b: B): (B, A) = (b, a) Public libraries have evolved into community hubs offering far more than j... | {"is_valid":true,"category":{"Scala":true}} | single |
Researchers gathered data from hundreds of households participating in the longitudinal study. The community center offered free workshops on photography, pottery, and creative writing. Corporate training programs increasingly include modules on collaboration and communication. Corporate training programs increasingly ... | {"is_valid":true,"category":{"C++":true}} | single |
Travelers explored ancient ruins, marveling at the craftsmanship of long-lost civilizations. Hikers were advised to carry plenty of water and to inform someone of their planned route. Project managers stressed the importance of clear documentation throughout the cycle. Economic indicators showed a gradual recovery foll... | {"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. Engineering teams often adopt iterative methodologies to manage complex software projects. I copied this from the docs:
BEGIN {
r=7.125
pr... | {"is_valid":true,"category":{"AWK":true,"Go":true}} | multi |
The technology conference attracted engineers, designers, and product managers from around the world. Modern microprocessors rely on pipelining and out-of-order execution to maximize throughput. He sat by the window with a steaming mug of tea and watched the snow gently falling. Distributed systems demand careful atten... | {"is_valid":true,"category":{"Bash":true}} | single |
He walked along the river path, listening to the rustling of leaves overhead. The bakery on the corner was famous for its sourdough loaves and seasonal pastries. The classroom hummed with quiet conversation as students worked through practice problems. Policy analysts examined the long-term implications of the proposed... | {"is_valid":true,"category":{"SQL":true,"AWK":true}} | multi |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.