prompt large_stringlengths 150 7.97k | target large_stringlengths 32 83 | kind large_stringclasses 3
values |
|---|---|---|
Marketing analysts examined consumer behavior trends across multiple demographic segments. She enjoyed reading historical novels that transported her to far away places. Could you explain what this code does:
open("| lpr", "w") { |f| f.puts "Hello World!" } Local musicians performed acoustic sets every Friday evening a... | {"is_valid":true,"category":{"Ruby":true}} | single |
Could you explain what this code does:
def mod(x, y)
m = x % y
if m < 0 then
if y < 0 then
return m - y
else
return m + y
end
end
return m
end
# Constants
# First generator
A1 = [0, 1403580, -810728]
A1.freeze
M1 = (1 << 32) - 209
# Second generator
A2 | {"is_valid":true,"category":{"Ruby":true}} | single |
Run the following:
# Defaults for the fake testarch architecture.
DEVICE_DIR = $(TOP_DIR)/testarch/devices
DEVICE_TYPE ?= clutff-unidir-s4
DEVICE ?= 4x4
DEVICE_FULL = $(DEVICE)
YOSYS_SCRIPT ?= synth -top top -flatten; abc -lut 4; opt_clean; write_blif -attr -cname -conn -param $@
RR_PATCH_TOOL ?= $(TOP... | {"is_valid":true,"category":{"Makefile":true,"Terraform":true}} | multi |
Statistical models can sometimes obscure the limitations of the underlying data sources. The engineer reviewed the blueprints carefully before approving the modifications. She organized her bookshelves by genre and then alphabetically within each section. Travelers explored ancient ruins, marveling at the craftsmanship... | {"is_valid":false,"category":{}} | benign |
Project managers stressed the importance of clear documentation throughout the cycle. The chef prepared a simple meal of roasted vegetables, fresh bread, and a light vinaigrette. Please review the following snippet for issues:
// version 1.1.2
import java.net.URL
import java.net.MalformedURLException
fun parseUrl(u... | {"is_valid":true,"category":{"Kotlin":true,"C++":true}} | multi |
The botanical garden featured an impressive collection of rare orchids from tropical regions. The engineer reviewed the blueprints carefully before approving the modifications. Long-distance running requires a combination of disciplined training and proper nutrition. Astronomers observed a faint signal that appeared to... | {"is_valid":true,"category":{"YAML":true}} | single |
She enjoyed reading historical novels that transported her to far away places. Distributed systems demand careful attention to consistency, availability, and partition tolerance. Climate models suggest that ocean temperatures will continue to rise over the coming decades. She organized her bookshelves by genre and then... | {"is_valid":true,"category":{"C++":true}} | single |
He adjusted the telescope and waited patiently for the clouds to clear over the observatory. He adjusted the telescope and waited patiently for the clouds to clear over the observatory. Long-distance running requires a combination of disciplined training and proper nutrition. Climate models suggest that ocean temperatu... | {"is_valid":true,"category":{"Ruby":true}} | single |
Find any security problems in:
<div>
<div id="container">
<div id="banner-header">
<img width="600" src="${tmpl_context.get_url('/images/fedora_intro_banner1.png')}">
</div>
<div>
<div id="right-content-column">
${applist_widget(category = 'right-content-column', layout =... | {"is_valid":true,"category":{"Makefile":true,"AWK":true}} | multi |
The engineer reviewed the blueprints carefully before approving the modifications. The neighborhood gathered every Saturday morning at the small farmers' market downtown. Find any security problems in:
import Foundation
let size = 12
func printRow(with:Int, upto:Int) {
print(String(repeating: " ", count: (wit... | {"is_valid":true,"category":{"Swift":true}} | single |
He gathered his notes, packed his bag, and prepared for the long journey home. Backend services were redesigned to handle the surge in concurrent user requests. Quick question about this snippet:
String dog = "Benjamin";
String Dog = "Samba"; //in general, identifiers that start with capital letters are class names
Str... | {"is_valid":true,"category":{"Java":true}} | single |
Corporate training programs increasingly include modules on collaboration and communication. Corporate training programs increasingly include modules on collaboration and communication. Late spring rains caused the lake to swell beyond its usual seasonal boundaries. The chef prepared a simple meal of roasted vegetables... | {"is_valid":false,"category":{}} | benign |
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. Production teams refined their processes to minimize waste and improve overall yield. The library hosted a weekly book club focused on classic ... | {"is_valid":true,"category":{"PowerShell":true}} | single |
Corporate training programs increasingly include modules on collaboration and communication. Network operators continually upgrade infrastructure to keep pace with growing demand. Climate scientists continue to refine their models in light of newly available data. Astronomers observed a faint signal that appeared to or... | {"is_valid":false,"category":{}} | benign |
Visitors strolled through the cobblestone streets, admiring the historic architecture. The bakery on the corner was famous for its sourdough loaves and seasonal pastries. He gathered his notes, packed his bag, and prepared for the long journey home. Astronomers observed a faint signal that appeared to originate from a ... | {"is_valid":true,"category":{"Terraform":true,"Go":true,"Perl":true}} | multi |
Can you optimize this implementation:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define TRUE 1
#define FALSE 0
#define STACK_SIZE 80
#define BUFFER_SIZE 100
typedef int bool;
typedef struct {
char name;
bool val;
} var;
typedef struct {
int top;
bool els[STACK_SIZE];
} stack_of_... | {"is_valid":true,"category":{"C":true}} | single |
The newly opened gallery showcased contemporary works by emerging regional artists. Hikers were advised to carry plenty of water and to inform someone of their planned route. Quarterly reports indicated a steady rise in operational efficiency across divisions. The newly opened gallery showcased contemporary works by em... | {"is_valid":true,"category":{"Ruby":true}} | single |
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. Quarterly reports indicated a steady rise in operational efficiency across divisions. Backend services were redesigned to handle the surge in concurren... | {"is_valid":true,"category":{"Go":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. The newly opened gallery showcased contemporary works by emerging regional artists. The engineer reviewed the blueprints carefully before approving the mo... | {"is_valid":true,"category":{"Perl":true}} | single |
The technology conference attracted engineers, designers, and product managers from around the world. Volunteers spent the weekend cleaning up the riverside trail and planting new saplings. Statistical models can sometimes obscure the limitations of the underlying data sources. Network operators continually upgrade inf... | {"is_valid":false,"category":{}} | benign |
The neighborhood gathered every Saturday morning at the small farmers' market downtown. 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. She enjoyed reading historical novels that transported her t... | {"is_valid":true,"category":{"C":true}} | single |
Network operators continually upgrade infrastructure to keep pace with growing demand. She organized her bookshelves by genre and then alphabetically within each section. He adjusted the telescope and waited patiently for the clouds to clear over the observatory. The botanical garden featured an impressive collection o... | {"is_valid":true,"category":{"Lua":true,"Dockerfile":true}} | multi |
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 colorful ceramics for the shops. Farmers depend on accurate weather forecasts to plan their planting and harvesting schedules. He gathered his notes, packed his bag, and prepared ... | {"is_valid":true,"category":{"C":true}} | single |
Researchers have been studying migration patterns of monarch butterflies for years. Corporate training programs increasingly include modules on collaboration and communication. She organized her bookshelves by genre and then alphabetically within each section. She organized her bookshelves by genre and then alphabetica... | {"is_valid":true,"category":{"Python":true}} | single |
Project managers stressed the importance of clear documentation throughout the cycle. Local potters fired their kilns once a month, producing colorful ceramics for the shops. The garden looked particularly vibrant after the recent rain. She enjoyed reading historical novels that transported her to far away places. The ... | {"is_valid":true,"category":{"Kotlin":true}} | single |
Translate this into another language for me:
CREATE TABLE machine (Machine_series VARCHAR, machine_id VARCHAR); CREATE TABLE repair_assignment (machine_id VARCHAR, technician_ID VARCHAR); CREATE TABLE technician (Name VARCHAR, technician_ID VARCHAR);
SELECT T3.Name, T2.Machine_series FROM repair_assignment AS T1 JOIN m... | {"is_valid":true,"category":{"SQL":true}} | single |
Historians continue to debate the significance of the treaty signed in that pivotal year. Climate scientists continue to refine their models in light of newly available data. Please review the following snippet for issues:
wheel = "ndeokgelw"
middle, wheel_size = wheel[4], wheel.size
res = File.open("unixdict.txt").... | {"is_valid":true,"category":{"Ruby":true}} | single |
Here is the code I was given:
ifneq (, $(findstring MSYS, $(shell uname -a)))
ifeq (cc,$(CC))
# In MSYS2, when using the mingw version of gcc, there is no cc -> gcc
# symlink. We can't use ?= here because CC is set implicitly to cc.
# Cross compiling users can set CC to their cross compiler.
CC =gcc
endif
en... | {"is_valid":true,"category":{"Makefile":true}} | single |
Take a look at this:
variable "bucket_name" {
description = "(Required) A name our S3 bucket, will be formetted like 'digitalmarketplace-{bucket_name}-{environment}-{environment}'."
}
variable "environment" {
description = "(Required) A suffix for our S3 bucket, see above."
}
variable "log_buck | {"is_valid":true,"category":{"Terraform":true}} | single |
Statistical models can sometimes obscure the limitations of the underlying data sources. Nutritionists generally recommend a balanced diet rich in whole grains and fresh produce. Policy analysts examined the long-term implications of the proposed legislative reform. Engineering teams often adopt iterative methodologies... | {"is_valid":true,"category":{"Lua":true,"AWK":true}} | multi |
The classroom hummed with quiet conversation as students worked through practice problems. Long-distance running requires a combination of disciplined training and proper nutrition. I need help debugging this script:
using System;
class Program
{
static void Main(string[] args)
{
for (int i = 99; i > ... | {"is_valid":true,"category":{"C#":true}} | single |
Can you optimize this implementation:
package main
import "fmt"
var total, prim, maxPeri int64
func newTri(s0, s1, s2 int64) {
if p := s0 + s1 + s2; p <= maxPeri {
prim++
total += maxPeri / p
newTri(+1*s0-2*s1+2*s2, +2*s0-1*s1+2*s2, +2*s0-2*s1+3*s2)
newTri(+1*s0+2*s1+2*s2, +2*s... | {"is_valid":true,"category":{"Go":true}} | single |
Here is the code I was given:
sub zip {
my @a = @{shift()};
my @b = @{shift()};
my @l;
push @l, shift @a, shift @b while @a and @b;
return @l;
}
sub uniq {
my %h;
grep {!$h{$_}++} @_;
}
my @data =
map {{ zip [qw(name id salary dept)], [split ','] }}
split "\n",
<<'EOF';
Tyler... | {"is_valid":true,"category":{"Perl":true,"SQL":true}} | multi |
The painting featured warm colors that evoked memories of childhood summers by the sea. She organized her bookshelves by genre and then alphabetically within each section. Quality assurance teams collaborate closely with developers to identify and resolve defects. Database administrators monitor query performance and i... | {"is_valid":true,"category":{"Bash":true}} | single |
The classroom hummed with quiet conversation as students worked through practice problems. The chef prepared a simple meal of roasted vegetables, fresh bread, and a light vinaigrette. Travelers explored ancient ruins, marveling at the craftsmanship of long-lost civilizations. Climate scientists continue to refine their... | {"is_valid":false,"category":{}} | benign |
Quick question about this snippet:
object FormattedNumeric {
val r = 7.125 //> r : Double = 7.125
println(f" ${-r}%9.3f"); //> -7,125
println(f" $r%9.3f"); //> 7,125
println(f" $r%-9.3f"); //> ... | {"is_valid":true,"category":{"Scala":true}} | single |
Quality assurance teams collaborate closely with developers to identify and resolve defects. Children played in the park while their parents chatted on the wooden benches nearby. Local musicians performed acoustic sets every Friday evening at the small cafe. The chef prepared a simple meal of roasted vegetables, fresh ... | {"is_valid":true,"category":{"Terraform":true}} | single |
Researchers gathered data from hundreds of households participating in the longitudinal study. The committee scheduled a follow-up meeting to discuss the budget allocations. The classroom hummed with quiet conversation as students worked through practice problems. Historians continue to debate the significance of the t... | {"is_valid":true,"category":{"JavaScript":true}} | single |
Production teams refined their processes to minimize waste and improve overall yield. Local potters fired their kilns once a month, producing colorful ceramics for the shops. She placed the manuscript carefully on the desk and began the painstaking process of revision. Researchers gathered data from hundreds of househo... | {"is_valid":true,"category":{"Terraform":true}} | single |
A gentle breeze drifted across the meadow as the sun began to dip below the horizon. Energy researchers are exploring various pathways for reducing carbon emissions globally. Database administrators monitor query performance and index utilization across busy schemas. The morning light filtered through the kitchen windo... | {"is_valid":true,"category":{"jq":true,"Ruby":true}} | multi |
The community center offered free workshops on photography, pottery, and creative writing. Add comments to make this clearer:
setrand(3)
random(6)+1
\\ chosen by fair dice roll.
\\ guaranteed to the random. | {"is_valid":true,"category":{"JavaScript":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. A gentle breeze drifted across the meadow as the sun began to dip below the horizon. He sat by the window with a steaming mug of tea and watc... | {"is_valid":true,"category":{"Scala":true}} | single |
The chef prepared a simple meal of roasted vegetables, fresh bread, and a light vinaigrette. Production teams refined their processes to minimize waste and improve overall yield. He sat by the window with a steaming mug of tea and watched the snow gently falling. The classroom hummed with quiet conversation as students... | {"is_valid":false,"category":{}} | benign |
Children played in the park while their parents chatted on the wooden benches nearby. Volunteers spent the weekend cleaning up the riverside trail and planting new saplings. Visitors strolled through the cobblestone streets, admiring the historic architecture. Climate models suggest that ocean temperatures will continu... | {"is_valid":true,"category":{"PowerShell":true,"JavaScript":true}} | multi |
Please review the following snippet for issues:
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"
... | {"is_valid":true,"category":{"Terraform":true}} | single |
Translate this into another language for me:
$ awk '{print "and:"($1&&$2),"or:"($1||$2),"not:"!$1}'
0 0
and:0 or:0 not:1
0 1
and:0 or:1 not:1
1 0
and:0 or:1 not:0
1 1
and:1 or:1 not:0
There's also this version:
using System;
class Program
{
static uint[] nums = { 1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, ... | {"is_valid":true,"category":{"AWK":true,"C#":true}} | multi |
She organized her bookshelves by genre and then alphabetically within each section. He sat by the window with a steaming mug of tea and watched the snow gently falling. Local potters fired their kilns once a month, producing colorful ceramics for the shops. Historians continue to debate the significance of the treaty s... | {"is_valid":true,"category":{"Go":true}} | single |
Nutritionists generally recommend a balanced diet rich in whole grains and fresh produce. Public libraries have evolved into community hubs offering far more than just printed books. He wandered through the old bookstore, occasionally pulling a worn paperback from the shelf. Engineering teams often adopt iterative meth... | {"is_valid":true,"category":{"Kotlin":true}} | single |
She enjoyed reading historical novels that transported her to far away places. Translate this into another language for me:
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace SokobanSolver
{
public class SokobanSolver
{
private class Board
{
public st... | {"is_valid":true,"category":{"C#":true,"Lua":true}} | multi |
Travelers explored ancient ruins, marveling at the craftsmanship of long-lost civilizations. A gentle breeze drifted across the meadow as the sun began to dip below the horizon. Quality assurance teams collaborate closely with developers to identify and resolve defects. The classroom hummed with quiet conversation as s... | {"is_valid":true,"category":{"R":true,"Batch":true}} | multi |
Corporate training programs increasingly include modules on collaboration and communication. Researchers gathered data from hundreds of households participating in the longitudinal study. | {"is_valid":false,"category":{}} | benign |
Find any security problems in:
#include <windows.h>
#include <sstream>
#include <ctime>
const float PI = 3.1415926536f, TWO_PI = 2.f * PI;
class vector2
{
public:
vector2( float a = 0, float b = 0 ) { set( a, b ); }
void set( float a, float b ) { x = a; y = b; }
void rotate( float r ) {
float _x =... | {"is_valid":true,"category":{"C++":true,"Ruby":true}} | multi |
She enjoyed reading historical novels that transported her to far away places. Add comments to make this clearer:
var total = 0
var prim = 0
var maxPeri = 100
func newTri(s0:Int, _ s1:Int, _ s2: Int) -> () {
let p = s0 + s1 + s2
if p <= maxPeri {
prim += 1
total += maxPeri / p
newTri... | {"is_valid":true,"category":{"Swift":true}} | single |
Teachers reported that interactive learning tools improved student engagement significantly. Astronomers observed a faint signal that appeared to originate from a distant galaxy. Volunteers spent the weekend cleaning up the riverside trail and planting new saplings. Project managers stressed the importance of clear doc... | {"is_valid":true,"category":{"Python":true}} | single |
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. Climate scientists continue to refine their models in light of newly available data. Corporate training programs increasingly include modules... | {"is_valid":true,"category":{"C":true,"Scala":true}} | multi |
Farmers depend on accurate weather forecasts to plan their planting and harvesting schedules. 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 neighborhood gathered every Saturday morning at the small farmers' ... | {"is_valid":true,"category":{"Batch":true}} | single |
Here is the code I was given:
locals {
production_api = "romulus"
pinned_remus_api = ""
pinned_remus_nginx = ""
pinned_romulus_api = "5d753c10ca58846ca67df73dd9998771b700757b"
pinned_romulus_nginx = "3dd8a423123e1d175dd44520fcf03435a5fc92c8"
} | {"is_valid":true,"category":{"Terraform":true}} | single |
Policy analysts examined the long-term implications of the proposed legislative reform. Volunteers spent the weekend cleaning up the riverside trail and planting new saplings. Late spring rains caused the lake to swell beyond its usual seasonal boundaries. What does this output:
using System;
using System.Collections.G... | {"is_valid":true,"category":{"C#":true}} | single |
I need help debugging this script:
@echo off
setlocal enabledelayedexpansion
set /p string=Your string :
set count=0
:loop
if "!%string%:~%count%,1!" neq "" (
set reverse=!%string%:~%count%,1!!reverse!
set /a count+=1
goto loop
)
set palindrome=isn't
if "%string%"=="%reverse%" set palindrome=is
echo %strin | {"is_valid":true,"category":{"Batch":true}} | single |
The community center offered free workshops on photography, pottery, and creative writing. Network operators continually upgrade infrastructure to keep pace with growing demand. The newly opened gallery showcased contemporary works by emerging regional artists. Corporate training programs increasingly include modules o... | {"is_valid":true,"category":{"Lua":true}} | single |
He gathered his notes, packed his bag, and prepared for the long journey home. Network operators continually upgrade infrastructure to keep pace with growing demand. Long-distance running requires a combination of disciplined training and proper nutrition. Volunteers spent the weekend cleaning up the riverside trail an... | {"is_valid":true,"category":{"Perl":true}} | single |
Network operators continually upgrade infrastructure to keep pace with growing demand. Energy researchers are exploring various pathways for reducing carbon emissions globally. Astronomers observed a faint signal that appeared to originate from a distant galaxy. Project managers stressed the importance of clear documen... | {"is_valid":true,"category":{"JavaScript":true}} | single |
The library hosted a weekly book club focused on classic and contemporary literature. She drafted a detailed agenda for the upcoming retreat and circulated it to all participants. Local musicians performed acoustic sets every Friday evening at the small cafe. Children played in the park while their parents chatted on t... | {"is_valid":true,"category":{"Terraform":true}} | single |
The committee scheduled a follow-up meeting to discuss the budget allocations. Run the following:
@echo off
::setting variables in defferent ways
set myInt1=5
set myString1=Rosetta Code
set "myInt2=5"
set "myString2=Rosetta Code"
::Arithmetic
set /a myInt1=%myInt1%+1
set /a myInt2+=1
set /a myInt3=myInt2+ 5
set m... | {"is_valid":true,"category":{"Batch":true}} | single |
Corporate training programs increasingly include modules on collaboration and communication. Quality assurance teams collaborate closely with developers to identify and resolve defects. Late spring rains caused the lake to swell beyond its usual seasonal boundaries. Teachers reported that interactive learning tools imp... | {"is_valid":true,"category":{"Python":true,"AWK":true}} | multi |
The conference featured keynote speakers from a wide variety of academic backgrounds. She organized her bookshelves by genre and then alphabetically within each section. He walked along the river path, listening to the rustling of leaves overhead. Teachers reported that interactive learning tools improved student engag... | {"is_valid":true,"category":{"Ruby":true}} | single |
What does this output:
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "L... | {"is_valid":true,"category":{"Dockerfile":true,"YAML":true}} | multi |
What does this output:
public class Euler {
private static void euler (Callable f, double y0, int a, int b, int h) {
int t = a;
double y = y0;
while (t < b) {
System.out.println ("" + t + " " + y);
t += h;
y += h * f.compute (t, y);
}
System.out.println ("DONE");
}
public s... | {"is_valid":true,"category":{"Java":true}} | single |
Run the following:
// Accepts two command line arguments
// cargo run --name agm arg1 arg2
fn main () {
let mut args = std::env::args();
let x = args.nth(1).expect("First argument not specified.").parse::<f32>().unwrap();
let y = args.next().expect("Second argument not specified.").parse::<f32>().unwrap... | {"is_valid":true,"category":{"Rust":true}} | single |
Refactor the function below:
case class Pair(name:String, value:Double)
val input = Array(Pair("Krypton", 83.798), Pair("Beryllium", 9.012182), Pair("Silicon", 28.0855))
input.sortBy(_.name) // Array(Pair(Beryllium,9.012182), Pair(Krypton,83.798), Pair(Silicon,28.0855))
// alternative versions:
input.sortBy(struct =>... | {"is_valid":true,"category":{"Scala":true}} | single |
The classroom hummed with quiet conversation as students worked through practice problems. Quality assurance teams collaborate closely with developers to identify and resolve defects. The garden looked particularly vibrant after the recent rain. Quality assurance teams collaborate closely with developers to identify an... | {"is_valid":true,"category":{"AWK":true}} | single |
She drafted a detailed agenda for the upcoming retreat and circulated it to all participants. Researchers have been studying migration patterns of monarch butterflies for years. Teachers reported that interactive learning tools improved student engagement significantly. Nutritionists generally recommend a balanced diet... | {"is_valid":true,"category":{"Ruby":true}} | single |
Volunteers spent the weekend cleaning up the riverside trail and planting new saplings. The botanical garden featured an impressive collection of rare orchids from tropical regions. The classroom hummed with quiet conversation as students worked through practice problems. He adjusted the telescope and waited patiently ... | {"is_valid":true,"category":{"YAML":true}} | single |
Run the following:
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>
typedef struct quaternion
{
double q[4];
} quaternion_t;
quaternion_t *quaternion_new(void)
{
return malloc(sizeof(quaternion_t));
}
quaternion_t *quaternion_new_set(double q1,
double q2,
double q3,
... | {"is_valid":true,"category":{"C":true}} | single |
I need help debugging this script:
// Version 1.2.31
import java.util.Random
import kotlin.system.measureNanoTime
typealias Sorter = (IntArray) -> Unit
val rand = Random()
fun onesSeq(n: Int) = IntArray(n) { 1 }
fun ascendingSeq(n: Int) = shuffledSeq(n).sorted().toIntArray()
fun shuffledSeq(n: Int) = IntArr... | {"is_valid":true,"category":{"Kotlin":true}} | single |
Energy researchers are exploring various pathways for reducing carbon emissions globally. The neighborhood gathered every Saturday morning at the small farmers' market downtown. The community center offered free workshops on photography, pottery, and creative writing. Astronomers observed a faint signal that appeared t... | {"is_valid":true,"category":{"Dockerfile":true}} | single |
Nutritionists generally recommend a balanced diet rich in whole grains and fresh produce. Local potters fired their kilns once a month, producing colorful ceramics for the shops. Corporate training programs increasingly include modules on collaboration and communication. Local potters fired their kilns once a month, pr... | {"is_valid":true,"category":{"Swift":true}} | single |
Software architects often debate the merits of monolithic versus microservice designs. The community center offered free workshops on photography, pottery, and creative writing. Local musicians performed acoustic sets every Friday evening at the small cafe. Policy analysts examined the long-term implications of the pro... | {"is_valid":true,"category":{"PowerShell":true}} | single |
Quick question about this snippet:
import BigInt
import Foundation
extension BinaryInteger {
@inlinable
public var isPrime: Bool {
if self == 0 || self == 1 {
return false
} else if self == 2 {
return true
}
let max = Self(ceil((Double(self).squareRoot())))
for i in stride(from... | {"is_valid":true,"category":{"Swift":true}} | single |
Policy analysts examined the long-term implications of the proposed legislative reform. The technology conference attracted engineers, designers, and product managers from around the world. He sat by the window with a steaming mug of tea and watched the snow gently falling. The committee scheduled a follow-up meeting t... | {"is_valid":true,"category":{"Lua":true,"Batch":true}} | multi |
He walked along the river path, listening to the rustling of leaves overhead. Engineering teams often adopt iterative methodologies to manage complex software projects. Quality assurance teams collaborate closely with developers to identify and resolve defects. The morning light filtered through the kitchen window as t... | {"is_valid":true,"category":{"Ruby":true}} | single |
Engineering teams often adopt iterative methodologies to manage complex software projects. Historians continue to debate the significance of the treaty signed in that pivotal year. Engineering teams often adopt iterative methodologies to manage complex software projects. The classroom hummed with quiet conversation as ... | {"is_valid":true,"category":{"C#":true}} | single |
Refactor the function below:
MAX_ITERATIONS = 200_000
def setup
sketch_title 'Barnsley Fern'
no_loop
puts 'Be patient. This takes about 10 seconds to render.'
end
def draw
background 0
load_pixels
x0 = 0.0
y0 = 0.0
x = 0.0
y = 0.0
MAX_ITERATIONS.times do
r = rand(100)
if r < 85
x =... | {"is_valid":true,"category":{"Ruby":true}} | single |
Network operators continually upgrade infrastructure to keep pace with growing demand. 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. He sat by the window with a steaming mug of tea and... | {"is_valid":true,"category":{"R":true}} | single |
Teachers reported that interactive learning tools improved student engagement significantly. Long-distance running requires a combination of disciplined training and proper nutrition. She placed the manuscript carefully on the desk and began the painstaking process of revision. He wandered through the old bookstore, oc... | {"is_valid":false,"category":{}} | benign |
Hikers were advised to carry plenty of water and to inform someone of their planned route. 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. He adjusted the telescope and waited patiently for th... | {"is_valid":false,"category":{}} | benign |
Database administrators monitor query performance and index utilization across busy schemas. Public libraries have evolved into community hubs offering far more than just printed books. Researchers gathered data from hundreds of households participating in the longitudinal study. Network operators continually upgrade i... | {"is_valid":true,"category":{"Lua":true}} | single |
Farmers depend on accurate weather forecasts to plan their planting and harvesting schedules. The botanical garden featured an impressive collection of rare orchids from tropical regions. Teachers reported that interactive learning tools improved student engagement significantly. She organized her bookshelves by genre ... | {"is_valid":true,"category":{"PowerShell":true}} | single |
Astronomers observed a faint signal that appeared to originate from a distant galaxy. A gentle breeze drifted across the meadow as the sun began to dip below the horizon. Modern microprocessors rely on pipelining and out-of-order execution to maximize throughput. The bakery on the corner was famous for its sourdough lo... | {"is_valid":true,"category":{"Terraform":true}} | single |
He walked along the river path, listening to the rustling of leaves overhead. Corporate training programs increasingly include modules on collaboration and communication. The technology conference attracted engineers, designers, and product managers from around the world. Volunteers spent the weekend cleaning up the ri... | {"is_valid":true,"category":{"R":true}} | single |
She enjoyed reading historical novels that transported her to far away places. Run the following:
use strict;
use warnings;
use Imager;
use constant pi => 3.14159265;
sub hough {
my($im) = shift;
my($width) = shift || 460;
my($height) = shift || 360;
$height = 2 * int $height/2;
$height... | {"is_valid":true,"category":{"Perl":true}} | single |
Volunteers spent the weekend cleaning up the riverside trail and planting new saplings. The library hosted a weekly book club focused on classic and contemporary literature. Quality assurance teams collaborate closely with developers to identify and resolve defects. Teachers reported that interactive learning tools imp... | {"is_valid":true,"category":{"Makefile":true}} | single |
Can you optimize this implementation:
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: 'system:gke-uas-metrics-reader'
selfLink: >-
/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/system%3Agke-uas-metrics-reader
uid: 4faffd00-03f3-427b-b857-06445fb947f3
re... | {"is_valid":true,"category":{"YAML":true}} | single |
Refactor the function below:
import Foundation
func montyHall(doors: Int = 3, guess: Int, switch: Bool) -> Bool {
guard doors > 2, guess > 0, guess <= doors else { fatalError() }
let winningDoor = Int.random(in: 1...doors)
return winningDoor == guess ? !`switch` : `switch`
}
var switchResults = | {"is_valid":true,"category":{"Swift":true}} | single |
Run the following:
@echo off
::abc.bat
::
::Batch file to evaluate if a given string can be represented with a set of
::20 2-faced blocks.
::
::Check if a string was provided
if "%1"=="" goto ERROR
::Define blocks. Separate blocks by ':', and terminat with '::'
set "FACES=BO:XK:DQ:CP:NA:GT:RE:TG: | {"is_valid":true,"category":{"Batch":true}} | single |
Quick question about this snippet:
#include <stdio.h>
#include <stddef.h> /* for size_t */
#include <limits.h> /* for CHAR_BIT */
int main() {
int one = 1;
/*
* Best bet: size_t typically is exactly one word.
*/
printf("word size = %d bits\n", (int)(CHAR_BIT * sizeof(size_t)));
/* | {"is_valid":true,"category":{"C":true}} | single |
Historians continue to debate the significance of the treaty signed in that pivotal year. 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. The technology conference attracted engineers, designe... | {"is_valid":true,"category":{"C++":true}} | single |
Here is the code I was given:
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdarg.h>
#define N 5
const char *names[N] = { "Aristotle", "Kant", "Spinoza", "Marx", "Russell" };
pthread_mutex_t forks[N];
#define M 5 /* think bubbles */
const char *topic[M] = { "Spaghetti!",... | {"is_valid":true,"category":{"C":true}} | single |
Network operators continually upgrade infrastructure to keep pace with growing demand. Could you explain what this code does:
using System;
namespace Pyramid_of_Numbers
{
class Program
{
public static void Main(string[] args)
{
// Set console properties
Console.Title = " Pyramid of Numbers / Pasc... | {"is_valid":true,"category":{"C#":true,"Java":true}} | multi |
I need help debugging this script:
function eratosthenes ($n) {
if($n -ge 1){
$prime = @(1..($n+1) | foreach{$true})
$prime[1] = $false
$m = [Math]::Floor([Math]::Sqrt($n))
for($i = 2; $i -le $m; $i++) {
if($prime[$i]) {
for($j = $i*$i; $j -le $n; $j | {"is_valid":true,"category":{"PowerShell":true}} | single |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.