prompt large_stringlengths 150 7.97k | target large_stringlengths 32 83 | kind large_stringclasses 3
values |
|---|---|---|
Quick question about this snippet:
// 2.5 implementations presented here: naive, optimized, and an iterator using
// the optimized function. The speeds vary significantly: relative
// speeds of optimized:iterator:naive implementations is 625:25:1.
#![feature(test)]
extern crate num;
extern crate test;
use num::b... | {"is_valid":true,"category":{"Rust":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. Astronomers observed a faint signal that appeared to originate from a distant galaxy. The engineer reviewed the blueprints carefu... | {"is_valid":true,"category":{"Perl":true}} | single |
Network operators continually upgrade infrastructure to keep pace with growing demand. Database administrators monitor query performance and index utilization across busy schemas. Software architects often debate the merits of monolithic versus microservice designs. He adjusted the telescope and waited patiently for th... | {"is_valid":false,"category":{}} | benign |
Volunteers spent the weekend cleaning up the riverside trail and planting new saplings. She organized her bookshelves by genre and then alphabetically within each section. Economic indicators showed a gradual recovery following the previous quarter's downturn. Quarterly reports indicated a steady rise in operational ef... | {"is_valid":false,"category":{}} | benign |
Public libraries have evolved into community hubs offering far more than just printed books. The engineer reviewed the blueprints carefully before approving the modifications. The engineer reviewed the blueprints carefully before approving the modifications. The chef prepared a simple meal of roasted vegetables, fresh ... | {"is_valid":true,"category":{"Python":true}} | single |
Researchers gathered data from hundreds of households participating in the longitudinal study. The chef prepared a simple meal of roasted vegetables, fresh bread, and a light vinaigrette. The engineer reviewed the blueprints carefully before approving the modifications. He wandered through the old bookstore, occasional... | {"is_valid":true,"category":{"Lua":true,"Batch":true}} | multi |
Take a look at this:
#lang racket
(struct Hex (x y letter clicked?) #:mutable #:transparent)
(define hexes
(let* ([A (char->integer #\A)]
[letters (take (shuffle (map (compose string integer->char)
(range A (+ A 26))))
20)])
(for*/list ([r... | {"is_valid":true,"category":{"Python":true}} | single |
The engineer reviewed the blueprints carefully before approving the modifications. Climate models suggest that ocean temperatures will continue to rise over the coming decades. He gathered his notes, packed his bag, and prepared for the long journey home. The bakery on the corner was famous for its sourdough loaves and... | {"is_valid":true,"category":{"YAML":true}} | single |
The technology conference attracted engineers, designers, and product managers from around the world. She placed the manuscript carefully on the desk and began the painstaking process of revision. Researchers gathered data from hundreds of households participating in the longitudinal study. Could you explain what this ... | {"is_valid":true,"category":{"Java":true}} | single |
Take a look at this:
def sumdigits: tostring | explode | map([.]|implode|tonumber) | add;
def gsum: . + sumdigits;
def isnonself:
def ndigits: tostring|length;
. as $i
| ($i - ($i|ndigits)*9) as $n
| any( range($i-1; [0,$n]|max; -1);
gsum == $i);
# an array
def last81:
[limit(81; range(1; infi... | {"is_valid":true,"category":{"jq":true,"AWK":true}} | multi |
I copied this from the docs:
@echo off
Setlocal EnableDelayedExpansion
call :clock
::timed function:fibonacci series.....................................
set /a a=0 ,b=1,c=1
:loop
if %c% lss 2000000000 echo %c% & set /a c=a+b,a=b, b=c & goto loop
::........................................................ | {"is_valid":true,"category":{"Batch":true}} | single |
Find any security problems in:
#include <iomanip>
#include <iostream>
#include <vector>
constexpr int MU_MAX = 1'000'000;
std::vector<int> MU;
int mobiusFunction(int n) {
if (!MU.empty()) {
return MU[n];
}
// Populate array
MU.resize(MU_MAX + 1, 1);
int root = sqrt(MU_MAX);
for (... | {"is_valid":true,"category":{"C++":true,"C":true}} | multi |
Long-distance running requires a combination of disciplined training and proper nutrition. The morning light filtered through the kitchen window as the coffee brewed. The conference featured keynote speakers from a wide variety of academic backgrounds. The committee scheduled a follow-up meeting to discuss the budget a... | {"is_valid":true,"category":{"C#":true}} | single |
Policy analysts examined the long-term implications of the proposed legislative reform. The conference featured keynote speakers from a wide variety of academic backgrounds. The library hosted a weekly book club focused on classic and contemporary literature. Researchers gathered data from hundreds of households partic... | {"is_valid":false,"category":{}} | benign |
Hikers were advised to carry plenty of water and to inform someone of their planned route. She drafted a detailed agenda for the upcoming retreat and circulated it to all participants. Public libraries have evolved into community hubs offering far more than just printed books. Climate scientists continue to refine thei... | {"is_valid":true,"category":{"Kotlin":true}} | single |
Please review the following snippet for issues:
class Frac
attr_accessor:num
attr_accessor:denom
def initialize(n,d)
if d == 0 then
raise ArgumentError.new('d cannot be zero')
end
nn = n
dd = d
if nn == 0 then
dd = 1
elsif dd < 0 th... | {"is_valid":true,"category":{"Ruby":true}} | single |
She enjoyed reading historical novels that transported her to far away places. The garden looked particularly vibrant after the recent rain. Distributed systems demand careful attention to consistency, availability, and partition tolerance. Travelers explored ancient ruins, marveling at the craftsmanship of long-lost c... | {"is_valid":true,"category":{"Lua":true,"Kotlin":true,"Swift":true}} | multi |
Here is the code I was given:
def matrix(m; n; init):
if m == 0 then [range(0;n)] | map(init)
elif m > 0 then [range(0;m)][ range(0;m) ] = matrix(0;n;init)
else error("matrix\(m);_;_) invalid")
end;
def printout:
. as $grid
| ($grid|length) as $height
| ($grid[0]|length) as $width
| reduce range(0;... | {"is_valid":true,"category":{"jq":true}} | single |
Local musicians performed acoustic sets every Friday evening at the small cafe. Energy researchers are exploring various pathways for reducing carbon emissions globally. The morning light filtered through the kitchen window as the coffee brewed. Long-distance running requires a combination of disciplined training and p... | {"is_valid":true,"category":{"C++":true}} | single |
Refactor the function below:
CREATE TABLE member (Time_of_purchase VARCHAR, age VARCHAR, address VARCHAR);
SELECT Time_of_purchase, age, address FROM member ORDER BY Time_of_purchase | {"is_valid":true,"category":{"SQL":true}} | single |
Nutritionists generally recommend a balanced diet rich in whole grains and fresh produce. Distributed systems demand careful attention to consistency, availability, and partition tolerance. Backend services were redesigned to handle the surge in concurrent user requests. Quarterly reports indicated a steady rise in ope... | {"is_valid":false,"category":{}} | benign |
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. She enjoyed reading historical novels that transported her to far away places. Network operators continually upgrade infrastructure to keep p... | {"is_valid":true,"category":{"Perl":true}} | single |
The library hosted a weekly book club focused on classic and contemporary literature. The morning light filtered through the kitchen window as the coffee brewed. Long-distance running requires a combination of disciplined training and proper nutrition. Teachers reported that interactive learning tools improved student ... | {"is_valid":true,"category":{"Batch":true}} | single |
She drafted a detailed agenda for the upcoming retreat and circulated it to all participants. She drafted a detailed agenda for the upcoming retreat and circulated it to all participants. Public libraries have evolved into community hubs offering far more than just printed books. Economic indicators showed a gradual re... | {"is_valid":true,"category":{"C#":true}} | single |
Quality assurance teams collaborate closely with developers to identify and resolve defects. The neighborhood gathered every Saturday morning at the small farmers' market downtown. Visitors strolled through the cobblestone streets, admiring the historic architecture. The botanical garden featured an impressive collecti... | {"is_valid":true,"category":{"C":true}} | single |
The botanical garden featured an impressive collection of rare orchids from tropical regions. Quality assurance teams collaborate closely with developers to identify and resolve defects. Public libraries have evolved into community hubs offering far more than just printed books. The committee scheduled a follow-up meet... | {"is_valid":true,"category":{"PowerShell":true}} | single |
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. Travelers explored ancient ruins, marveling at the craftsmanship of long-lost civilizations. He gathered his notes, packed his bag, and prepared for the lo... | {"is_valid":false,"category":{}} | benign |
Local musicians performed acoustic sets every Friday evening at the small cafe. I copied this from the docs:
use std::path::Path;
use std::fs;
fn truncate_file<P: AsRef<Path>>(filename: P, filesize: usize) -> Result<(), Error> {
use Error::*;
let file = fs::read(&filename).or(Err(NotFound))?;
if filesiz... | {"is_valid":true,"category":{"Rust":true}} | single |
Here is the code I was given:
#include <stdio.h>
typedef unsigned long long LONG;
LONG deranged(int depth, int len, int *d, int show)
{
int i;
char tmp;
LONG count = 0;
if (depth == len) {
if (show) {
for (i = 0; i < len; i++) putchar(d[i] + 'a... | {"is_valid":true,"category":{"C":true}} | single |
Climate scientists continue to refine their models in light of newly available data. He wandered through the old bookstore, occasionally pulling a worn paperback from the shelf. The garden looked particularly vibrant after the recent rain. Project managers stressed the importance of clear documentation throughout the c... | {"is_valid":true,"category":{"AWK":true,"C":true}} | multi |
The morning light filtered through the kitchen window as the coffee brewed. Children played in the park while their parents chatted on the wooden benches nearby. The morning light filtered through the kitchen window as the coffee brewed. Long-distance running requires a combination of disciplined training and proper nu... | {"is_valid":false,"category":{}} | benign |
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. She enjoyed reading historical novels that transported her to far away places. Modern microprocessors rely on pipelining and out-of-ord... | {"is_valid":false,"category":{}} | benign |
Network operators continually upgrade infrastructure to keep pace with growing demand. I need help debugging this script:
# defaults commands
CC=cc
RM=rm -f
INSTALL=install
INSTALL_PROGRAM=install -s -m 555
INSTALL_DATA=$(INSTALL) -m 444
INSTALL_SCRIPT=$(INSTALL_PROGRAM)
XGETTEXT=xgettext
MSGFMT=msgfmt
MKDIR=mkdir
CP=c... | {"is_valid":true,"category":{"Makefile":true}} | single |
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. Network operators continually upgrade infrastructure to keep pace with growing demand. He adjusted the telescope and waited patiently for the clou... | {"is_valid":true,"category":{"SQL":true}} | single |
Travelers explored ancient ruins, marveling at the craftsmanship of long-lost civilizations. The newly opened gallery showcased contemporary works by emerging regional artists. Late spring rains caused the lake to swell beyond its usual seasonal boundaries. The newly opened gallery showcased contemporary works by emerg... | {"is_valid":true,"category":{"R":true}} | single |
Please review the following snippet for issues:
/*Single dimensional array of integers*/
int a[10];
/*2-dimensional array, also called matrix of floating point numbers.
This matrix has 3 rows and 2 columns.*/
float b[3][2];
/*3-dimensional array ( Cube ? Cuboid ? Lattice ?) of characters*/
char c[4][5][6];
/*... | {"is_valid":true,"category":{"C":true}} | single |
Modern microprocessors rely on pipelining and out-of-order execution to maximize throughput. Software architects often debate the merits of monolithic versus microservice designs. Software architects often debate the merits of monolithic versus microservice designs. She drafted a detailed agenda for the upcoming retrea... | {"is_valid":false,"category":{}} | benign |
Translate this into another language for me:
def char2value(c):
assert c not in 'AEIOU', "No vowels"
return int(c, 36)
sedolweight = [1,3,1,7,3,9]
def checksum(sedol):
tmp = sum(map(lambda ch, weight: char2value(ch) * weight,
sedol, sedolweight)
)
return str((10 - (tmp %... | {"is_valid":true,"category":{"Python":true}} | single |
Farmers depend on accurate weather forecasts to plan their planting and harvesting schedules. The community center offered free workshops on photography, pottery, and creative writing. Researchers gathered data from hundreds of households participating in the longitudinal study. Climate scientists continue to refine th... | {"is_valid":true,"category":{"R":true,"AWK":true}} | multi |
Historians continue to debate the significance of the treaty signed in that pivotal year. Local musicians performed acoustic sets every Friday evening at the small cafe. He wandered through the old bookstore, occasionally pulling a worn paperback from the shelf. Researchers gathered data from hundreds of households par... | {"is_valid":false,"category":{}} | benign |
The conference featured keynote speakers from a wide variety of academic backgrounds. I copied this from the docs:
var str = ", World"
str = "Hello \(str)"
println(str) | {"is_valid":true,"category":{"Swift":true}} | single |
Distributed systems demand careful attention to consistency, availability, and partition tolerance. Modern microprocessors rely on pipelining and out-of-order execution to maximize throughput. The committee scheduled a follow-up meeting to discuss the budget allocations. Software architects often debate the merits of m... | {"is_valid":true,"category":{"jq":true}} | single |
Quarterly reports indicated a steady rise in operational efficiency across divisions. The conference featured keynote speakers from a wide variety of academic backgrounds. Researchers gathered data from hundreds of households participating in the longitudinal study. Could you explain what this code does:
# borrowed fro... | {"is_valid":true,"category":{"Bash":true}} | single |
Add comments to make this clearer:
using System.Drawing;
public class Pinstripe
{
static void Main(string[] args)
{
var pinstripe = MakePinstripeImage(1366, 768);
pinstripe.Save("pinstripe.png");
}
public static Bitmap MakePinstripeImage(int width, int height)
{
var image... | {"is_valid":true,"category":{"C#":true}} | single |
Historians continue to debate the significance of the treaty signed in that pivotal year. Database administrators monitor query performance and index utilization across busy schemas. Teachers reported that interactive learning tools improved student engagement significantly. The bakery on the corner was famous for its ... | {"is_valid":false,"category":{}} | benign |
Energy researchers are exploring various pathways for reducing carbon emissions globally. Production teams refined their processes to minimize waste and improve overall yield. Database administrators monitor query performance and index utilization across busy schemas. I need help debugging this script:
while true; do {... | {"is_valid":true,"category":{"Bash":true,"Go":true}} | multi |
Translate this into another language for me:
(() => {
'use strict';
const main = () => {
const
// DEALT
[rs_, bs_, discards] = threeStacks(
map(n =>
even(n) ? (
'R'
) : 'B', knuthShuffle(
... | {"is_valid":true,"category":{"JavaScript":true,"Dockerfile":true}} | multi |
Could you explain what this code does:
class Complex {
[Double]$x
[Double]$y
Complex() {
$this.x = 0
$this.y = 0
}
Complex([Double]$x, [Double]$y) {
$this.x = $x
$this.y = $y
}
[Double]abs2() {return $this.x*$this.x + $this.y*$this.y}
[Double]abs() {return [math]::sqrt($this.abs | {"is_valid":true,"category":{"PowerShell":true}} | single |
Energy researchers are exploring various pathways for reducing carbon emissions globally. Please review the following snippet for issues:
BEGIN {
s = "Hello,How,Are,You,Today"
split(s, arr, ",")
for(i=1; i < length(arr); i++) {
printf arr[i] "."
}
print
} Children played in the park while their parents ch... | {"is_valid":true,"category":{"AWK":true}} | single |
Climate scientists continue to refine their models in light of newly available data. Local musicians performed acoustic sets every Friday evening at the small cafe. He wandered through the old bookstore, occasionally pulling a worn paperback from the shelf. The classroom hummed with quiet conversation as students worke... | {"is_valid":true,"category":{"Rust":true}} | single |
Run the following:
@echo off
rem delayed expansion must be disabled before the FOR command.
setlocal disabledelayedexpansion
for /f "tokens=1* delims=]" %%A in ('type "File.txt"^|find /v /n ""') do (
set var=%%B
setlocal enabledelayedexpansion
echo(!var!
endlocal
) | {"is_valid":true,"category":{"Batch":true}} | single |
Local potters fired their kilns once a month, producing colorful ceramics for the shops. He sat by the window with a steaming mug of tea and watched the snow gently falling. Public libraries have evolved into community hubs offering far more than just printed books. I copied this from the docs:
SHELL := /usr/bin/env ba... | {"is_valid":true,"category":{"Makefile":true}} | single |
I copied this from the docs:
## Create a CSV file
@"
C1,C2,C3,C4,C5
1,5,9,13,17
2,6,10,14,18
3,7,11,15,19
4,8,12,16,20
"@ -split "`r`n" | Out-File -FilePath .\Temp.csv -Force
## Import each line of the CSV file into an array of PowerShell objects
$records = Import-Csv -Path .\Temp.csv
## Sum the values of the prope... | {"is_valid":true,"category":{"PowerShell":true}} | single |
Find any security problems in:
// Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
variable "cluster_kube_config_expiration" {
default = 2592000
}
variable "cluster_kube_config_token_version" {
default = "2.0.0"
}
data "oci_containerengine_cluster_kube_config" "test_cluster_kube_confi... | {"is_valid":true,"category":{"Terraform":true}} | single |
Policy analysts examined the long-term implications of the proposed legislative reform. He wandered through the old bookstore, occasionally pulling a worn paperback from the shelf. The chef prepared a simple meal of roasted vegetables, fresh bread, and a light vinaigrette. The painting featured warm colors that evoked ... | {"is_valid":true,"category":{"JavaScript":true}} | single |
The committee scheduled a follow-up meeting to discuss the budget allocations. Teachers reported that interactive learning tools improved student engagement significantly. A gentle breeze drifted across the meadow as the sun began to dip below the horizon. Production teams refined their processes to minimize waste and ... | {"is_valid":true,"category":{"SQL":true}} | single |
The conference featured keynote speakers from a wide variety of academic backgrounds. Climate scientists continue to refine their models in light of newly available data. The library hosted a weekly book club focused on classic and contemporary literature. Farmers depend on accurate weather forecasts to plan their plan... | {"is_valid":true,"category":{"C++":true}} | single |
The morning light filtered through the kitchen window as the coffee brewed. A gentle breeze drifted across the meadow as the sun began to dip below the horizon. Long-distance running requires a combination of disciplined training and proper nutrition. Travelers explored ancient ruins, marveling at the craftsmanship of ... | {"is_valid":true,"category":{"YAML":true}} | single |
She placed the manuscript carefully on the desk and began the painstaking process of revision. Astronomers observed a faint signal that appeared to originate from a distant galaxy. He wandered through the old bookstore, occasionally pulling a worn paperback from the shelf. Climate models suggest that ocean temperatures... | {"is_valid":true,"category":{"Scala":true,"R":true}} | multi |
Marketing analysts examined consumer behavior trends across multiple demographic segments. Modern microprocessors rely on pipelining and out-of-order execution to maximize throughput. Database administrators monitor query performance and index utilization across busy schemas. Statistical models can sometimes obscure th... | {"is_valid":true,"category":{"jq":true}} | single |
The chef prepared a simple meal of roasted vegetables, fresh bread, and a light vinaigrette. Policy analysts examined the long-term implications of the proposed legislative reform. Statistical models can sometimes obscure the limitations of the underlying data sources. The community center offered free workshops on pho... | {"is_valid":true,"category":{"Terraform":true,"AWK":true}} | multi |
The library hosted a weekly book club focused on classic and contemporary literature. The bakery on the corner was famous for its sourdough loaves and seasonal pastries. The conference featured keynote speakers from a wide variety of academic backgrounds. He walked along the river path, listening to the rustling of lea... | {"is_valid":true,"category":{"AWK":true}} | single |
I copied this from the docs:
# NMake Makefile to build Introspection Files for GtkSourceView
!include detectenv-msvc.mak
APIVERSION = 4
CHECK_PACKAGE = gtk+-3.0
built_install_girs = GtkSource-$(APIVERSION).gir
built_install_typelibs = GtkSource-$(APIVERSION).typelib
!include introspection-msvc.mak
!if | {"is_valid":true,"category":{"Makefile":true}} | single |
Here is the code I was given:
namespace RosettaCode.OrderTwoNumericalLists
{
using System;
using System.Collections.Generic;
internal static class Program
{
private static bool IsLessThan(this IEnumerable<int> enumerable,
IEnumerable<int> otherEnumerable)
{
usin... | {"is_valid":true,"category":{"C#":true,"Kotlin":true}} | multi |
Corporate training programs increasingly include modules on collaboration and communication. Here is the code I was given:
@echo off
set /a dummy=5/0 2>nul
if %errorlevel%==1073750993 echo I caught a division by zero operation...
exit /b 0
And separately, here's a related piece:
package main
import (
"fmt"
... | {"is_valid":true,"category":{"Batch":true,"Go":true}} | multi |
Researchers gathered data from hundreds of households participating in the longitudinal study. Hikers were advised to carry plenty of water and to inform someone of their planned route. Translate this into another language for me:
resource "terraform_state" "vpc" {
backend = "http"
config {
address = "h... | {"is_valid":true,"category":{"Terraform":true}} | single |
Backend services were redesigned to handle the surge in concurrent user requests. Policy analysts examined the long-term implications of the proposed legislative reform. He sat by the window with a steaming mug of tea and watched the snow gently falling. Travelers explored ancient ruins, marveling at the craftsmanship ... | {"is_valid":false,"category":{}} | benign |
The community center offered free workshops on photography, pottery, and creative writing. What does this output:
#!/bin/sh
<"$1" tr -cs A-Za-z '\n' | tr A-Z a-z | LC_ALL=C sort | uniq -c | sort -rn | head -n "$2" Economic indicators showed a gradual recovery following the previous quarter's downturn. The committee sch... | {"is_valid":true,"category":{"Bash":true}} | single |
Historians continue to debate the significance of the treaty signed in that pivotal year. He walked along the river path, listening to the rustling of leaves overhead. | {"is_valid":false,"category":{}} | benign |
Local potters fired their kilns once a month, producing colorful ceramics for the shops. Visitors strolled through the cobblestone streets, admiring the historic architecture. Travelers explored ancient ruins, marveling at the craftsmanship of long-lost civilizations. Late spring rains caused the lake to swell beyond i... | {"is_valid":true,"category":{"Makefile":true}} | single |
Economic indicators showed a gradual recovery following the previous quarter's downturn. The committee scheduled a follow-up meeting to discuss the budget allocations. Travelers explored ancient ruins, marveling at the craftsmanship of long-lost civilizations. The technology conference attracted engineers, designers, a... | {"is_valid":true,"category":{"Scala":true}} | single |
He adjusted the telescope and waited patiently for the clouds to clear over the observatory. Refactor the function below:
for i in xrange(10, -1, -1):
print i
On a related note, this block:
#include <ctype.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
static char rot13_table[UCHAR_MAX + 1];
sta... | {"is_valid":true,"category":{"Python":true,"C":true}} | multi |
Can you optimize this implementation:
use std::cmp;
pub fn jaro(s1: &str, s2: &str) -> f64 {
let s1_len = s1.len();
let s2_len = s2.len();
if s1_len == 0 && s2_len == 0 { return 1.0; }
let match_distance = cmp::max(s1_len, s2_len) / 2 - 1;
let mut s1_matches = vec![false; s1_len];
let mut s2 | {"is_valid":true,"category":{"Rust":true}} | single |
The library hosted a weekly book club focused on classic and contemporary literature. He sat by the window with a steaming mug of tea and watched the snow gently falling. Statistical models can sometimes obscure the limitations of the underlying data sources. He gathered his notes, packed his bag, and prepared for the ... | {"is_valid":false,"category":{}} | benign |
Quality assurance teams collaborate closely with developers to identify and resolve defects. Network operators continually upgrade infrastructure to keep pace with growing demand. Network operators continually upgrade infrastructure to keep pace with growing demand. Farmers depend on accurate weather forecasts to plan ... | {"is_valid":true,"category":{"AWK":true}} | single |
He walked along the river path, listening to the rustling of leaves overhead. Add comments to make this clearer:
#include <cstdlib>
#include <cstdio>
int main()
{
puts(getenv("HOME"));
return 0;
} | {"is_valid":true,"category":{"C++":true}} | single |
Economic indicators showed a gradual recovery following the previous quarter's downturn. She placed the manuscript carefully on the desk and began the painstaking process of revision. Refactor the function below:
2
2.
.3
45e6
45e+6
78e-9
1.2E34 He gathered his notes, packed his bag, and prepared for the long journey ho... | {"is_valid":true,"category":{"AWK":true}} | single |
Find any security problems in:
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;
class Program
{
static string fmt(int[] a)
{
var sb = new System.Text.StringBuilder();
for (int i = 0; i < a.Length; i++)
sb.Append(string.Format("{0,5}{1}... | {"is_valid":true,"category":{"C#":true,"Ruby":true}} | multi |
She drafted a detailed agenda for the upcoming retreat and circulated it to all participants. He adjusted the telescope and waited patiently for the clouds to clear over the observatory. Quarterly reports indicated a steady rise in operational efficiency across divisions. Visitors strolled through the cobblestone stree... | {"is_valid":false,"category":{}} | benign |
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. Network operators continually upgrade infrastructure to keep pace with growing demand. Network operators continually upgrade infrastructure t... | {"is_valid":true,"category":{"JavaScript":true,"Terraform":true,"Batch":true}} | multi |
Economic indicators showed a gradual recovery following the previous quarter's downturn. Astronomers observed a faint signal that appeared to originate from a distant galaxy. She enjoyed reading historical novels that transported her to far away places. Distributed systems demand careful attention to consistency, avail... | {"is_valid":true,"category":{"Batch":true}} | single |
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. Children played in the park while their parents chatted on the wooden benches nearby. Corporate training programs increasingly include ... | {"is_valid":true,"category":{"Scala":true,"Go":true,"JavaScript":true}} | multi |
Take a look at this:
function SubGen(seed)
local n, r, s = 54, {}, { [0]=seed, 1 }
for n = 2,54 do s[n] = (s[n-2] - s[n-1]) % 1e9 end
for n = 0,54 do r[n] = s[(34*(n+1))%55] end
local next = function()
n = (n+1) % 55
r[n] = (r[(n-55)%55] - r[(n-24)%55]) % 1e9
return r[n]
end
for n = 55,219 do ne... | {"is_valid":true,"category":{"Lua":true,"C++":true,"Java":true}} | multi |
Farmers depend on accurate weather forecasts to plan their planting and harvesting schedules. Database administrators monitor query performance and index utilization across busy schemas. Project managers stressed the importance of clear documentation throughout the cycle. Production teams refined their processes to min... | {"is_valid":false,"category":{}} | benign |
Hikers were advised to carry plenty of water and to inform someone of their planned route. Can you optimize this implementation:
$ awk 'BEGIN{print "HOME:"ENVIRON["HOME"],"USER:"ENVIRON["USER"]}' | {"is_valid":true,"category":{"AWK":true}} | single |
Late spring rains caused the lake to swell beyond its usual seasonal boundaries. What does this output:
main() {
elements=(
hydrogen helium lithium beryllium boron carbon
nitrogen oxygen fluorine neon sodium magnesium
aluminum silicon pho... | {"is_valid":true,"category":{"Bash":true,"SQL":true}} | multi |
The neighborhood gathered every Saturday morning at the small farmers' market downtown. He adjusted the telescope and waited patiently for the clouds to clear over the observatory. Add comments to make this clearer:
math.randomseed(os.time())
local a = {1,2,3}
print(a[math.random(1,#a)]) Quality assurance teams collabo... | {"is_valid":true,"category":{"Lua":true}} | single |
Network operators continually upgrade infrastructure to keep pace with growing demand. Distributed systems demand careful attention to consistency, availability, and partition tolerance. He adjusted the telescope and waited patiently for the clouds to clear over the observatory. The botanical garden featured an impress... | {"is_valid":true,"category":{"SQL":true,"Batch":true,"Bash":true}} | multi |
Volunteers spent the weekend cleaning up the riverside trail and planting new saplings. I copied this from the docs:
#include <algorithm>
#include <iostream>
#include <sstream>
#include <gmpxx.h>
using integer = mpz_class;
std::string to_string(const integer& n) {
std::ostringstream out;
out << n;
ret... | {"is_valid":true,"category":{"C++":true}} | single |
Distributed systems demand careful attention to consistency, availability, and partition tolerance. Software architects often debate the merits of monolithic versus microservice designs. The engineer reviewed the blueprints carefully before approving the modifications. Hikers were advised to carry plenty of water and t... | {"is_valid":true,"category":{"JavaScript":true,"Batch":true}} | multi |
The engineer reviewed the blueprints carefully before approving the modifications. Find any security problems in:
public class Tree<T>{
private T value;
private Tree<T> left;
private Tree<T> right;
public void replaceAll(T value){
this.value = value;
if (left != null)
left.replaceAll(value);
if (right !=... | {"is_valid":true,"category":{"Java":true}} | single |
She enjoyed reading historical novels that transported her to far away places. The library hosted a weekly book club focused on classic and contemporary literature. A gentle breeze drifted across the meadow as the sun began to dip below the horizon. The garden looked particularly vibrant after the recent rain. Project ... | {"is_valid":true,"category":{"Rust":true}} | single |
The morning light filtered through the kitchen window as the coffee brewed. Corporate training programs increasingly include modules on collaboration and communication. Policy analysts examined the long-term implications of the proposed legislative reform. The morning light filtered through the kitchen window as the co... | {"is_valid":true,"category":{"Kotlin":true}} | single |
She placed the manuscript carefully on the desk and began the painstaking process of revision. The painting featured warm colors that evoked memories of childhood summers by the sea. Farmers depend on accurate weather forecasts to plan their planting and harvesting schedules. The library hosted a weekly book club focus... | {"is_valid":true,"category":{"Ruby":true}} | single |
Refactor the function below:
#include <stdio.h>
#include <limits.h>
#define TRUE 1
#define FALSE 0
#define N_ROWS 4
#define N_COLS 5
typedef int bool;
int supply[N_ROWS] = { 50, 60, 50, 50 };
int demand[N_COLS] = { 30, 20, 70, 30, 60 };
int costs[N_ROWS][N_COLS] = {
{ 16, 16, 13, 22, 17 },
{ 14, 14, 13,... | {"is_valid":true,"category":{"C":true,"Lua":true,"JavaScript":true}} | multi |
The garden looked particularly vibrant after the recent rain. Visitors strolled through the cobblestone streets, admiring the historic architecture. Astronomers observed a faint signal that appeared to originate from a distant galaxy. Climate scientists continue to refine their models in light of newly available data. ... | {"is_valid":true,"category":{"AWK":true}} | single |
Add comments to make this clearer:
// [dependencies]
// rug = "1.15.0"
fn is_curzon(n: u32, k: u32) -> bool {
use rug::{Complete, Integer};
(Integer::u_pow_u(k, n).complete() + 1) % (k * n + 1) == 0
}
fn main() {
for k in (2..=10).step_by(2) {
println!("Curzon numbers with base {k}:");
l... | {"is_valid":true,"category":{"Rust":true}} | single |
Historians continue to debate the significance of the treaty signed in that pivotal year. Researchers have been studying migration patterns of monarch butterflies for years. Astronomers observed a faint signal that appeared to originate from a distant galaxy. Public libraries have evolved into community hubs offering f... | {"is_valid":true,"category":{"Bash":true}} | single |
Quarterly reports indicated a steady rise in operational efficiency across divisions. Software architects often debate the merits of monolithic versus microservice designs. Network operators continually upgrade infrastructure to keep pace with growing demand. She enjoyed reading historical novels that transported her t... | {"is_valid":true,"category":{"C++":true,"Rust":true}} | multi |
Add comments to make this clearer:
VERSION=0.1
BUILDDATE=20091203
#MANCOUNTRIES=en_GB
CFLAGS=-I. -ggdb -Wall -O2
LDFLAGS=-nopie -lsqlite3
CC=gcc
INSTALL=install
XGETTEXT=xgettext
MSGMERGE=msgmerge
MSGFMT=msgfmt
DOCBOOK2MAN=docbook2man.pl
prefix=/usr/local
mandir=${prefix}/share/man
localedir=${prefix}/share/locale
... | {"is_valid":true,"category":{"Makefile":true}} | single |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.