prompt large_stringlengths 150 7.97k | target large_stringlengths 32 83 | kind large_stringclasses 3
values |
|---|---|---|
Here is the code I was given:
function gauss-jordan-inv([double[][]]$a) {
$n = $a.count
[double[][]]$b = 0..($n-1) | foreach{[double[]]$row = @(0) * $n; $row[$_] = 1; ,$row}
for ($k = 0; $k -lt $n; $k++) {
$lmax, $max = $k, [Math]::Abs($a[$k][$k])
for ($l = $k+1; $l -lt $n; $l++) {
... | {"is_valid":true,"category":{"PowerShell":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. Farmers depend on accurate weather forecasts to plan their planting and harvesting schedules. She drafted a detailed agenda for... | {"is_valid":true,"category":{"PowerShell":true}} | single |
Refactor the function below:
from itertools import combinations, product, count
from functools import lru_cache, reduce
_bbullet, _wbullet = '\u2022\u25E6'
_or = set.__or__
def place(m, n):
"Place m black and white queens, peacefully, on an n-by-n board"
board = set(product(range(n), repeat=2)) # (x, y) ... | {"is_valid":true,"category":{"Python":true}} | single |
Statistical models can sometimes obscure the limitations of the underlying data sources. The garden looked particularly vibrant after the recent rain. Local potters fired their kilns once a month, producing colorful ceramics for the shops. The neighborhood gathered every Saturday morning at the small farmers' market do... | {"is_valid":true,"category":{"jq":true}} | single |
Volunteers spent the weekend cleaning up the riverside trail and planting new saplings. Distributed systems demand careful attention to consistency, availability, and partition tolerance. Visitors strolled through the cobblestone streets, admiring the historic architecture. The garden looked particularly vibrant after ... | {"is_valid":false,"category":{}} | benign |
Children played in the park while their parents chatted on the wooden benches nearby. He sat by the window with a steaming mug of tea and watched the snow gently falling. Climate scientists continue to refine their models in light of newly available data. Climate models suggest that ocean temperatures will continue to ... | {"is_valid":true,"category":{"Python":true,"C":true}} | multi |
Researchers have been studying migration patterns of monarch butterflies for years. Researchers gathered data from hundreds of households participating in the longitudinal study. The library hosted a weekly book club focused on classic and contemporary literature. Could you explain what this code does:
import java.io.B... | {"is_valid":true,"category":{"Java":true}} | single |
Run the following:
<%inherit file="master.mak" />
<div class='hero-unit'>
<h1>HW</h1>
<p>"Work From Home" gets better later, promise.</p>
</div>
<div class="row-fluid">
<div class="span4">
<ul class="unstyled">
<h2>Tasks</h2>
%for hw in hws:
<li><a href="/static/... | {"is_valid":true,"category":{"Makefile":true}} | single |
He wandered through the old bookstore, occasionally pulling a worn paperback from the shelf. Could you explain what this code does:
KnapsackItem = Struct.new(:volume, :weight, :value)
panacea = KnapsackItem.new(0.025, 0.3, 3000)
ichor = KnapsackItem.new(0.015, 0.2, 1800)
gold = KnapsackItem.new(0.002, 2.0, 2500)
m... | {"is_valid":true,"category":{"Ruby":true}} | single |
The chef prepared a simple meal of roasted vegetables, fresh bread, and a light vinaigrette. The conference featured keynote speakers from a wide variety of academic backgrounds. Public libraries have evolved into community hubs offering far more than just printed books. Can you optimize this implementation:
$ awk 'fun... | {"is_valid":true,"category":{"AWK":true}} | single |
Could you explain what this code does:
encode() {
local phrase=$1
[[ -z $phrase ]] && return
local result="" count=0 char=${phrase:0:1}
for ((i = 0; i < ${#phrase}; i++)); do
if [[ ${phrase:i:1} == "$char" ]]; then
((count++))
else
result+="$(encode_sequence "$cou... | {"is_valid":true,"category":{"Bash":true,"PowerShell":true}} | multi |
She placed the manuscript carefully on the desk and began the painstaking process of revision. Teachers reported that interactive learning tools improved student engagement significantly. Network operators continually upgrade infrastructure to keep pace with growing demand. Corporate training programs increasingly incl... | {"is_valid":true,"category":{"Python":true}} | single |
Policy analysts examined the long-term implications of the proposed legislative reform. Astronomers observed a faint signal that appeared to originate from a distant galaxy. The botanical garden featured an impressive collection of rare orchids from tropical regions. The garden looked particularly vibrant after the rec... | {"is_valid":true,"category":{"Dockerfile":true}} | single |
Public libraries have evolved into community hubs offering far more than just printed books. Network operators continually upgrade infrastructure to keep pace with growing demand. Production teams refined their processes to minimize waste and improve overall yield. The morning light filtered through the kitchen window ... | {"is_valid":true,"category":{"Bash":true}} | single |
Database administrators monitor query performance and index utilization across busy schemas. Researchers gathered data from hundreds of households participating in the longitudinal study. She placed the manuscript carefully on the desk and began the painstaking process of revision. Nutritionists generally recommend a b... | {"is_valid":true,"category":{"C++":true}} | single |
Visitors strolled through the cobblestone streets, admiring the historic architecture. Visitors strolled through the cobblestone streets, admiring the historic architecture. He walked along the river path, listening to the rustling of leaves overhead. Economic indicators showed a gradual recovery following the previous... | {"is_valid":true,"category":{"Makefile":true}} | single |
She enjoyed reading historical novels that transported her to far away places. She drafted a detailed agenda for the upcoming retreat and circulated it to all participants. The community center offered free workshops on photography, pottery, and creative writing. He adjusted the telescope and waited patiently for the c... | {"is_valid":true,"category":{"C#":true}} | single |
Climate models suggest that ocean temperatures will continue to rise over the coming decades. 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. Policy analysts examined the long-term imp... | {"is_valid":true,"category":{"Scala":true}} | single |
Nutritionists generally recommend a balanced diet rich in whole grains and fresh produce. Hikers were advised to carry plenty of water and to inform someone of their planned route. Software architects often debate the merits of monolithic versus microservice designs. He sat by the window with a steaming mug of tea and ... | {"is_valid":true,"category":{"SQL":true}} | single |
She organized her bookshelves by genre and then alphabetically within each section. 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. Production teams refined their processes to minimize waste and improve ove... | {"is_valid":false,"category":{}} | benign |
Take a look at this:
--returns an iterator over the first n copies of the look-and-say sequence
function lookandsayseq(n)
local t = {1}
return function()
local ret = {}
for i, v in ipairs(t) do
if t[i-1] and v == t[i-1] then
ret[#ret - 1] = ret[#ret - 1] + 1
else
ret[#ret + 1] = ... | {"is_valid":true,"category":{"Lua":true,"R":true,"Dockerfile":true}} | multi |
Translate this into another language for me:
{
split($1,a,"");
for (i=1;i<=4;++i) {
t[i,a[i]]++;
}
}
END {
for (k in t) {
split(k,a,SUBSEP)
for (l in t) {
split(l, b, SUBSEP)
if (a[1] == b[1] && t[k] < t[l]) {
s[a[1]] = a[2]
break
}
}
}
print s[1]s[2]s[... | {"is_valid":true,"category":{"AWK":true,"Rust":true}} | multi |
Farmers depend on accurate weather forecasts to plan their planting and harvesting schedules. He wandered through the old bookstore, occasionally pulling a worn paperback from the shelf. Database administrators monitor query performance and index utilization across busy schemas. She placed the manuscript carefully on t... | {"is_valid":true,"category":{"Batch":true}} | single |
I need help debugging this script:
# euler_method takes a filter (df), initial condition
# (x1,y1), ending x (x2), and step size as parameters;
# it emits the y values at each iteration.
# df must take [x,y] as its input.
def euler_method(df; x1; y1; x2; h):
h as $h
| [x1, y1]
| recurse( if ((.[0] < x2 and | {"is_valid":true,"category":{"jq":true}} | single |
Farmers depend on accurate weather forecasts to plan their planting and harvesting schedules. Please review the following snippet for issues:
import os
for directory in ['/', './']:
open(directory + 'output.txt', 'w').close() # create /output.txt, then ./output.txt
os.mkdir(directory + 'docs') # cr... | {"is_valid":true,"category":{"Python":true}} | single |
The botanical garden featured an impressive collection of rare orchids from tropical regions. Astronomers observed a faint signal that appeared to originate from a distant galaxy. Production teams refined their processes to minimize waste and improve overall yield. Quality assurance teams collaborate closely with devel... | {"is_valid":false,"category":{}} | benign |
Here is the code I was given:
object SudokuSolver extends App {
class Solver {
var solution = new Array[Int](81) //listOfFields toArray
val fp2m: Int => Tuple2[Int,Int] = pos => Pair(pos/9+1,pos%9+1) //get row, col from array position
val setAll = (1 to 9) toSet //all possibilities
val array... | {"is_valid":true,"category":{"Scala":true}} | single |
I need help debugging this script:
#!/usr/bin/awk -f
BEGIN {
initStack()
initOpers()
print "Infix: " toInfix("3 4 2 * 1 5 - 2 3 ^ ^ / +")
print ""
print "Infix: " toInfix("1 2 + 3 4 + ^ 5 6 + ^")
print ""
print "Infix: " toInfix("moon stars mud + * fire soup * ^")
exit
}
function ini... | {"is_valid":true,"category":{"AWK":true}} | single |
Travelers explored ancient ruins, marveling at the craftsmanship of long-lost civilizations. Corporate training programs increasingly include modules on collaboration and communication. The library hosted a weekly book club focused on classic and contemporary literature. Nutritionists generally recommend a balanced die... | {"is_valid":true,"category":{"Swift":true}} | single |
Network operators continually upgrade infrastructure to keep pace with growing demand. Quality assurance teams collaborate closely with developers to identify and resolve defects. Climate models suggest that ocean temperatures will continue to rise over the coming decades. He gathered his notes, packed his bag, and pre... | {"is_valid":true,"category":{"R":true}} | single |
Please review the following snippet for issues:
import random
def count(w1,wnew):
return sum(c1==c2 for c1,c2 in zip(w1, wnew))
def best_shuffle(w):
wnew = list(w)
n = len(w)
rangelists = (list(range(n)), list(range(n)))
for r in rangelists:
random.shuffle(r)
rangei, rangej = rangeli... | {"is_valid":true,"category":{"Python":true,"C++":true}} | multi |
Long-distance running requires a combination of disciplined training and proper nutrition. The garden looked particularly vibrant after the recent rain. Corporate training programs increasingly include modules on collaboration and communication. Local musicians performed acoustic sets every Friday evening at the small ... | {"is_valid":true,"category":{"R":true}} | single |
Network operators continually upgrade infrastructure to keep pace with growing demand. Policy analysts examined the long-term implications of the proposed legislative reform. The chef prepared a simple meal of roasted vegetables, fresh bread, and a light vinaigrette. He walked along the river path, listening to the rus... | {"is_valid":true,"category":{"C#":true}} | single |
Corporate training programs increasingly include modules on collaboration and communication. Run the following:
// Version 1.2.61
import java.util.Random
fun main(args: Array<String>) {
// Create pack, half red, half black and shuffle it.
val pack = MutableList(52) { if (it < 26) 'R' else 'B' }
pack.shu... | {"is_valid":true,"category":{"Kotlin":true}} | single |
Refactor the function below:
package main
import "fmt"
var grid []byte
var w, h, last int
var cnt int
var next [4]int
var dir = [4][2]int{{0, -1}, {-1, 0}, {0, 1}, {1, 0}}
func walk(y, x int) {
if y == 0 || y == h || x == 0 || x == w {
cnt += 2
return
}
t := y*(w+1) + x | {"is_valid":true,"category":{"Go":true}} | single |
He walked along the river path, listening to the rustling of leaves overhead. Astronomers observed a faint signal that appeared to originate from a distant galaxy. Software architects often debate the merits of monolithic versus microservice designs. Teachers reported that interactive learning tools improved student en... | {"is_valid":true,"category":{"jq":true}} | single |
The painting featured warm colors that evoked memories of childhood summers by the sea. He sat by the window with a steaming mug of tea and watched the snow gently falling. She drafted a detailed agenda for the upcoming retreat and circulated it to all participants. The community center offered free workshops on photog... | {"is_valid":true,"category":{"PowerShell":true,"C":true}} | multi |
The engineer reviewed the blueprints carefully before approving the modifications. Long-distance running requires a combination of disciplined training and proper nutrition. He walked along the river path, listening to the rustling of leaves overhead. The library hosted a weekly book club focused on classic and contemp... | {"is_valid":true,"category":{"C#":true,"SQL":true}} | multi |
Visitors strolled through the cobblestone streets, admiring the historic architecture. He walked along the river path, listening to the rustling of leaves overhead. Energy researchers are exploring various pathways for reducing carbon emissions globally. She organized her bookshelves by genre and then alphabetically wi... | {"is_valid":true,"category":{"Makefile":true,"Go":true}} | multi |
The painting featured warm colors that evoked memories of childhood summers by the sea. The garden looked particularly vibrant after the recent rain. Researchers gathered data from hundreds of households participating in the longitudinal study. The community center offered free workshops on photography, pottery, and cr... | {"is_valid":true,"category":{"YAML":true,"Batch":true}} | multi |
The chef prepared a simple meal of roasted vegetables, fresh bread, and a light vinaigrette. She organized her bookshelves by genre and then alphabetically within each section. Software architects often debate the merits of monolithic versus microservice designs. The painting featured warm colors that evoked memories o... | {"is_valid":true,"category":{"Makefile":true,"Rust":true}} | multi |
Take a look at this:
use 5.020;
use warnings;
use ntheory qw/:all/;
use experimental qw/signatures/;
sub chernick_carmichael_factors ($n, $m) {
(6*$m + 1, 12*$m + 1, (map { (1 << $_) * 9*$m + 1 } 1 .. $n-2));
}
sub chernick_carmichael_number ($n, $callback) {
my $multiplier = ($n > 4) ? | {"is_valid":true,"category":{"Perl":true}} | single |
Run the following:
/** Roll our own pared-down BigFraction class just for these Bernoulli Numbers */
case class BFraction( numerator:BigInt, denominator:BigInt ) {
require( denominator != BigInt(0), "Denominator cannot be zero" )
val gcd = numerator.gcd(denominator)
val num = numerator / gcd
val den = denom... | {"is_valid":true,"category":{"Scala":true}} | single |
Researchers gathered data from hundreds of households participating in the longitudinal study. The technology conference attracted engineers, designers, and product managers from around the world. Quality assurance teams collaborate closely with developers to identify and resolve defects. Economic indicators showed a g... | {"is_valid":true,"category":{"Terraform":true}} | single |
Can you optimize this implementation:
-- Generate a random substitution cipher for ASCII characters 65 to 122
function randomCipher ()
local cipher, rnd = {plain = {}, encoded = {}}
for ascii = 65, 122 do
table.insert(cipher.plain, string.char(ascii))
table.insert(cipher.encoded, string.char(asc... | {"is_valid":true,"category":{"Lua":true}} | single |
Take a look at this:
#include <iostream>
#include <vector>
using namespace std;
double horner(vector<double> v, double x)
{
double s = 0;
for( vector<double>::const_reverse_iterator i = v.rbegin(); i != v.rend(); i++ )
s = s*x + *i;
return s;
}
int main()
{
double c[] = { -19, 7, | {"is_valid":true,"category":{"C++":true}} | single |
He gathered his notes, packed his bag, and prepared for the long journey home. 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. The community center offered free workshops on photography, pottery, and ... | {"is_valid":false,"category":{}} | benign |
A gentle breeze drifted across the meadow as the sun began to dip below the horizon. Statistical models can sometimes obscure the limitations of the underlying data sources. He adjusted the telescope and waited patiently for the clouds to clear over the observatory. What does this output:
use strict; use warnings;
requ... | {"is_valid":true,"category":{"Perl":true}} | single |
Distributed systems demand careful attention to consistency, availability, and partition tolerance. Researchers gathered data from hundreds of households participating in the longitudinal study. Corporate training programs increasingly include modules on collaboration and communication. The newly opened gallery showcas... | {"is_valid":false,"category":{}} | benign |
She organized her bookshelves by genre and then alphabetically within each section. The bakery on the corner was famous for its sourdough loaves and seasonal pastries. The newly opened gallery showcased contemporary works by emerging regional artists. He sat by the window with a steaming mug of tea and watched the snow... | {"is_valid":false,"category":{}} | benign |
The conference featured keynote speakers from a wide variety of academic backgrounds. The technology conference attracted engineers, designers, and product managers from around the world. Researchers have been studying migration patterns of monarch butterflies for years. Network operators continually upgrade infrastruc... | {"is_valid":true,"category":{"Makefile":true}} | single |
She drafted a detailed agenda for the upcoming retreat and circulated it to all participants. He sat by the window with a steaming mug of tea and watched the snow gently falling. Network operators continually upgrade infrastructure to keep pace with growing demand. Marketing analysts examined consumer behavior trends a... | {"is_valid":true,"category":{"YAML":true}} | single |
Translate this into another language for me:
resource "aws_dynamodb_table" "threat_intel_ioc" {
name = "${var.prefix}_streamalert_threat_intel_downloader"
read_capacity = "${var.table_rcu}"
write_capacity = "${var.table_wcu}"
hash_key = "value"
attribute {
name = "value"
type = "S"
... | {"is_valid":true,"category":{"Terraform":true,"Scala":true}} | multi |
Long-distance running requires a combination of disciplined training and proper nutrition. Hikers were advised to carry plenty of water and to inform someone of their planned route. Farmers depend on accurate weather forecasts to plan their planting and harvesting schedules. The chef prepared a simple meal of roasted v... | {"is_valid":false,"category":{}} | benign |
Translate this into another language for me:
# Sample classes for reflection
class Super
CLASSNAME = 'super'
def initialize(name)
@name = name
def self.superOwn
'super owned'
end
end
def to_s
"Super(#{@name})"
end
def doSup
'did super stuff'
end
def self.superClassStuff... | {"is_valid":true,"category":{"Ruby":true}} | single |
Historians continue to debate the significance of the treaty signed in that pivotal year. Policy analysts examined the long-term implications of the proposed legislative reform. Researchers have been studying migration patterns of monarch butterflies for years. The painting featured warm colors that evoked memories of ... | {"is_valid":true,"category":{"Kotlin":true,"Terraform":true}} | multi |
She enjoyed reading historical novels that transported her to far away places. Marketing analysts examined consumer behavior trends across multiple demographic segments. Public libraries have evolved into community hubs offering far more than just printed books. Backend services were redesigned to handle the surge in c... | {"is_valid":true,"category":{"R":true,"Scala":true,"C#":true}} | multi |
Network operators continually upgrade infrastructure to keep pace with growing demand. Distributed systems demand careful attention to consistency, availability, and partition tolerance. Network operators continually upgrade infrastructure to keep pace with growing demand. Statistical models can sometimes obscure the l... | {"is_valid":true,"category":{"YAML":true}} | single |
Climate models suggest that ocean temperatures will continue to rise over the coming decades. A gentle breeze drifted across the meadow as the sun began to dip below the horizon. Travelers explored ancient ruins, marveling at the craftsmanship of long-lost civilizations. Modern microprocessors rely on pipelining and ou... | {"is_valid":true,"category":{"JavaScript":true}} | single |
Marketing analysts examined consumer behavior trends across multiple demographic segments. Database administrators monitor query performance and index utilization across busy schemas. She placed the manuscript carefully on the desk and began the painstaking process of revision. The bakery on the corner was famous for i... | {"is_valid":true,"category":{"R":true}} | single |
The bakery on the corner was famous for its sourdough loaves and seasonal pastries. Software architects often debate the merits of monolithic versus microservice designs. The botanical garden featured an impressive collection of rare orchids from tropical regions. The newly opened gallery showcased contemporary works b... | {"is_valid":true,"category":{"jq":true}} | single |
He walked along the river path, listening to the rustling of leaves overhead. Modern microprocessors rely on pipelining and out-of-order execution to maximize throughput. Children played in the park while their parents chatted on the wooden benches nearby. A gentle breeze drifted across the meadow as the sun began to d... | {"is_valid":true,"category":{"Java":true}} | single |
Could you explain what this code does:
# -----------------------------------------------------------------------------
#
# (c) 2009 The University of Glasgow
#
# This file is part of the GHC build system.
#
# To understand how the build system works and how to modify it, see
# http://hackage.haskell.org/trac/ghc/ | {"is_valid":true,"category":{"Makefile":true}} | single |
Software architects often debate the merits of monolithic versus microservice designs. Could you explain what this code does:
if ($expression) {
do_something;
} | {"is_valid":true,"category":{"Perl":true}} | single |
Historians continue to debate the significance of the treaty signed in that pivotal year. She enjoyed reading historical novels that transported her to far away places. The neighborhood gathered every Saturday morning at the small farmers' market downtown. The conference featured keynote speakers from a wide variety of... | {"is_valid":true,"category":{"JavaScript":true}} | single |
Travelers explored ancient ruins, marveling at the craftsmanship of long-lost civilizations. She enjoyed reading historical novels that transported her to far away places. Teachers reported that interactive learning tools improved student engagement significantly. She enjoyed reading historical novels that transported ... | {"is_valid":true,"category":{"jq":true}} | single |
Can you optimize this implementation:
import scala.math.BigInt
object MillerRabinPrimalityTest extends App {
val (n, certainty )= (BigInt(args(0)), args(1).toInt)
println(s"$n is ${if (n.isProbablePrime(certainty)) "probably prime" else "composite"}")
} | {"is_valid":true,"category":{"Scala":true}} | single |
Local potters fired their kilns once a month, producing colorful ceramics for the shops. 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. The engineer reviewed the blueprints carefully before a... | {"is_valid":true,"category":{"JavaScript":true}} | single |
Energy researchers are exploring various pathways for reducing carbon emissions globally. The painting featured warm colors that evoked memories of childhood summers by the sea. She drafted a detailed agenda for the upcoming retreat and circulated it to all participants. Historians continue to debate the significance o... | {"is_valid":true,"category":{"R":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. Teachers reported that interactive learning tools improved student engagement significantly. He sat by the window with a steaming mug of tea and w... | {"is_valid":true,"category":{"R":true}} | single |
Long-distance running requires a combination of disciplined training and proper nutrition. The morning light filtered through the kitchen window as the coffee brewed. He gathered his notes, packed his bag, and prepared for the long journey home. Public libraries have evolved into community hubs offering far more than j... | {"is_valid":true,"category":{"Lua":true}} | single |
Marketing analysts examined consumer behavior trends across multiple demographic segments. Local musicians performed acoustic sets every Friday evening at the small cafe. Run the following:
now <- Sys.time()
strftime(now, "%Y-%m-%d")
strftime(now, "%A, %B %d, %Y")
Alongside it, this:
function Get-MeanTimeOfDay
{
[... | {"is_valid":true,"category":{"R":true,"PowerShell":true}} | multi |
Backend services were redesigned to handle the surge in concurrent user requests. Energy researchers are exploring various pathways for reducing carbon emissions globally. Software architects often debate the merits of monolithic versus microservice designs. The committee scheduled a follow-up meeting to discuss the bu... | {"is_valid":true,"category":{"jq":true}} | single |
Could you explain what this code does:
# Clone from the CentOS 7
FROM centos:centos7
MAINTAINER Jan Pazdziora
RUN mkdir -p /run/lock && yum install -y ipa-server ipa-server-dns bind bind-dyndb-ldap && yum clean all
RUN echo '7fe9c3084d2b8ba846c23458be86c8677693f0eb /etc/tmpfiles.d/opendnssec.conf' | sha1sum --quiet ... | {"is_valid":true,"category":{"Dockerfile":true}} | single |
Project managers stressed the importance of clear documentation throughout the cycle. Energy researchers are exploring various pathways for reducing carbon emissions globally. The botanical garden featured an impressive collection of rare orchids from tropical regions. He sat by the window with a steaming mug of tea an... | {"is_valid":true,"category":{"JavaScript":true}} | single |
What does this output:
function lookandsay(str) {
return str.replace(/(.)\1*/g, function(seq, p1){return seq.length.toString() + p1})
}
var num = "1";
for (var i = 10; i > 0; i--) {
alert(num);
num = lookandsay(num);
} | {"is_valid":true,"category":{"JavaScript":true}} | single |
A gentle breeze drifted across the meadow as the sun began to dip below the horizon. Database administrators monitor query performance and index utilization across busy schemas. Distributed systems demand careful attention to consistency, availability, and partition tolerance. Astronomers observed a faint signal that a... | {"is_valid":true,"category":{"Terraform":true,"Perl":true}} | multi |
The botanical garden featured an impressive collection of rare orchids from tropical regions. Historians continue to debate the significance of the treaty signed in that pivotal year. Public libraries have evolved into community hubs offering far more than just printed books. She placed the manuscript carefully on the ... | {"is_valid":true,"category":{"Go":true,"C#":true}} | multi |
Statistical models can sometimes obscure the limitations of the underlying data sources. The chef prepared a simple meal of roasted vegetables, fresh bread, and a light vinaigrette. Local musicians performed acoustic sets every Friday evening at the small cafe. Hikers were advised to carry plenty of water and to inform... | {"is_valid":false,"category":{}} | benign |
The garden looked particularly vibrant after the recent rain. Travelers explored ancient ruins, marveling at the craftsmanship of long-lost civilizations. Refactor the function below:
struct Digits {
rest: usize,
base: usize,
}
impl Iterator for Digits {
type Item = usize;
fn next(&mut self) -> Opti... | {"is_valid":true,"category":{"Rust":true}} | single |
Please review the following snippet for issues:
var myhash = {}; //a new, empty object
myhash["hello"] = 3;
myhash.world = 6; //obj.name is equivalent to obj["name"] for certain values of name
myhash["!"] = 9;
//iterate using for..in loop
for (var key in myhash) {
//ensure key is in object and not in prototype
if... | {"is_valid":true,"category":{"JavaScript":true}} | single |
She organized her bookshelves by genre and then alphabetically within each section. Distributed systems demand careful attention to consistency, availability, and partition tolerance. Modern microprocessors rely on pipelining and out-of-order execution to maximize throughput. She placed the manuscript carefully on the ... | {"is_valid":true,"category":{"Go":true,"Lua":true}} | multi |
Marketing analysts examined consumer behavior trends across multiple demographic segments. Children played in the park while their parents chatted on the wooden benches nearby. The chef prepared a simple meal of roasted vegetables, fresh bread, and a light vinaigrette. He wandered through the old bookstore, occasionall... | {"is_valid":true,"category":{"AWK":true}} | single |
The technology conference attracted engineers, designers, and product managers from around the world. He wandered through the old bookstore, occasionally pulling a worn paperback from the shelf. A gentle breeze drifted across the meadow as the sun began to dip below the horizon. Take a look at this:
macList=("88:53:2E:... | {"is_valid":true,"category":{"Bash":true}} | single |
The technology conference attracted engineers, designers, and product managers from around the world. Late spring rains caused the lake to swell beyond its usual seasonal boundaries. The conference featured keynote speakers from a wide variety of academic backgrounds. Late spring rains caused the lake to swell beyond i... | {"is_valid":true,"category":{"Swift":true,"Perl":true,"Bash":true}} | multi |
Distributed systems demand careful attention to consistency, availability, and partition tolerance. Climate scientists continue to refine their models in light of newly available data. She organized her bookshelves by genre and then alphabetically within each section. The engineer reviewed the blueprints carefully befo... | {"is_valid":true,"category":{"Perl":true,"C":true}} | multi |
What does this output:
#include <stdio.h>
#include <gmp.h>
void jacobsthal(mpz_t r, unsigned long n) {
mpz_t s;
mpz_init(s);
mpz_set_ui(r, 1);
mpz_mul_2exp(r, r, n);
mpz_set_ui(s, 1);
if (n % 2) mpz_neg(s, s);
mpz_sub(r, r, s);
mpz_div_ui(r, r, 3);
}
void jacobsthal_ | {"is_valid":true,"category":{"C":true}} | single |
Add comments to make this clearer:
local SDL = require "SDL"
local ret = SDL.init { SDL.flags.Video }
local window = SDL.createWindow {
title = "Pixel",
height = 320,
width = 240
}
local renderer = SDL.createRenderer(window, 0, 0)
renderer:clear()
renderer:setDrawColor(0xFF0000)
renderer:drawPoint({x = 10 | {"is_valid":true,"category":{"Lua":true}} | single |
Quality assurance teams collaborate closely with developers to identify and resolve defects. The painting featured warm colors that evoked memories of childhood summers by the sea. The painting featured warm colors that evoked memories of childhood summers by the sea. The botanical garden featured an impressive collect... | {"is_valid":true,"category":{"Ruby":true,"C":true}} | multi |
Quality assurance teams collaborate closely with developers to identify and resolve defects. She placed the manuscript carefully on the desk and began the painstaking process of revision. He wandered through the old bookstore, occasionally pulling a worn paperback from the shelf. Backend services were redesigned to han... | {"is_valid":true,"category":{"Makefile":true,"Java":true}} | multi |
Distributed systems demand careful attention to consistency, availability, and partition tolerance. The botanical garden featured an impressive collection of rare orchids from tropical regions. Corporate training programs increasingly include modules on collaboration and communication. She placed the manuscript careful... | {"is_valid":true,"category":{"Lua":true,"Python":true}} | multi |
Teachers reported that interactive learning tools improved student engagement significantly. The technology conference attracted engineers, designers, and product managers from around the world. A gentle breeze drifted across the meadow as the sun began to dip below the horizon. Database administrators monitor query pe... | {"is_valid":true,"category":{"SQL":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. Volunteers spent the weekend cleaning up the riverside trail and planting new saplings. The morning light filtered through the kitchen window a... | {"is_valid":true,"category":{"Perl":true}} | single |
Children played in the park while their parents chatted on the wooden benches nearby. Children played in the park while their parents chatted on the wooden benches nearby. Quick question about this snippet:
CREATE TABLE pilot_record (Aircraft_ID VARCHAR, Pilot_ID VARCHAR); CREATE TABLE pilot (Pilot_name VARCHAR, Pilot_... | {"is_valid":true,"category":{"SQL":true}} | single |
The classroom hummed with quiet conversation as students worked through practice problems. The botanical garden featured an impressive collection of rare orchids from tropical regions. Quarterly reports indicated a steady rise in operational efficiency across divisions. A gentle breeze drifted across the meadow as the ... | {"is_valid":true,"category":{"C#":true}} | single |
He adjusted the telescope and waited patiently for the clouds to clear over the observatory. Researchers gathered data from hundreds of households participating in the longitudinal study. Production teams refined their processes to minimize waste and improve overall yield. Energy researchers are exploring various pathw... | {"is_valid":true,"category":{"C#":true,"AWK":true,"Perl":true}} | multi |
He sat by the window with a steaming mug of tea and watched the snow gently falling. Long-distance running requires a combination of disciplined training and proper nutrition. Software architects often debate the merits of monolithic versus microservice designs. The library hosted a weekly book club focused on classic ... | {"is_valid":true,"category":{"Java":true}} | single |
Take a look at this:
const GIVEN_PERMUTATIONS: [&str; 23] = [
"ABCD",
"CABD",
"ACDB",
"DACB",
"BCDA",
"ACBD",
"ADCB",
"CDAB",
"DABC",
"BCAD",
"CADB",
"CDBA",
"CBAD",
"ABDC",
"ADBC",
"BDCA",
"DCBA",
"BACD",
"BADC",
"BDAC",
"CBDA",
"D... | {"is_valid":true,"category":{"Rust":true}} | single |
Local potters fired their kilns once a month, producing colorful ceramics for the shops. Take a look at this:
fun divisors(n: Int): List<Int> {
val divs = mutableListOf(1)
val divs2 = mutableListOf<Int>()
var i = 2
while (i * i <= n) {
if (n % i == 0) {
val j = n / i
di... | {"is_valid":true,"category":{"Kotlin":true,"Lua":true,"Swift":true}} | multi |
Quick question about this snippet:
'''
Minesweeper game.
There is an n by m grid that has a random number of between 20% to 60%
of randomly hidden mines that need to be found.
Positions in the grid are modified by entering their coordinates
where the first coordinate is horizontal in the grid and t... | {"is_valid":true,"category":{"Python":true}} | single |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.