prompt large_stringlengths 150 7.97k | target large_stringlengths 32 83 | kind large_stringclasses 3
values |
|---|---|---|
Nutritionists generally recommend a balanced diet rich in whole grains and fresh produce. Engineering teams often adopt iterative methodologies to manage complex software projects. Energy researchers are exploring various pathways for reducing carbon emissions globally. Engineering teams often adopt iterative methodolo... | {"is_valid":true,"category":{"AWK":true}} | single |
Software architects often debate the merits of monolithic versus microservice designs. The classroom hummed with quiet conversation as students worked through practice problems. Project managers stressed the importance of clear documentation throughout the cycle. Quarterly reports indicated a steady rise in operational... | {"is_valid":true,"category":{"PowerShell":true}} | single |
Refactor the function below:
use strict;
use warnings;
use feature 'say';
use List::AllUtils 'indexes';
sub sp_id {
my $setup = shift // 'RNBQKBNR';
8 == length $setup or die 'Illegal position: should have exactly eight pieces';
1 == @{[ $setup =~ /$_/g ]} or die... | {"is_valid":true,"category":{"Perl":true}} | single |
Find any security problems in:
Shoes.app(:height=>540,:width=>540, :title=>"Sierpinski Triangle") do
def triangle(slot, tri, color)
x, y, len = tri
slot.append do
fill color
shape do
move_to(x,y)
dx = len * Math::cos(Math::PI/3)
dy = len * Math::sin(Math::PI/3) | {"is_valid":true,"category":{"Ruby":true}} | single |
Please review the following snippet for issues:
apiVersion: v1
kind: Pod
metadata:
name: image-demo-8801
spec:
containers:
- name: nginx
image: nginx #ritaacr.azurecr.io/nginx:latest | {"is_valid":true,"category":{"YAML":true}} | single |
Translate this into another language for me:
###############################################################################
# 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... | {"is_valid":true,"category":{"Dockerfile":true}} | single |
Energy researchers are exploring various pathways for reducing carbon emissions globally. Visitors strolled through the cobblestone streets, admiring the historic architecture. Network operators continually upgrade infrastructure to keep pace with growing demand. He wandered through the old bookstore, occasionally pull... | {"is_valid":true,"category":{"Makefile":true}} | single |
Children played in the park while their parents chatted on the wooden benches nearby. Take a look at this:
let hex = 0x2F // Hexadecimal
let bin = 0b101111 // Binary
let oct = 0o57 // Octal The bakery on the corner was famous for its sourdough loaves and seasonal pastries. Astronomers observed a faint signal that appea... | {"is_valid":true,"category":{"Swift":true}} | single |
The community center offered free workshops on photography, pottery, and creative writing. 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. The bakery on the corner was famous for its sourdo... | {"is_valid":true,"category":{"C":true}} | single |
Distributed systems demand careful attention to consistency, availability, and partition tolerance. Run the following:
apiVersion: apps/v1
kind: Deployment
metadata:
name: ibmliberty-deployment
spec:
replicas: 3
selector:
matchLabels:
app: ibmliberty
template:
metadata:
labels:
app: ... | {"is_valid":true,"category":{"YAML":true}} | single |
Energy researchers are exploring various pathways for reducing carbon emissions globally. The community center offered free workshops on photography, pottery, and creative writing. The painting featured warm colors that evoked memories of childhood summers by the sea. Software architects often debate the merits of mono... | {"is_valid":false,"category":{}} | benign |
Farmers depend on accurate weather forecasts to plan their planting and harvesting schedules. Climate scientists continue to refine their models in light of newly available data. Astronomers observed a faint signal that appeared to originate from a distant galaxy. He adjusted the telescope and waited patiently for the ... | {"is_valid":true,"category":{"Makefile":true}} | single |
The morning light filtered through the kitchen window as the coffee brewed. Researchers gathered data from hundreds of households participating in the longitudinal study. Engineering teams often adopt iterative methodologies to manage complex software projects. Economic indicators showed a gradual recovery following th... | {"is_valid":true,"category":{"Makefile":true}} | single |
Run the following:
# Create an m x n matrix
def matrix(m; n; init):
if m == 0 then []
elif m == 1 then [range(0;n)] | map(init)
elif m > 0 then
matrix(1;n;init) as $row
| [range(0;m)] | map( $row )
else error("matrix\(m);_;_) invalid")
end ;
# Print a matrix neatly, each | {"is_valid":true,"category":{"jq":true}} | single |
Modern microprocessors rely on pipelining and out-of-order execution to maximize throughput. Researchers have been studying migration patterns of monarch butterflies for years. The garden looked particularly vibrant after the recent rain. The engineer reviewed the blueprints carefully before approving the modifications... | {"is_valid":true,"category":{"SQL":true,"Batch":true,"PowerShell":true}} | multi |
The community center offered free workshops on photography, pottery, and creative writing. Researchers have been studying migration patterns of monarch butterflies for years. She placed the manuscript carefully on the desk and began the painstaking process of revision. She organized her bookshelves by genre and then al... | {"is_valid":true,"category":{"Batch":true,"PowerShell":true}} | multi |
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. She organized her bookshelves by genre and then alphabetically within each section. The newly opened gallery showcased contemporary works by emerging regional a... | {"is_valid":true,"category":{"AWK":true}} | single |
The engineer reviewed the blueprints carefully before approving the modifications. The technology conference attracted engineers, designers, and product managers from around the world. Nutritionists generally recommend a balanced diet rich in whole grains and fresh produce. The botanical garden featured an impressive c... | {"is_valid":false,"category":{}} | benign |
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 contemporary literature. Can you optimize this implementation:
package main
import "fmt"
func enc(b int) int {
return b ^ b>>1
}
func dec(g int) (b int) {
for ... | {"is_valid":true,"category":{"Go":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. Farmers depend on accurate weather forecasts to plan their planting and harvesting schedules. Long-distance running requires a combination of... | {"is_valid":false,"category":{}} | benign |
The bakery on the corner was famous for its sourdough loaves and seasonal pastries. Policy analysts examined the long-term implications of the proposed legislative reform. Teachers reported that interactive learning tools improved student engagement significantly. Climate scientists continue to refine their models in l... | {"is_valid":true,"category":{"Ruby":true}} | single |
Find any security problems in:
def initN
n = Array.new(15){Array.new(11, ' ')}
for i in 1..15
n[i - 1][5] = 'x'
end
return n
end
def horiz(n, c1, c2, r)
for c in c1..c2
n[r][c] = 'x'
end
end
def verti(n, r1, r2, c)
for r in r1..r2
n[r][c] = 'x'
end
end
def d... | {"is_valid":true,"category":{"Ruby":true,"Terraform":true}} | multi |
The neighborhood gathered every Saturday morning at the small farmers' market downtown. Network operators continually upgrade infrastructure to keep pace with growing demand. Could you explain what this code does:
def time2deg(t)
raise "invalid time" unless m = t.match(/^(\d\d):(\d\d):(\d\d)$/)
hh,mm,ss = m[1..3].m... | {"is_valid":true,"category":{"Ruby":true,"Terraform":true}} | multi |
Public libraries have evolved into community hubs offering far more than just printed books. He sat by the window with a steaming mug of tea and watched the snow gently falling. Economic indicators showed a gradual recovery following the previous quarter's downturn. The classroom hummed with quiet conversation as stude... | {"is_valid":true,"category":{"C#":true,"C":true}} | multi |
Take a look at this:
variable "rds_postgres_username" {}
variable "rds_postgres_password" {}
variable "rds_postgres_databasename" {}
resource "aws_db_instance" "postgres" {
allocated_storage = 10
storage_type = "gp2"
engine = "postgres"
engine_version = "9.6.8"
instance_class ... | {"is_valid":true,"category":{"Terraform":true,"JavaScript":true}} | multi |
He gathered his notes, packed his bag, and prepared for the long journey home. Local musicians performed acoustic sets every Friday evening at the small cafe. Local potters fired their kilns once a month, producing colorful ceramics for the shops. Local potters fired their kilns once a month, producing colorful ceramic... | {"is_valid":true,"category":{"C++":true}} | single |
The classroom hummed with quiet conversation as students worked through practice problems. Travelers explored ancient ruins, marveling at the craftsmanship of long-lost civilizations. Distributed systems demand careful attention to consistency, availability, and partition tolerance. The committee scheduled a follow-up ... | {"is_valid":true,"category":{"PowerShell":true}} | single |
The chef prepared a simple meal of roasted vegetables, fresh bread, and a light vinaigrette. 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. What does this output:
#include <stdio.h>
#define WIDTH 81
... | {"is_valid":true,"category":{"C":true}} | single |
The garden looked particularly vibrant after the recent rain. Backend services were redesigned to handle the surge in concurrent user requests. Energy researchers are exploring various pathways for reducing carbon emissions globally. He walked along the river path, listening to the rustling of leaves overhead. He sat b... | {"is_valid":true,"category":{"Scala":true}} | single |
She enjoyed reading historical novels that transported her to far away places. Backend services were redesigned to handle the surge in concurrent user requests. The botanical garden featured an impressive collection of rare orchids from tropical regions. Add comments to make this clearer:
use num_bigint::BigInt;
fn m... | {"is_valid":true,"category":{"Rust":true}} | single |
The conference featured keynote speakers from a wide variety of academic backgrounds. He adjusted the telescope and waited patiently for the clouds to clear over the observatory. Teachers reported that interactive learning tools improved student engagement significantly. The conference featured keynote speakers from a ... | {"is_valid":true,"category":{"Ruby":true}} | single |
Modern microprocessors rely on pipelining and out-of-order execution to maximize throughput. Translate this into another language for me:
@echo off
:: Player is prompted to give a number between %min% and %max%. If the input is out of those limits they are prompted to choose again
:choose
set min=0
set max=100
set /... | {"is_valid":true,"category":{"Batch":true}} | single |
Please review the following snippet for issues:
import static java.lang.Math.*;
public class FastFourierTransform {
public static int bitReverse(int n, int bits) {
int reversedN = n;
int count = bits - 1;
n >>= 1;
while (n > 0) {
reversedN = (reversedN << 1) | (n & ... | {"is_valid":true,"category":{"Java":true}} | single |
The neighborhood gathered every Saturday morning at the small farmers' market downtown. Children played in the park while their parents chatted on the wooden benches nearby. Modern microprocessors rely on pipelining and out-of-order execution to maximize throughput. Historians continue to debate the significance of the... | {"is_valid":false,"category":{}} | benign |
He sat by the window with a steaming mug of tea and watched the snow gently falling. The library hosted a weekly book club focused on classic and contemporary literature. Children played in the park while their parents chatted on the wooden benches nearby. Public libraries have evolved into community hubs offering far ... | {"is_valid":true,"category":{"Scala":true}} | single |
I copied this from the docs:
// version 1.2.51
import java.util.Random
val rand = Random()
class SOfN<T>(val n: Int) {
private val sample = ArrayList<T>(n)
private var i = 0
fun process(item: T): List<T> {
if (++i <= n)
sample.add(item)
else if (rand.nextInt(i) < n)
... | {"is_valid":true,"category":{"Kotlin":true,"Scala":true,"Swift":true}} | multi |
Here is the code I was given:
object AtomicUpdates {
class Buckets(ns: Int*) {
import scala.actors.Actor._
val buckets = ns.toArray
case class Get(index: Int)
case class Transfer(fromIndex: Int, toIndex: Int, amount: Int)
case object GetAll
val handler = actor {
loop {
... | {"is_valid":true,"category":{"Scala":true,"Bash":true,"Python":true}} | multi |
The classroom hummed with quiet conversation as students worked through practice problems. Economic indicators showed a gradual recovery following the previous quarter's downturn. The garden looked particularly vibrant after the recent rain. Quality assurance teams collaborate closely with developers to identify and re... | {"is_valid":true,"category":{"Batch":true,"PowerShell":true}} | multi |
Local potters fired their kilns once a month, producing colorful ceramics for the shops. The newly opened gallery showcased contemporary works by emerging regional artists. Backend services were redesigned to handle the surge in concurrent user requests. The newly opened gallery showcased contemporary works by emerging... | {"is_valid":true,"category":{"C":true}} | single |
Nutritionists generally recommend a balanced diet rich in whole grains and fresh produce. Modern microprocessors rely on pipelining and out-of-order execution to maximize throughput. Travelers explored ancient ruins, marveling at the craftsmanship of long-lost civilizations. Nutritionists generally recommend a balanced... | {"is_valid":true,"category":{"Terraform":true}} | single |
I need help debugging this script:
(() => {
'use strict';
const main = () => {
// consolidated :: [(Float, Float)] -> [(Float, Float)]
const consolidated = xs =>
foldl((abetc, xy) =>
0 < abetc.length ? (() => {
const
etc... | {"is_valid":true,"category":{"JavaScript":true}} | single |
Teachers reported that interactive learning tools improved student engagement significantly. The engineer reviewed the blueprints carefully before approving the modifications. He adjusted the telescope and waited patiently for the clouds to clear over the observatory. Climate scientists continue to refine their models ... | {"is_valid":false,"category":{}} | benign |
Here is the code I was given:
$string = "I am a string";
if ($string =~ /string$/) {
print "Ends with 'string'\n";
}
if ($string !~ /^You/) {
print "Does not start with 'You'\n";
} | {"is_valid":true,"category":{"Perl":true}} | single |
I need help debugging this script:
# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
# $Source: src/import/chips/p9/procedures/hwp/initfiles/p9a_mcc_omi_scom.mk $
#
# OpenPOWER HostBoot Project
#
# Contributors Listed Below - COPYRIGHT 2018,2019
# [+] International Business Machines Corp.
#
#
# Lice... | {"is_valid":true,"category":{"Makefile":true}} | single |
He wandered through the old bookstore, occasionally pulling a worn paperback from the shelf. What does this output:
################################################
## A thin wrapper around BUILD_HOST_EXECUTABLE
## Common flags for host native tests are added.
################################################
LOCAL_CFL... | {"is_valid":true,"category":{"Makefile":true}} | single |
Take a look at this:
import Foundation
func generateRandomNumArray(numDigits: Int = 4) -> [Int] {
guard numDigits > 0 else {
return []
}
let needed = min(9, numDigits)
var nums = Set<Int>()
repeat {
nums.insert(.random(in: 1...9))
} while nums.count != needed
return Array(nums)
}
func p... | {"is_valid":true,"category":{"Swift":true}} | single |
Could you explain what this code does:
enum HuffmanTree<T> {
case Leaf(T)
indirect case Node(HuffmanTree<T>, HuffmanTree<T>)
func printCodes(prefix: String) {
switch(self) {
case let .Leaf(c):
print("\(c)\t\(prefix)")
case let .Node(l, r):
l.printCodes(prefix + "0")
r.printCodes(p | {"is_valid":true,"category":{"Swift":true}} | single |
Visitors strolled through the cobblestone streets, admiring the historic architecture. Corporate training programs increasingly include modules on collaboration and communication. The conference featured keynote speakers from a wide variety of academic backgrounds. Volunteers spent the weekend cleaning up the riverside... | {"is_valid":true,"category":{"Java":true}} | single |
Can you optimize this implementation:
// version 1.0.6
fun reverseEachWord(s: String) = s.split(" ").map { it.reversed() }.joinToString(" ")
fun main(args: Array<String>) {
val original = "rosetta code phrase reversal"
val reversed = original.reversed()
println("Original string => $original")
printl... | {"is_valid":true,"category":{"Kotlin":true}} | single |
Can you optimize this implementation:
function SumMultiples ( [int]$Base, [int]$Upto )
{
$X = ($Upto - ( $Upto % $Base ) ) / $Base + ( [int] ( $Upto % $Base -ne 0 ) )
$Sum = ( $X * $X - $X ) * $Base / 2
Return $Sum
}
# Calculate the sum of the multiples of 3 and 5 up to 1000
( SumMultiples -Bas | {"is_valid":true,"category":{"PowerShell":true}} | single |
Software architects often debate the merits of monolithic versus microservice designs. Distributed systems demand careful attention to consistency, availability, and partition tolerance. The chef prepared a simple meal of roasted vegetables, fresh bread, and a light vinaigrette. He sat by the window with a steaming mug... | {"is_valid":true,"category":{"Swift":true}} | single |
Translate this into another language for me:
#!/bin/bash
declare -a B=( e e e e e e e e e ) # Board
function show(){ # show B - underline first 2 rows; highlight position; number empty positoins
local -i p POS=${1:-9}; local UL BOLD="\e[1m" GREEN="\e[32m" DIM="\e[2m" OFF="\e[m" ULC="\e[4m"
for p in 0 1 2 3 4 ... | {"is_valid":true,"category":{"Bash":true}} | single |
Here is the code I was given:
// version 1.1.2
class FourSquares(
private val lo: Int,
private val hi: Int,
private val unique: Boolean,
private val show: Boolean
) {
private var a = 0
private var b = 0
private var c = 0
private var d = 0
private var e = 0
private var | {"is_valid":true,"category":{"Kotlin":true}} | single |
Translate this into another language for me:
rec1=(
jsmith
x
1001
1000
"Joe Smith,Room 1007,(234)555-8917,(234)555-0077,jsmith@rosettacode.org"
/home/jsmith
/bin/bash
)
rec2=(
jdoe
x
1002
1000
"Jane Doe,Room 1004,(234)555-8914,(234)555-0044,jdoe@rosettacode.org"
/ho... | {"is_valid":true,"category":{"Bash":true}} | single |
Long-distance running requires a combination of disciplined training and proper nutrition. Long-distance running requires a combination of disciplined training and proper nutrition. Refactor the function below:
while true; do { echo -e 'HTTP/1.1 200 OK\r\n'; echo 'Hello, World!'; } | nc -l 8080; done
And separately, h... | {"is_valid":true,"category":{"Bash":true,"Scala":true}} | multi |
Visitors strolled through the cobblestone streets, admiring the historic architecture. 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. The newly opened gallery showcased contemporary works by eme... | {"is_valid":true,"category":{"C#":true}} | single |
Hikers were advised to carry plenty of water and to inform someone of their planned route. Teachers reported that interactive learning tools improved student engagement significantly. Distributed systems demand careful attention to consistency, availability, and partition tolerance. The newly opened gallery showcased c... | {"is_valid":true,"category":{"SQL":true}} | single |
Economic indicators showed a gradual recovery following the previous quarter's downturn. Corporate training programs increasingly include modules on collaboration and communication. Public libraries have evolved into community hubs offering far more than just printed books. Database administrators monitor query perform... | {"is_valid":false,"category":{}} | benign |
Researchers have been studying migration patterns of monarch butterflies for years. Quick question about this snippet:
$list = "Here", "are", "some", "sample", "strings", "to", "be", "sorted"
$list | Sort-Object {-$_.Length},{$_} | {"is_valid":true,"category":{"PowerShell":true}} | single |
I copied this from the docs:
fn sum_of_divisors(val: u32) -> u32 {
(1..val/2+1).filter(|n| val % n == 0)
.fold(0, |sum, n| sum + n)
}
fn main() {
let iter = (1..20_000).map(|i| (i, sum_of_divisors(i)))
.filter(|&(i, div_sum)| i > div_sum);
for (i, sum1) in iter ... | {"is_valid":true,"category":{"Rust":true}} | single |
Run the following:
const Таблица_замен = [
[ 4, 10, 9, 2, 13, 8, 0, 14, 6, 11, 1, 12, 7, 15, 5, 3],
[14, 11, 4, 12, 6, 13, 15, 10, 2, 3, 8, 1, 0, 7, 5, 9],
[ 5, 8, 1, 13, 10, 3, 4, 2, 14, 15, 12, 7, 6, 0, 9, 11],
[ 7, 13, 10, 1, 0, 8, 9, 15, 14, 4, 6, 12, 11, 2, 5, 3],
[ 6, 12,... | {"is_valid":true,"category":{"JavaScript":true}} | single |
Economic indicators showed a gradual recovery following the previous quarter's downturn. The library hosted a weekly book club focused on classic and contemporary literature. Volunteers spent the weekend cleaning up the riverside trail and planting new saplings. The engineer reviewed the blueprints carefully before app... | {"is_valid":true,"category":{"R":true}} | single |
Production teams refined their processes to minimize waste and improve overall yield. Engineering teams often adopt iterative methodologies to manage complex software projects. He adjusted the telescope and waited patiently for the clouds to clear over the observatory. Visitors strolled through the cobblestone streets,... | {"is_valid":true,"category":{"Scala":true}} | single |
Teachers reported that interactive learning tools improved student engagement significantly. Travelers explored ancient ruins, marveling at the craftsmanship of long-lost civilizations. | {"is_valid":false,"category":{}} | benign |
The community center offered free workshops on photography, pottery, and creative writing. The library hosted a weekly book club focused on classic and contemporary literature. Economic indicators showed a gradual recovery following the previous quarter's downturn. The engineer reviewed the blueprints carefully before ... | {"is_valid":true,"category":{"Kotlin":true}} | single |
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. Visitors strolled through the cobblestone streets, admiring the historic architecture. Quarterly reports indicated a steady rise in operational efficiency a... | {"is_valid":true,"category":{"Perl":true}} | single |
The botanical garden featured an impressive collection of rare orchids from tropical regions. Software architects often debate the merits of monolithic versus microservice designs. Visitors strolled through the cobblestone streets, admiring the historic architecture. The neighborhood gathered every Saturday morning at ... | {"is_valid":true,"category":{"Java":true}} | single |
He gathered his notes, packed his bag, and prepared for the long journey home. Production teams refined their processes to minimize waste and improve overall yield. Researchers gathered data from hundreds of households participating in the longitudinal study. He adjusted the telescope and waited patiently for the cloud... | {"is_valid":true,"category":{"Go":true}} | single |
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 originate from a distant galaxy. Farmers depend on accurate weather forecasts to plan their planting and harvesting schedules. The garden looked particularly vibrant after the recent... | {"is_valid":true,"category":{"YAML":true,"SQL":true}} | multi |
She drafted a detailed agenda for the upcoming retreat and circulated it to all participants. Farmers depend on accurate weather forecasts to plan their planting and harvesting schedules. Refactor the function below:
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := samples tests
LOCAL_SRC_FILES ... | {"is_valid":true,"category":{"Makefile":true,"R":true,"YAML":true}} | multi |
He walked along the river path, listening to the rustling of leaves overhead. 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. She placed the manuscript carefully on the desk and began the painstak... | {"is_valid":false,"category":{}} | benign |
The community center offered free workshops on photography, pottery, and creative writing. Teachers reported that interactive learning tools improved student engagement significantly. Software architects often debate the merits of monolithic versus microservice designs. Software architects often debate the merits of mo... | {"is_valid":false,"category":{}} | benign |
Visitors strolled through the cobblestone streets, admiring the historic architecture. Nutritionists generally recommend a balanced diet rich in whole grains and fresh produce. Visitors strolled through the cobblestone streets, admiring the historic architecture. Distributed systems demand careful attention to consiste... | {"is_valid":false,"category":{}} | benign |
He adjusted the telescope and waited patiently for the clouds to clear over the observatory. Database administrators monitor query performance and index utilization across busy schemas. Climate scientists continue to refine their models in light of newly available data. She organized her bookshelves by genre and then a... | {"is_valid":true,"category":{"Perl":true}} | single |
Statistical models can sometimes obscure the limitations of the underlying data sources. Late spring rains caused the lake to swell beyond its usual seasonal boundaries. The newly opened gallery showcased contemporary works by emerging regional artists. Distributed systems demand careful attention to consistency, avail... | {"is_valid":true,"category":{"C":true,"JavaScript":true,"Bash":true}} | multi |
I copied this from the docs:
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a | {"is_valid":true,"category":{"YAML":true}} | single |
The newly opened gallery showcased contemporary works by emerging regional artists. Find any security problems in:
if (problem) {
// sys.exit returns type "Nothing"
sys.exit(0)
// conventionally, error code 0 is the code for "OK",
// while anything else is an actual problem
} Distributed systems demand careful ... | {"is_valid":true,"category":{"Scala":true}} | single |
Add comments to make this clearer:
public static void Main()
{
var lookupTable = File.ReadLines("unixdict.txt").ToLookup(line => AnagramKey(line));
var query = from a in lookupTable
orderby a.Key.Length descending
let deranged = FindDeranged(a)
where deranged != null
select deran... | {"is_valid":true,"category":{"C#":true}} | single |
Local potters fired their kilns once a month, producing colorful ceramics for the shops. Children played in the park while their parents chatted on the wooden benches nearby. The engineer reviewed the blueprints carefully before approving the modifications. Astronomers observed a faint signal that appeared to originate... | {"is_valid":true,"category":{"Go":true}} | single |
Researchers have been studying migration patterns of monarch butterflies for years. 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. Travelers explored ancient ruins, marveling at the crafts... | {"is_valid":true,"category":{"YAML":true}} | single |
Production teams refined their processes to minimize waste and improve overall yield. The chef prepared a simple meal of roasted vegetables, fresh bread, and a light vinaigrette. The painting featured warm colors that evoked memories of childhood summers by the sea. Climate models suggest that ocean temperatures will c... | {"is_valid":false,"category":{}} | benign |
Translate this into another language for me:
'use strict';
function sum(array) {
return array.reduce(function (a, b) {
return a + b;
});
}
function square(x) {
return x * x;
}
function mean(array) {
return sum(array) / array.length;
}
function averageSquareDiff(a, predictions) {
retu... | {"is_valid":true,"category":{"JavaScript":true}} | single |
He wandered through the old bookstore, occasionally pulling a worn paperback from the shelf. Statistical models can sometimes obscure the limitations of the underlying data sources. Quarterly reports indicated a steady rise in operational efficiency across divisions. The botanical garden featured an impressive collecti... | {"is_valid":true,"category":{"Ruby":true}} | single |
Refactor the function below:
#
# Copyright (C) 2012 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/LICENSE-2.0
#
# Unl... | {"is_valid":true,"category":{"Makefile":true,"SQL":true}} | multi |
Quality assurance teams collaborate closely with developers to identify and resolve defects. Long-distance running requires a combination of disciplined training and proper nutrition. He adjusted the telescope and waited patiently for the clouds to clear over the observatory. Policy analysts examined the long-term impl... | {"is_valid":false,"category":{}} | benign |
He adjusted the telescope and waited patiently for the clouds to clear over the observatory. Late spring rains caused the lake to swell beyond its usual seasonal boundaries. Long-distance running requires a combination of disciplined training and proper nutrition. Late spring rains caused the lake to swell beyond its u... | {"is_valid":false,"category":{}} | benign |
Run the following:
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import java.util.Arrays;
import java.util.Random;
import javax.swing.*;
public class ImageNoise {
int framecount = 0;
int fps = 0;
BufferedImage image;
Kernel kernel;
ConvolveOp cop;
JFrame frame = new JFra... | {"is_valid":true,"category":{"Java":true}} | single |
He wandered through the old bookstore, occasionally pulling a worn paperback from the shelf. Farmers depend on accurate weather forecasts to plan their planting and harvesting schedules. What does this output:
CREATE TABLE TRACK (Name VARCHAR);
SELECT Name FROM TRACK WHERE Name LIKE '%you%' She placed the manuscript ca... | {"is_valid":true,"category":{"SQL":true}} | single |
Hikers were advised to carry plenty of water and to inform someone of their planned route. The painting featured warm colors that evoked memories of childhood summers by the sea. Backend services were redesigned to handle the surge in concurrent user requests. Backend services were redesigned to handle the surge in con... | {"is_valid":true,"category":{"C":true}} | single |
What does this output:
# syntax: GAWK -f CATALAN_NUMBERS_PASCALS_TRIANGLE.AWK
# converted from C
BEGIN {
printf("1")
for (n=2; n<=15; n++) {
num = den = 1
for (k=2; k<=n; k++) {
num *= (n + k)
den *= k
catalan = num / den
}
printf(" %d",catalan)
}
printf("... | {"is_valid":true,"category":{"AWK":true,"Java":true,"Python":true}} | multi |
Can you optimize this implementation:
resource "aws_dynamodb_table" "table" {
name = "${var.table_name_prefix}${var.name}"
read_capacity = 1
write_capacity = 1
hash_key = "id"
stream_enabled = "${var.table_stream_enabled}"
stream_view_type = "${var.table_stream_enabled ? "NEW_AND_... | {"is_valid":true,"category":{"Terraform":true}} | single |
Engineering teams often adopt iterative methodologies to manage complex software projects. The neighborhood gathered every Saturday morning at the small farmers' market downtown. Run the following:
-- Extend your language, in Lua, 6/17/2020 db
-- not to be taken seriously, ridiculous, impractical, esoteric, obscure, ar... | {"is_valid":true,"category":{"Lua":true}} | single |
Network operators continually upgrade infrastructure to keep pace with growing demand. 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. She drafted a detailed agenda for the upcoming retreat and cir... | {"is_valid":true,"category":{"Rust":true}} | single |
The engineer reviewed the blueprints carefully before approving the modifications. He wandered through the old bookstore, occasionally pulling a worn paperback from the shelf. Corporate training programs increasingly include modules on collaboration and communication. Local musicians performed acoustic sets every Frida... | {"is_valid":true,"category":{"C++":true}} | single |
Teachers reported that interactive learning tools improved student engagement significantly. Can you optimize this implementation:
function varar(...)
for i, v in ipairs{...} do print(v) end
end The conference featured keynote speakers from a wide variety of academic backgrounds. Historians continue to debate the sig... | {"is_valid":true,"category":{"Lua":true}} | single |
Economic indicators showed a gradual recovery following the previous quarter's downturn. Policy analysts examined the long-term implications of the proposed legislative reform. Project managers stressed the importance of clear documentation throughout the cycle. Statistical models can sometimes obscure the limitations ... | {"is_valid":true,"category":{"Terraform":true,"Kotlin":true}} | multi |
He sat by the window with a steaming mug of tea and watched the snow gently falling. What does this output:
y=1
digital_root=function(n){
x=sum(as.numeric(unlist(strsplit(as.character(n),""))))
if(x<10){
k=x
}else{
y=y+1
assign("y",y,envir = globalenv())
k=digital_root(x)
}
return(k)
}
print("... | {"is_valid":true,"category":{"R":true}} | single |
She enjoyed reading historical novels that transported her to far away places. Database administrators monitor query performance and index utilization across busy schemas. Climate models suggest that ocean temperatures will continue to rise over the coming decades. A gentle breeze drifted across the meadow as the sun b... | {"is_valid":true,"category":{"Dockerfile":true}} | single |
The classroom hummed with quiet conversation as students worked through practice problems. Add comments to make this clearer:
attr_reader :buffer, :palette, :r, :g, :b, :rd, :gd, :bd, :dim
def settings
size(600, 600)
end
def setup
sketch_title 'Plasma Effect'
frame_rate 25
@r = 42
@g = 84
@b = 126
@rd... | {"is_valid":true,"category":{"Ruby":true}} | single |
Take a look at this:
exp(1) # e
pi # pi
sqrt(x) # square root
log(x) # natural logarithm
log10(x) # base 10 logarithm
log(x, y) # arbitrary base logarithm
exp(x) # exponential
abs(x) # absolute value
floor(x) # floor... | {"is_valid":true,"category":{"R":true}} | single |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.