prompt large_stringlengths 150 7.97k | target large_stringlengths 32 83 | kind large_stringclasses 3
values |
|---|---|---|
Statistical models can sometimes obscure the limitations of the underlying data sources. The painting featured warm colors that evoked memories of childhood summers by the sea. Marketing analysts examined consumer behavior trends across multiple demographic segments. Could you explain what this code does:
if ($null -eq... | {"is_valid":true,"category":{"PowerShell":true,"C++":true}} | multi |
Add comments to make this clearer:
object LastLetterFirstLetterNaive extends App {
def solve(names: Set[String]) = {
def extend(solutions: List[List[String]]): List[List[String]] = {
val more = solutions.flatMap{solution =>
val lastLetter = solution.head takeRight 1
(names -- solution).filte... | {"is_valid":true,"category":{"Scala":true}} | single |
The chef prepared a simple meal of roasted vegetables, fresh bread, and a light vinaigrette. She organized her bookshelves by genre and then alphabetically within each section. Travelers explored ancient ruins, marveling at the craftsmanship of long-lost civilizations. Statistical models can sometimes obscure the limit... | {"is_valid":true,"category":{"Scala":true,"Go":true}} | multi |
Quick question about this snippet:
use feature 'say';
use ntheory qw/forsetproduct/;
# Deconvolution of N dimensional matrices
sub deconvolve_N {
our @g; local *g = shift;
our @f; local *f = shift;
my @df = shape(@f);
my @dg = shape(@g);
my @hsize;
push @hsize, $dg[$_] - $df[$_] + 1 for 0..$#d... | {"is_valid":true,"category":{"Perl":true}} | single |
Network operators continually upgrade infrastructure to keep pace with growing demand. Late spring rains caused the lake to swell beyond its usual seasonal boundaries. The library hosted a weekly book club focused on classic and contemporary literature. Database administrators monitor query performance and index utiliz... | {"is_valid":true,"category":{"JavaScript":true}} | single |
Local potters fired their kilns once a month, producing colorful ceramics for the shops. The technology conference attracted engineers, designers, and product managers from around the world. Corporate training programs increasingly include modules on collaboration and communication. She drafted a detailed agenda for th... | {"is_valid":true,"category":{"C++":true}} | single |
Visitors strolled through the cobblestone streets, admiring the historic architecture. Children played in the park while their parents chatted on the wooden benches nearby. He walked along the river path, listening to the rustling of leaves overhead. The conference featured keynote speakers from a wide variety of acade... | {"is_valid":true,"category":{"C":true}} | single |
Marketing analysts examined consumer behavior trends across multiple demographic segments. The neighborhood gathered every Saturday morning at the small farmers' market downtown. Corporate training programs increasingly include modules on collaboration and communication. She drafted a detailed agenda for the upcoming r... | {"is_valid":false,"category":{}} | benign |
The newly opened gallery showcased contemporary works by emerging regional artists. Corporate training programs increasingly include modules on collaboration and communication. Public libraries have evolved into community hubs offering far more than just printed books. Translate this into another language for me:
from ... | {"is_valid":true,"category":{"Python":true}} | single |
The classroom hummed with quiet conversation as students worked through practice problems. Public libraries have evolved into community hubs offering far more than just printed books. Modern microprocessors rely on pipelining and out-of-order execution to maximize throughput. Children played in the park while their par... | {"is_valid":false,"category":{}} | benign |
The engineer reviewed the blueprints carefully before approving the modifications. 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. Volunteers spent the weekend cleaning up the river... | {"is_valid":true,"category":{"Bash":true}} | single |
Engineering teams often adopt iterative methodologies to manage complex software projects. Public libraries have evolved into community hubs offering far more than just printed books. Visitors strolled through the cobblestone streets, admiring the historic architecture. The neighborhood gathered every Saturday morning ... | {"is_valid":true,"category":{"Terraform":true}} | single |
Here is the code I was given:
data "aws_ami" "ubuntu" {
most_recent = true
owners = ["099720109477"]
filter {
name = "name"
values = ["ubuntu-minimal/images/hvm-ssd/ubuntu-focal-20.04-amd64-minimal-*"]
}
filter {
name = "virtualization-type"
value | {"is_valid":true,"category":{"Terraform":true}} | single |
Distributed systems demand careful attention to consistency, availability, and partition tolerance. Production teams refined their processes to minimize waste and improve overall yield. Production teams refined their processes to minimize waste and improve overall yield. The community center offered free workshops on p... | {"is_valid":true,"category":{"Dockerfile":true}} | single |
Run the following:
# 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.0 (the
# "Licen... | {"is_valid":true,"category":{"Dockerfile":true}} | single |
Database administrators monitor query performance and index utilization across busy schemas. Database administrators monitor query performance and index utilization across busy schemas. Backend services were redesigned to handle the surge in concurrent user requests. The botanical garden featured an impressive collecti... | {"is_valid":false,"category":{}} | benign |
Please review the following snippet for issues:
use std::net::{TcpListener, TcpStream};
use std::io::{BufReader, BufRead, Write};
use std::thread;
fn main() {
let listener = TcpListener::bind("127.0.0.1:12321").unwrap();
println!("server is running on 127.0.0.1:12321 ...");
for stream in listener.incomi... | {"is_valid":true,"category":{"Rust":true}} | single |
Translate this into another language for me:
# src/backend/nls.mk
CATALOG_NAME = postgres
AVAIL_LANGUAGES = de es fr it ja pl pt_BR ru zh_CN zh_TW
GETTEXT_FILES = + gettext-files
GETTEXT_TRIGGERS = $(BACKEND_COMMON_GETTEXT_TRIGGERS) \
GUC_check_errmsg GUC_check_errdetail GUC_check_errhint \
write_stderr... | {"is_valid":true,"category":{"Makefile":true}} | single |
Astronomers observed a faint signal that appeared to originate from a distant galaxy. The committee scheduled a follow-up meeting to discuss the budget allocations. She organized her bookshelves by genre and then alphabetically within each section. Backend services were redesigned to handle the surge in concurrent user... | {"is_valid":true,"category":{"Kotlin":true,"C++":true}} | multi |
Researchers have been studying migration patterns of monarch butterflies for years. Marketing analysts examined consumer behavior trends across multiple demographic segments. Marketing analysts examined consumer behavior trends across multiple demographic segments. Visitors strolled through the cobblestone streets, adm... | {"is_valid":false,"category":{}} | benign |
A gentle breeze drifted across the meadow as the sun began to dip below the horizon. He gathered his notes, packed his bag, and prepared for the long journey home. Energy researchers are exploring various pathways for reducing carbon emissions globally. Policy analysts examined the long-term implications of the propose... | {"is_valid":true,"category":{"Rust":true}} | single |
Statistical models can sometimes obscure the limitations of the underlying data sources. The morning light filtered through the kitchen window as the coffee brewed. 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... | {"is_valid":true,"category":{"Bash":true}} | single |
Farmers depend on accurate weather forecasts to plan their planting and harvesting schedules. The chef prepared a simple meal of roasted vegetables, fresh bread, and a light vinaigrette. Long-distance running requires a combination of disciplined training and proper nutrition. He gathered his notes, packed his bag, and... | {"is_valid":false,"category":{}} | benign |
Production teams refined their processes to minimize waste and improve overall yield. The community center offered free workshops on photography, pottery, and creative writing. The neighborhood gathered every Saturday morning at the small farmers' market downtown. Quality assurance teams collaborate closely with develo... | {"is_valid":true,"category":{"SQL":true}} | single |
Late spring rains caused the lake to swell beyond its usual seasonal boundaries. Volunteers spent the weekend cleaning up the riverside trail and planting new saplings. She enjoyed reading historical novels that transported her to far away places. The technology conference attracted engineers, designers, and product ma... | {"is_valid":true,"category":{"Lua":true}} | single |
The technology conference attracted engineers, designers, and product managers from around the world. Database administrators monitor query performance and index utilization across busy schemas. The morning light filtered through the kitchen window as the coffee brewed. Database administrators monitor query performance... | {"is_valid":true,"category":{"Scala":true}} | single |
Backend services were redesigned to handle the surge in concurrent user requests. He adjusted the telescope and waited patiently for the clouds to clear over the observatory. Astronomers observed a faint signal that appeared to originate from a distant galaxy. Hikers were advised to carry plenty of water and to inform ... | {"is_valid":true,"category":{"AWK":true}} | single |
Climate models suggest that ocean temperatures will continue to rise over the coming decades. Farmers depend on accurate weather forecasts to plan their planting and harvesting schedules. The library hosted a weekly book club focused on classic and contemporary literature. The morning light filtered through the kitchen... | {"is_valid":true,"category":{"Perl":true}} | single |
Backend services were redesigned to handle the surge in concurrent user requests. The committee scheduled a follow-up meeting to discuss the budget allocations. Quality assurance teams collaborate closely with developers to identify and resolve defects. Backend services were redesigned to handle the surge in concurrent... | {"is_valid":true,"category":{"Lua":true}} | single |
The classroom hummed with quiet conversation as students worked through practice problems. Run the following:
@echo off
choice
if errorlevel 2 echo You chose N
if errorlevel 1 echo You chose Y
>nul pause | {"is_valid":true,"category":{"Batch":true}} | single |
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. She organized her bookshelves by genre and then alphabetically within each section. Engineering teams often adopt iterative methodologies to manage c... | {"is_valid":true,"category":{"Python":true}} | single |
Farmers depend on accurate weather forecasts to plan their planting and harvesting schedules. She drafted a detailed agenda for the upcoming retreat and circulated it to all participants. Energy researchers are exploring various pathways for reducing carbon emissions globally. Translate this into another language for m... | {"is_valid":true,"category":{"C":true}} | single |
Please review the following snippet for issues:
--if-then-elseif-then-else
if a then
b()
elseif c then
d()
else
e()
end
for var = start, _end, step do --note: end is a reserved word
something()
end
for var, var2, etc in iteratorfunction do
something()
end
while somethingistrue() do
something()
end
r... | {"is_valid":true,"category":{"Lua":true}} | single |
Take a look at this:
#include <iostream>
#include <vector>
int turn(int base, int n) {
int sum = 0;
while (n != 0) {
int rem = n % base;
n = n / base;
sum += rem;
}
return sum % base;
}
void fairshare(int base, int count) {
printf("Base %2d:", base);
for (int i = 0; i... | {"is_valid":true,"category":{"C++":true}} | single |
I copied this from the docs:
// Merge Sort in Swift 4.2
// Source: https://github.com/raywenderlich/swift-algorithm-club/tree/master/Merge%20Sort
// NOTE: by use of generics you can make it sort arrays of any type that conforms to
// Comparable protocol, however this is not always optimal
import Foundation
fu... | {"is_valid":true,"category":{"Swift":true}} | single |
Policy analysts examined the long-term implications of the proposed legislative reform. The committee scheduled a follow-up meeting to discuss the budget allocations. Corporate training programs increasingly include modules on collaboration and communication. Researchers have been studying migration patterns of monarch... | {"is_valid":true,"category":{"Swift":true}} | single |
He walked along the river path, listening to the rustling of leaves overhead. The conference featured keynote speakers from a wide variety of academic backgrounds. Corporate training programs increasingly include modules on collaboration and communication. The painting featured warm colors that evoked memories of child... | {"is_valid":true,"category":{"YAML":true}} | single |
Researchers have been studying migration patterns of monarch butterflies for years. Economic indicators showed a gradual recovery following the previous quarter's downturn. Climate scientists continue to refine their models in light of newly available data. Run the following:
mat <- rbind(c(1,3,7,8,10),
c(... | {"is_valid":true,"category":{"R":true}} | single |
The garden looked particularly vibrant after the recent rain. Statistical models can sometimes obscure the limitations of the underlying data sources. Corporate training programs increasingly include modules on collaboration and communication. The painting featured warm colors that evoked memories of childhood summers ... | {"is_valid":true,"category":{"R":true,"Rust":true}} | multi |
Please review the following snippet for issues:
// version 1.1.2
import java.awt.*
import java.awt.geom.Path2D
import javax.swing.*
class PythagorasTree : JPanel() {
val depthLimit = 7
val hue = 0.15f
init {
preferredSize = Dimension(640, 640)
background = Color.white
}
priva... | {"is_valid":true,"category":{"Kotlin":true}} | single |
The newly opened gallery showcased contemporary works by emerging regional artists. Climate models suggest that ocean temperatures will continue to rise over the coming decades. Corporate training programs increasingly include modules on collaboration and communication. Farmers depend on accurate weather forecasts to p... | {"is_valid":true,"category":{"JavaScript":true}} | single |
Can you optimize this implementation:
import java.awt.*;
import static java.lang.Math.*;
import javax.swing.*;
public class ArchimedeanSpiral extends JPanel {
public ArchimedeanSpiral() {
setPreferredSize(new Dimension(640, 640));
setBackground(Color.white);
}
void drawGrid(Graphics2D ... | {"is_valid":true,"category":{"Java":true}} | single |
Marketing analysts examined consumer behavior trends across multiple demographic segments. Find any security problems in:
val s = "World" // Immutables are recommended //> s : String = World
val f2 = () => ", " //Function assigned to variable
//> f2 : () => String... | {"is_valid":true,"category":{"Scala":true,"Ruby":true}} | multi |
Local musicians performed acoustic sets every Friday evening at the small cafe. Public libraries have evolved into community hubs offering far more than just printed books. Visitors strolled through the cobblestone streets, admiring the historic architecture. Long-distance running requires a combination of disciplined ... | {"is_valid":false,"category":{}} | benign |
I copied this from the docs:
###############################################################################
# This is where all of the top-level, project-specific information is supplied.
HIDE_SYMS = 1
VISIBILITY_HIDDEN = $(if $(HIDE_SYMS),-fvisibility=hidden,)
CFLAGS += -MMD -MP -m64 -Wall -Wpedantic
CXXFL... | {"is_valid":true,"category":{"Makefile":true,"Rust":true,"Dockerfile":true}} | multi |
The morning light filtered through the kitchen window as the coffee brewed. Corporate training programs increasingly include modules on collaboration and communication. Production teams refined their processes to minimize waste and improve overall yield. Nutritionists generally recommend a balanced diet rich in whole g... | {"is_valid":true,"category":{"jq":true}} | single |
Teachers reported that interactive learning tools improved student engagement significantly. Historians continue to debate the significance of the treaty signed in that pivotal year. Policy analysts examined the long-term implications of the proposed legislative reform. What does this output:
# This functionality canno... | {"is_valid":true,"category":{"Terraform":true}} | single |
Here is the code I was given:
function next_in_cycle(c,length,index)
local pos = index % length
return c[pos]
end
function kolakoski(c,s,clen,slen)
local i = 0
local k = 0
while true do
s[i] = next_in_cycle(c,clen,k)
if s[k] > 1 then
for j=1,s[k]-1 do
... | {"is_valid":true,"category":{"Lua":true}} | single |
She enjoyed reading historical novels that transported her to far away places. Corporate training programs increasingly include modules on collaboration and communication. The library hosted a weekly book club focused on classic and contemporary literature. She organized her bookshelves by genre and then alphabetically... | {"is_valid":true,"category":{"Terraform":true}} | single |
She placed the manuscript carefully on the desk and began the painstaking process of revision. Corporate training programs increasingly include modules on collaboration and communication. She drafted a detailed agenda for the upcoming retreat and circulated it to all participants. Historians continue to debate the sign... | {"is_valid":false,"category":{}} | benign |
The technology conference attracted engineers, designers, and product managers from around the world. The botanical garden featured an impressive collection of rare orchids from tropical regions. Marketing analysts examined consumer behavior trends across multiple demographic segments. The neighborhood gathered every S... | {"is_valid":true,"category":{"C#":true,"Scala":true,"AWK":true}} | multi |
Policy analysts examined the long-term implications of the proposed legislative reform. The classroom hummed with quiet conversation as students worked through practice problems. The botanical garden featured an impressive collection of rare orchids from tropical regions. Production teams refined their processes to min... | {"is_valid":true,"category":{"R":true}} | single |
The garden looked particularly vibrant after the recent rain. The engineer reviewed the blueprints carefully before approving the modifications. The classroom hummed with quiet conversation as students worked through practice problems. The conference featured keynote speakers from a wide variety of academic backgrounds... | {"is_valid":true,"category":{"Batch":true,"Bash":true}} | multi |
Translate this into another language for me:
function array1D(a, d)
local m = {}
for i=1,a do
table.insert(m, d)
end
return m
end
function array2D(a, b, d)
local m = {}
for i=1,a do
table.insert(m, array1D(b, d))
end
return m
end
function fromBase3(num)
local out ... | {"is_valid":true,"category":{"Lua":true,"Perl":true,"Batch":true}} | multi |
Volunteers spent the weekend cleaning up the riverside trail and planting new saplings. Quick question about this snippet:
using System;
using System.Collections;
using System.Collections.Generic;
namespace SieveOfEratosthenes
{
class Program
{
static void Main(string[] args)
{
int... | {"is_valid":true,"category":{"C#":true}} | single |
Nutritionists generally recommend a balanced diet rich in whole grains and fresh produce. Take a look at this:
from cmath import rect, phase
from math import radians, degrees
def mean_angle(deg):
return degrees(phase(sum(rect(1, radians(d)) for d in deg)/len(deg)))
def mean_time(times):
t = (time.split(':... | {"is_valid":true,"category":{"Python":true,"Rust":true}} | multi |
Local musicians performed acoustic sets every Friday evening at the small cafe. Astronomers observed a faint signal that appeared to originate from a distant galaxy. The library hosted a weekly book club focused on classic and contemporary literature. Travelers explored ancient ruins, marveling at the craftsmanship of ... | {"is_valid":true,"category":{"Python":true}} | single |
Climate models suggest that ocean temperatures will continue to rise over the coming decades. Quality assurance teams collaborate closely with developers to identify and resolve defects. Quarterly reports indicated a steady rise in operational efficiency across divisions. The chef prepared a simple meal of roasted vege... | {"is_valid":true,"category":{"Ruby":true,"Batch":true}} | multi |
Distributed systems demand careful attention to consistency, availability, and partition tolerance. Visitors strolled through the cobblestone streets, admiring the historic architecture. Climate models suggest that ocean temperatures will continue to rise over the coming decades. He sat by the window with a steaming mu... | {"is_valid":false,"category":{}} | benign |
Researchers gathered data from hundreds of households participating in the longitudinal study. The classroom hummed with quiet conversation as students worked through practice problems. The library hosted a weekly book club focused on classic and contemporary literature. Hikers were advised to carry plenty of water and... | {"is_valid":true,"category":{"C":true}} | single |
Volunteers spent the weekend cleaning up the riverside trail and planting new saplings. Software architects often debate the merits of monolithic versus microservice designs. He walked along the river path, listening to the rustling of leaves overhead. Teachers reported that interactive learning tools improved student ... | {"is_valid":true,"category":{"Terraform":true}} | single |
Add comments to make this clearer:
# syntax: GAWK -f SUPERPERMUTATION_MINIMISATION.AWK
# converted from C
BEGIN {
arr[0] # prevents fatal: attempt to use scalar 'arr' as an array
limit = 11
for (n=0; n<=limit; n++) {
leng = super_perm(n)
printf("%2d %d ",n,leng)
# for (i=0; i<length(arr); i+... | {"is_valid":true,"category":{"AWK":true}} | single |
Add comments to make this clearer:
/* Known to compile and work with tcc in win32 & gcc on Linux (with warnings)
------------------------------------------------------------------------------
readable.c: My random number generator, ISAAC.
(c) Bob Jenkins, March 1996, Public Domain
You may use this code in any way you w... | {"is_valid":true,"category":{"C":true}} | single |
Policy analysts examined the long-term implications of the proposed legislative reform. Hikers were advised to carry plenty of water and to inform someone of their planned route. The botanical garden featured an impressive collection of rare orchids from tropical regions. He adjusted the telescope and waited patiently ... | {"is_valid":true,"category":{"Kotlin":true,"C":true}} | multi |
He adjusted the telescope and waited patiently for the clouds to clear over the observatory. Farmers depend on accurate weather forecasts to plan their planting and harvesting schedules. Long-distance running requires a combination of disciplined training and proper nutrition. Policy analysts examined the long-term imp... | {"is_valid":true,"category":{"JavaScript":true}} | single |
Take a look at this:
# $PostgreSQL: pgsql/src/pl/plpgsql/src/nls.mk,v 1.5 2009/02/17 12:59:35 petere Exp $
CATALOG_NAME := plpgsql
AVAIL_LANGUAGES := es
GETTEXT_FILES := pl_comp.c pl_exec.c pl_gram.c pl_funcs.c pl_handler.c pl_scan.c
GETTEXT_TRIGGERS:= _ errmsg errdetail errdetail_log errhint errcontext validate_tupdes... | {"is_valid":true,"category":{"Makefile":true}} | single |
Travelers explored ancient ruins, marveling at the craftsmanship of long-lost civilizations. Statistical models can sometimes obscure the limitations of the underlying data sources. Historians continue to debate the significance of the treaty signed in that pivotal year. He walked along the river path, listening to the... | {"is_valid":true,"category":{"Dockerfile":true,"Ruby":true,"Rust":true}} | multi |
Production teams refined their processes to minimize waste and improve overall yield. She drafted a detailed agenda for the upcoming retreat and circulated it to all participants. Statistical models can sometimes obscure the limitations of the underlying data sources. He gathered his notes, packed his bag, and prepared... | {"is_valid":true,"category":{"C#":true}} | single |
Statistical models can sometimes obscure the limitations of the underlying data sources. Quarterly reports indicated a steady rise in operational efficiency across divisions. Astronomers observed a faint signal that appeared to originate from a distant galaxy. The garden looked particularly vibrant after the recent rai... | {"is_valid":false,"category":{}} | benign |
She drafted a detailed agenda for the upcoming retreat and circulated it to all participants. She enjoyed reading historical novels that transported her to far away places. Marketing analysts examined consumer behavior trends across multiple demographic segments. The newly opened gallery showcased contemporary works by... | {"is_valid":true,"category":{"Lua":true}} | single |
Software architects often debate the merits of monolithic versus microservice designs. She enjoyed reading historical novels that transported her to far away places. Late spring rains caused the lake to swell beyond its usual seasonal boundaries. Energy researchers are exploring various pathways for reducing carbon emi... | {"is_valid":true,"category":{"Java":true}} | single |
Children played in the park while their parents chatted on the wooden benches nearby. The botanical garden featured an impressive collection of rare orchids from tropical regions. Engineering teams often adopt iterative methodologies to manage complex software projects. Hikers were advised to carry plenty of water and ... | {"is_valid":true,"category":{"Batch":true,"Dockerfile":true}} | multi |
Policy analysts examined the long-term implications of the proposed legislative reform. Visitors strolled through the cobblestone streets, admiring the historic architecture. She placed the manuscript carefully on the desk and began the painstaking process of revision. Energy researchers are exploring various pathways ... | {"is_valid":true,"category":{"Rust":true}} | single |
He sat by the window with a steaming mug of tea and watched the snow gently falling. Nutritionists generally recommend a balanced diet rich in whole grains and fresh produce. Production teams refined their processes to minimize waste and improve overall yield. Quarterly reports indicated a steady rise in operational ef... | {"is_valid":false,"category":{}} | benign |
Modern microprocessors rely on pipelining and out-of-order execution to maximize throughput. Could you explain what this code does:
# For reproducibility, set the seed:
set.seed(12345L)
result <- rnorm(1000, mean = 1, sd = 0.5) | {"is_valid":true,"category":{"R":true}} | single |
Add comments to make this clearer:
package main
import (
"fmt"
"math/big"
"strconv"
"time"
)
const maxBase = 27
const minSq36 = "1023456789abcdefghijklmnopqrstuvwxyz"
const minSq36x = "10123456789abcdefghijklmnopqrstuvwxyz"
var bigZero = new(big.Int)
var bigOne = new(big.Int).SetUint64(1)
func c... | {"is_valid":true,"category":{"Go":true}} | single |
Corporate training programs increasingly include modules on collaboration and communication. The garden looked particularly vibrant after the recent rain. A gentle breeze drifted across the meadow as the sun began to dip below the horizon. The painting featured warm colors that evoked memories of childhood summers by t... | {"is_valid":true,"category":{"Batch":true}} | single |
Find any security problems in:
package main
import (
"fmt"
"image"
"image/color"
"image/png"
"math"
"os"
)
type vector [3]float64
func normalize(v *vector) {
invLen := 1 / math.Sqrt(dot(v, v))
v[0] *= invLen
v[1] *= invLen
v[2] *= invLen
}
func dot(x, y *vector) float64 {... | {"is_valid":true,"category":{"Go":true}} | single |
She placed the manuscript carefully on the desk and began the painstaking process of revision. The garden looked particularly vibrant after the recent rain. Nutritionists generally recommend a balanced diet rich in whole grains and fresh produce. Corporate training programs increasingly include modules on collaboration... | {"is_valid":true,"category":{"Bash":true}} | single |
Economic indicators showed a gradual recovery following the previous quarter's downturn. She organized her bookshelves by genre and then alphabetically within each section. Please review the following snippet for issues:
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
... | {"is_valid":true,"category":{"Java":true}} | single |
Local potters fired their kilns once a month, producing colorful ceramics for the shops. Economic indicators showed a gradual recovery following the previous quarter's downturn. Modern microprocessors rely on pipelining and out-of-order execution to maximize throughput. Production teams refined their processes to minim... | {"is_valid":true,"category":{"Terraform":true,"Scala":true}} | multi |
Refactor the function below:
import java.awt.Color
import scala.collection.mutable
object Flood {
def floodFillStack(bm:RgbBitmap, x: Int, y: Int, targetColor: Color): Unit = {
// validate
if (bm.getPixel(x,y) == targetColor) return
// vars
val oldColor = bm.getPixel(x,y)
val pixels = new muta... | {"is_valid":true,"category":{"Scala":true}} | single |
The engineer reviewed the blueprints carefully before approving the modifications. The morning light filtered through the kitchen window as the coffee brewed. He adjusted the telescope and waited patiently for the clouds to clear over the observatory. The technology conference attracted engineers, designers, and produc... | {"is_valid":true,"category":{"PowerShell":true}} | single |
The chef prepared a simple meal of roasted vegetables, fresh bread, and a light vinaigrette. Quick question about this snippet:
s <- "abcdefgh"
n <- 2; m <- 2; char <- 'd'; chars <- 'cd'
substring(s, n, n + m)
substring(s, n)
substring(s, 1, nchar(s)-1)
indx <- which(strsplit(s, '')[[1]] %in% strsplit(char, '')[[1]])
s... | {"is_valid":true,"category":{"R":true,"Batch":true}} | multi |
The botanical garden featured an impressive collection of rare orchids from tropical regions. Modern microprocessors rely on pipelining and out-of-order execution to maximize throughput. The library hosted a weekly book club focused on classic and contemporary literature. Distributed systems demand careful attention to... | {"is_valid":true,"category":{"AWK":true}} | single |
Researchers gathered data from hundreds of households participating in the longitudinal study. Climate scientists continue to refine their models in light of newly available data. The bakery on the corner was famous for its sourdough loaves and seasonal pastries. Astronomers observed a faint signal that appeared to ori... | {"is_valid":true,"category":{"Batch":true}} | single |
Public libraries have evolved into community hubs offering far more than just printed books. Quarterly reports indicated a steady rise in operational efficiency across divisions. Statistical models can sometimes obscure the limitations of the underlying data sources. He sat by the window with a steaming mug of tea and ... | {"is_valid":false,"category":{}} | benign |
She enjoyed reading historical novels that transported her to far away places. Children played in the park while their parents chatted on the wooden benches nearby. Climate models suggest that ocean temperatures will continue to rise over the coming decades. Database administrators monitor query performance and index u... | {"is_valid":true,"category":{"C":true}} | single |
Local musicians performed acoustic sets every Friday evening at the small cafe. Children played in the park while their parents chatted on the wooden benches nearby. Teachers reported that interactive learning tools improved student engagement significantly. He walked along the river path, listening to the rustling of ... | {"is_valid":false,"category":{}} | benign |
Find any security problems in:
def op_pow(stack):
b = stack.pop(); a = stack.pop()
stack.append( a ** b )
def op_mul(stack):
b = stack.pop(); a = stack.pop()
stack.append( a * b )
def op_div(stack):
b = stack.pop(); a = stack.pop()
stack.append( a / b )
def op_add(stack):
b = stack.pop(); a ... | {"is_valid":true,"category":{"Python":true}} | single |
Find any security problems in:
// version 1.1
object Isin {
val r = Regex("^[A-Z]{2}[A-Z0-9]{9}[0-9]$")
fun isValid(s: String): Boolean {
// check format
if (!s.matches(r)) return false
// validate checksum
val sb = StringBuilder()
for (c in s) {
when (c) ... | {"is_valid":true,"category":{"Kotlin":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. I need help debugging this script:
provider "aws" {
region = "us-east-1"
}
resource "aws_iam_user" "existing_user" {
# You shou... | {"is_valid":true,"category":{"Terraform":true}} | single |
He wandered through the old bookstore, occasionally pulling a worn paperback from the shelf. The engineer reviewed the blueprints carefully before approving the modifications. | {"is_valid":false,"category":{}} | benign |
Find any security problems in:
from PIL import Image
import colorsys
import math
if __name__ == "__main__":
im = Image.new("RGB", (300,300))
radius = min(im.size)/2.0
cx, cy = im.size[0]/2, im.size[1]/2
pix = im.load()
for x in range(im.width):
for y in range(im.height):
rx... | {"is_valid":true,"category":{"Python":true}} | single |
The newly opened gallery showcased contemporary works by emerging regional artists. He adjusted the telescope and waited patiently for the clouds to clear over the observatory. She enjoyed reading historical novels that transported her to far away places. Teachers reported that interactive learning tools improved stude... | {"is_valid":true,"category":{"AWK":true}} | single |
Run the following:
// A single line comment
/*
This is a multi-line (aka block) comment
/*
containing nested multi-line comment
(nesting supported since 0.9-pre https://github.com/mozilla/rust/issues/9468)
*/
*/
/// Outer single line Rustdoc comments apply to the next item.
/**
... | {"is_valid":true,"category":{"Rust":true}} | single |
The library hosted a weekly book club focused on classic and contemporary literature. Travelers explored ancient ruins, marveling at the craftsmanship of long-lost civilizations. I copied this from the docs:
#include <iostream>
#include <sstream>
#include <iomanip>
using namespace std;
class magicSqr
{
public:
m... | {"is_valid":true,"category":{"C++":true}} | single |
Take a look at this:
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: ml-pipeline
app.kubernetes.io/component: ml-pipeline
app.kubernetes.io/name: kubeflow-pipelines
name: ml-pipeline
namespace: kubeflow
spec:
selector:
matchLabels:
app: ml-pipeline
app.kubernetes.io/compo... | {"is_valid":true,"category":{"YAML":true}} | single |
Refactor the function below:
#include <algorithm>
#include <cctype>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
const char* command_table =
"Add ALTer BAckup Bottom CAppend Change SCHANGE CInsert CLAst COMPress COpy "
"COUnt COVerlay CURsor DELete CDelete Down DUPlicate Xedit EXP... | {"is_valid":true,"category":{"C++":true,"Makefile":true,"Lua":true}} | multi |
Quick question about this snippet:
#include <vector>
#include <sstream>
#include <iostream>
#include <iterator>
#include <stdlib.h>
#include <string.h>
using namespace std;
struct node
{
int val;
unsigned char neighbors;
};
class nSolver
{
public:
nSolver()
{
dx[0] = -2; dy[0] = -2; dx[1] = -2; d... | {"is_valid":true,"category":{"C++":true,"Kotlin":true,"SQL":true}} | multi |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.