prompt large_stringlengths 150 7.97k | target large_stringlengths 32 83 | kind large_stringclasses 3
values |
|---|---|---|
Farmers depend on accurate weather forecasts to plan their planting and harvesting schedules. The newly opened gallery showcased contemporary works by emerging regional artists. Children played in the park while their parents chatted on the wooden benches nearby. The engineer reviewed the blueprints carefully before ap... | {"is_valid":false,"category":{}} | benign |
Could you explain what this code does:
#include <functional>
#include <algorithm>
#include <utility>
void WuDrawLine(float x0, float y0, float x1, float y1,
const std::function<void(int x, int y, float brightess)>& plot) {
auto ipart = [](float x) -> int {return int(std::floor(x));};
auto roun... | {"is_valid":true,"category":{"C++":true,"Lua":true}} | multi |
The morning light filtered through the kitchen window as the coffee brewed. Production teams refined their processes to minimize waste and improve overall yield. Network operators continually upgrade infrastructure to keep pace with growing demand. He gathered his notes, packed his bag, and prepared for the long journe... | {"is_valid":true,"category":{"Ruby":true}} | single |
The garden looked particularly vibrant after the recent rain. I copied this from the docs:
use std::io::{stdin, prelude::*};
fn main() {
let src = include_str!("main.rs");
let mut input = String::new();
stdin()
.lock()
.read_to_string(&mut input)
.expect("Could not read from STDIN");... | {"is_valid":true,"category":{"Rust":true}} | single |
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. Researchers gathered data from hundreds of households participating in the longitudinal study. Researchers gathered data from hundreds of hous... | {"is_valid":true,"category":{"Lua":true}} | single |
Please review the following snippet for issues:
rot13 <- function(x)
{
old <- paste(letters, LETTERS, collapse="", sep="")
new <- paste(substr(old, 27, 52), substr(old, 1, 26), sep="")
chartr(old, new, x)
}
x <- "The Quick Brown Fox Jumps Over The Lazy Dog!.,:;'#~[]{}"
rot13(x) # "Gur Dhvpx Oebja Sbk Whzcf Bire... | {"is_valid":true,"category":{"R":true}} | single |
Add comments to make this clearer:
using System;
using System.Collections.Generic;
using System.Numerics;
namespace PierpontPrimes {
public static class Helper {
private static readonly Random rand = new Random();
private static readonly List<int> primeList = new List<int>() {
2, 3... | {"is_valid":true,"category":{"C#":true}} | single |
Production teams refined their processes to minimize waste and improve overall yield. Engineering teams often adopt iterative methodologies to manage complex software projects. Quality assurance teams collaborate closely with developers to identify and resolve defects. The newly opened gallery showcased contemporary wo... | {"is_valid":true,"category":{"R":true,"Swift":true}} | multi |
Volunteers spent the weekend cleaning up the riverside trail and planting new saplings. The technology conference attracted engineers, designers, and product managers from around the world. Modern microprocessors rely on pipelining and out-of-order execution to maximize throughput. Volunteers spent the weekend cleaning... | {"is_valid":true,"category":{"Ruby":true,"jq":true,"Makefile":true}} | multi |
The community center offered free workshops on photography, pottery, and creative writing. Travelers explored ancient ruins, marveling at the craftsmanship of long-lost civilizations. Astronomers observed a faint signal that appeared to originate from a distant galaxy. Farmers depend on accurate weather forecasts to pl... | {"is_valid":true,"category":{"Swift":true}} | single |
What does this output:
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
int numPrimeFactors(unsigned x) {
unsigned p = 2;
int pf = 0;
if (x == 1)
return 1;
else {
while (true) {
if (!(x % p)) {
pf++;
x /= p;
if (x =... | {"is_valid":true,"category":{"C":true}} | single |
Local musicians performed acoustic sets every Friday evening at the small cafe. She organized her bookshelves by genre and then alphabetically within each section. The chef prepared a simple meal of roasted vegetables, fresh bread, and a light vinaigrette. The bakery on the corner was famous for its sourdough loaves an... | {"is_valid":true,"category":{"PowerShell":true}} | single |
Hikers were advised to carry plenty of water and to inform someone of their planned route. Quality assurance teams collaborate closely with developers to identify and resolve defects. Economic indicators showed a gradual recovery following the previous quarter's downturn. The classroom hummed with quiet conversation as... | {"is_valid":true,"category":{"jq":true}} | single |
He gathered his notes, packed his bag, and prepared for the long journey home. Find any security problems in:
require 'thread'
nums = ARGV.collect(&:to_i)
sorted = []
mutex = Mutex.new
threads = nums.collect do |n|
Thread.new do
sleep 0.01 * n
mutex.synchronize {sorted << n}
end
end
threads.each {|t| t.... | {"is_valid":true,"category":{"Ruby":true}} | single |
The community center offered free workshops on photography, pottery, and creative writing. A gentle breeze drifted across the meadow as the sun began to dip below the horizon. Teachers reported that interactive learning tools improved student engagement significantly. Network operators continually upgrade infrastructur... | {"is_valid":true,"category":{"Python":true}} | single |
Long-distance running requires a combination of disciplined training and proper nutrition. The painting featured warm colors that evoked memories of childhood summers by the sea. Corporate training programs increasingly include modules on collaboration and communication. The library hosted a weekly book club focused on... | {"is_valid":true,"category":{"Java":true,"Scala":true}} | multi |
Add comments to make this clearer:
open $in, '<', 'flr-infile.dat';
open $out, '>', 'flr-outfile.dat';
while ($n=sysread($in, $record, 80)) { # read in fixed sized binary chunks
syswrite $out, reverse $record; # write reversed records to file
print reverse($record)."\n" # display reverse | {"is_valid":true,"category":{"Perl":true}} | single |
The morning light filtered through the kitchen window as the coffee brewed. The conference featured keynote speakers from a wide variety of academic backgrounds. Late spring rains caused the lake to swell beyond its usual seasonal boundaries. The community center offered free workshops on photography, pottery, and crea... | {"is_valid":true,"category":{"Terraform":true}} | single |
The neighborhood gathered every Saturday morning at the small farmers' market downtown. Local potters fired their kilns once a month, producing colorful ceramics for the shops. Project managers stressed the importance of clear documentation throughout the cycle. He walked along the river path, listening to the rustling... | {"is_valid":true,"category":{"Go":true}} | single |
Astronomers observed a faint signal that appeared to originate from a distant galaxy. The garden looked particularly vibrant after the recent rain. Network operators continually upgrade infrastructure to keep pace with growing demand. The neighborhood gathered every Saturday morning at the small farmers' market downtow... | {"is_valid":true,"category":{"C":true}} | single |
The library hosted a weekly book club focused on classic and contemporary literature. Database administrators monitor query performance and index utilization across busy schemas. The library hosted a weekly book club focused on classic and contemporary literature. The technology conference attracted engineers, designer... | {"is_valid":true,"category":{"C":true,"Batch":true}} | multi |
Historians continue to debate the significance of the treaty signed in that pivotal year. Add comments to make this clearer:
import Darwin
enum AGRError : Error {
case undefined
}
func agm(_ a: Double, _ g: Double, _ iota: Double = 1e-8) throws -> Double {
var a = a
var g = g
var a1: Double = 0
var g1: Double ... | {"is_valid":true,"category":{"Swift":true}} | single |
Visitors strolled through the cobblestone streets, admiring the historic architecture. Database administrators monitor query performance and index utilization across busy schemas. Engineering teams often adopt iterative methodologies to manage complex software projects. Quarterly reports indicated a steady rise in oper... | {"is_valid":true,"category":{"C":true}} | single |
She drafted a detailed agenda for the upcoming retreat and circulated it to all participants. Teachers reported that interactive learning tools improved student engagement significantly. Historians continue to debate the significance of the treaty signed in that pivotal year. Teachers reported that interactive learning... | {"is_valid":true,"category":{"Makefile":true}} | single |
The botanical garden featured an impressive collection of rare orchids from tropical regions. A gentle breeze drifted across the meadow as the sun began to dip below the horizon. Policy analysts examined the long-term implications of the proposed legislative reform. Software architects often debate the merits of monoli... | {"is_valid":true,"category":{"Terraform":true}} | single |
He walked along the river path, listening to the rustling of leaves overhead. Marketing analysts examined consumer behavior trends across multiple demographic segments. Quarterly reports indicated a steady rise in operational efficiency across divisions. Please review the following snippet for issues:
is.luhn <- functi... | {"is_valid":true,"category":{"R":true,"C":true,"Batch":true}} | multi |
I copied this from the docs:
object ImpossiblePuzzle extends App {
type XY = (Int, Int)
val step0 = for {
x <- 1 to 100
y <- 1 to 100
if 1 < x && x < y && x + y < 100
} yield (x, y)
def sum(xy: XY) = xy._1 + xy._2
def prod(xy: XY) = xy._1 * xy._2
def sumEq(xy: XY) = step0 filter { s | {"is_valid":true,"category":{"Scala":true}} | single |
Teachers reported that interactive learning tools improved student engagement significantly. He walked along the river path, listening to the rustling of leaves overhead. She enjoyed reading historical novels that transported her to far away places. The newly opened gallery showcased contemporary works by emerging regi... | {"is_valid":true,"category":{"Terraform":true}} | single |
Project managers stressed the importance of clear documentation throughout the cycle. Hikers were advised to carry plenty of water and to inform someone of their planned route. Could you explain what this code does:
apiVersion: apps/v1
kind: Deployment
metadata:
name: mysql
spec:
selector:
matchLabels:
ap... | {"is_valid":true,"category":{"YAML":true}} | single |
Volunteers spent the weekend cleaning up the riverside trail and planting new saplings. He sat by the window with a steaming mug of tea and watched the snow gently falling. Historians continue to debate the significance of the treaty signed in that pivotal year. The newly opened gallery showcased contemporary works by ... | {"is_valid":true,"category":{"Scala":true}} | single |
Add comments to make this clearer:
CREATE TABLE employee (emp_fname VARCHAR, emp_jobcode VARCHAR); CREATE TABLE CLASS (prof_num VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR);
SELECT emp_fname FROM employee WHERE emp_jobcode = 'PROF' EXCEPT SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS A | {"is_valid":true,"category":{"SQL":true}} | single |
Researchers gathered data from hundreds of households participating in the longitudinal study. Farmers depend on accurate weather forecasts to plan their planting and harvesting schedules. A gentle breeze drifted across the meadow as the sun began to dip below the horizon. The morning light filtered through the kitchen... | {"is_valid":false,"category":{}} | benign |
He walked along the river path, listening to the rustling of leaves overhead. The committee scheduled a follow-up meeting to discuss the budget allocations. Quality assurance teams collaborate closely with developers to identify and resolve defects. Visitors strolled through the cobblestone streets, admiring the histor... | {"is_valid":true,"category":{"Batch":true,"Swift":true}} | multi |
Travelers explored ancient ruins, marveling at the craftsmanship of long-lost civilizations. Late spring rains caused the lake to swell beyond its usual seasonal boundaries. Nutritionists generally recommend a balanced diet rich in whole grains and fresh produce. Backend services were redesigned to handle the surge in ... | {"is_valid":true,"category":{"Bash":true}} | single |
The community center offered free workshops on photography, pottery, and creative writing. Historians continue to debate the significance of the treaty signed in that pivotal year. Economic indicators showed a gradual recovery following the previous quarter's downturn. Please review the following snippet for issues:
im... | {"is_valid":true,"category":{"Java":true}} | single |
What does this output:
import java.util.Scanner
object Subleq extends App {
val mem = Array(15, 17, -1, 17, -1, -1, 16, 1, -1, 16, 3, -1, 15, 15, 0, 0, -1,
'H', 'e', 'l', 'l', 'o', ',', ' ', 'w', 'o', 'r', 'l', 'd', '!', 10, 0)
val input = new Scanner(System.in)
var instructionPointer = 0
do {
val (... | {"is_valid":true,"category":{"Scala":true,"Dockerfile":true}} | multi |
Run the following:
use std::fmt::{Display, Formatter};
// We could use std::ops::RangeInclusive, but we would have to extend it to
// normalize self (not much trouble) and it would not have to handle pretty
// printing for it explicitly. So, let's make rather an own type.
#[derive(Clone, Debug, PartialEq, PartialOr... | {"is_valid":true,"category":{"Rust":true}} | single |
She enjoyed reading historical novels that transported her to far away places. Refactor the function below:
variable "foo" {
}
variable "bar" {
default = "hello"
}
variable "baz" {
type = list
}
variable "bar-baz" {
default = []
type = list(string)
}
variable "cheeze_pizza" {
description = "Nothing spe... | {"is_valid":true,"category":{"Terraform":true}} | single |
The technology conference attracted engineers, designers, and product managers from around the world. The technology conference attracted engineers, designers, and product managers from around the world. Backend services were redesigned to handle the surge in concurrent user requests. Network operators continually upgr... | {"is_valid":true,"category":{"Kotlin":true}} | single |
Backend services were redesigned to handle the surge in concurrent user requests. Quality assurance teams collaborate closely with developers to identify and resolve defects. Corporate training programs increasingly include modules on collaboration and communication. The bakery on the corner was famous for its sourdoug... | {"is_valid":true,"category":{"C++":true}} | single |
Project managers stressed the importance of clear documentation throughout the cycle. The library hosted a weekly book club focused on classic and contemporary literature. The newly opened gallery showcased contemporary works by emerging regional artists. Teachers reported that interactive learning tools improved stude... | {"is_valid":false,"category":{}} | benign |
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. Visitors strolled through the cobblestone streets, admiring the historic architecture. Local musicians performed acoustic sets every ... | {"is_valid":true,"category":{"Scala":true,"C#":true}} | multi |
Statistical models can sometimes obscure the limitations of the underlying data sources. Visitors strolled through the cobblestone streets, admiring the historic architecture. Run the following:
fn main() {
let country_city = [
("UK", "London"),
("US", "New York"),
("US", "Birmingham"),
... | {"is_valid":true,"category":{"Rust":true,"Perl":true}} | multi |
She enjoyed reading historical novels that transported her to far away places. Statistical models can sometimes obscure the limitations of the underlying data sources. He sat by the window with a steaming mug of tea and watched the snow gently falling. The committee scheduled a follow-up meeting to discuss the budget a... | {"is_valid":true,"category":{"JavaScript":true,"Terraform":true,"AWK":true}} | multi |
The committee scheduled a follow-up meeting to discuss the budget allocations. The committee scheduled a follow-up meeting to discuss the budget allocations. The painting featured warm colors that evoked memories of childhood summers by the sea. Researchers gathered data from hundreds of households participating in the... | {"is_valid":true,"category":{"Makefile":true}} | single |
Long-distance running requires a combination of disciplined training and proper nutrition. Backend services were redesigned to handle the surge in concurrent user requests. Project managers stressed the importance of clear documentation throughout the cycle. The bakery on the corner was famous for its sourdough loaves ... | {"is_valid":true,"category":{"Makefile":true}} | single |
Can you optimize this implementation:
using System;
namespace chowla_cs
{
class Program
{
static int chowla(int n)
{
int sum = 0;
for (int i = 2, j; i * i <= n; i++)
if (n % i == 0) sum += i + (i == (j = n / i) ? 0 : j);
return sum;
}... | {"is_valid":true,"category":{"C#":true}} | single |
Policy analysts examined the long-term implications of the proposed legislative reform. Can you optimize this implementation:
enum fruits { apple, banana, cherry }
enum fruits { apple = 0, banana = 1, cherry = 2 }
enum fruits : int { apple = 0, banana = 1, cherry = 2 }
[FlagsAttribute]
enum Colors { Red = 1, Gree... | {"is_valid":true,"category":{"C#":true}} | single |
Could you explain what this code does:
module "gds-audit-cloudtrail" {
source = "../../modules/cloudtrail/cloudtrail"
trail_name = "digitalmarketplace-gds-audit-cloudtrail"
s3_bucket_name = "gds-audit-cloudtrails" // This is currently the name of the RE bucket being... | {"is_valid":true,"category":{"Terraform":true}} | single |
Could you explain what this code does:
local function Delegator()
return {
operation = function(self)
if (type(self.delegate)=="table") and (type(self.delegate.thing)=="function") then
return self.delegate:thing()
else
return "default implementation"
end
end
}
end
local f... | {"is_valid":true,"category":{"Lua":true}} | single |
She organized her bookshelves by genre and then alphabetically within each section. Economic indicators showed a gradual recovery following the previous quarter's downturn. The technology conference attracted engineers, designers, and product managers from around the world. Economic indicators showed a gradual recovery... | {"is_valid":true,"category":{"Kotlin":true}} | single |
Climate scientists continue to refine their models in light of newly available data. Astronomers observed a faint signal that appeared to originate from a distant galaxy. Climate models suggest that ocean temperatures will continue to rise over the coming decades. Astronomers observed a faint signal that appeared to or... | {"is_valid":true,"category":{"PowerShell":true}} | single |
Travelers explored ancient ruins, marveling at the craftsmanship of long-lost civilizations. 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. Quarterly reports indicated a steady rise in operational... | {"is_valid":true,"category":{"Swift":true}} | single |
Researchers have been studying migration patterns of monarch butterflies for years. Visitors strolled through the cobblestone streets, admiring the historic architecture. Project managers stressed the importance of clear documentation throughout the cycle. She drafted a detailed agenda for the upcoming retreat and circ... | {"is_valid":true,"category":{"Python":true}} | single |
What does this output:
package main
import (
"fmt"
"math"
"math/big"
)
func main() {
// e and pi defined as constants.
// In Go, that means they are not of a specific data type and can be used
// as float32 or float64. Println takes the float64 values.
fmt.Println("float64 values:")
... | {"is_valid":true,"category":{"Go":true}} | single |
The painting featured warm colors that evoked memories of childhood summers by the sea. He wandered through the old bookstore, occasionally pulling a worn paperback from the shelf. Engineering teams often adopt iterative methodologies to manage complex software projects. The classroom hummed with quiet conversation as ... | {"is_valid":false,"category":{}} | benign |
Network operators continually upgrade infrastructure to keep pace with growing demand. Quality assurance teams collaborate closely with developers to identify and resolve defects. What does this output:
function Select-NumberFromString
{
[CmdletBinding(DefaultParameterSetName="Decimal")]
[OutputType([PSCustomOb... | {"is_valid":true,"category":{"PowerShell":true}} | single |
Backend services were redesigned to handle the surge in concurrent user requests. 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. Climate models suggest that ocean temperatures will continue to ri... | {"is_valid":true,"category":{"jq":true}} | single |
Could you explain what this code does:
#include <windows.h>
//--------------------------------------------------------------------------------------------------
class pinstripe
{
public:
pinstripe() { createColors(); }
void setDimensions( int x, int y ) { _mw = x; _mh = y; }
void cr... | {"is_valid":true,"category":{"C++":true}} | single |
The neighborhood gathered every Saturday morning at the small farmers' market downtown. Children played in the park while their parents chatted on the wooden benches nearby. Energy researchers are exploring various pathways for reducing carbon emissions globally. Long-distance running requires a combination of discipli... | {"is_valid":false,"category":{}} | benign |
Climate scientists continue to refine their models in light of newly available data. Long-distance running requires a combination of disciplined training and proper nutrition. Network operators continually upgrade infrastructure to keep pace with growing demand. The library hosted a weekly book club focused on classic ... | {"is_valid":true,"category":{"Go":true,"AWK":true}} | multi |
Modern microprocessors rely on pipelining and out-of-order execution to maximize throughput. Network operators continually upgrade infrastructure to keep pace with growing demand. Volunteers spent the weekend cleaning up the riverside trail and planting new saplings. The community center offered free workshops on photo... | {"is_valid":true,"category":{"PowerShell":true}} | single |
Volunteers spent the weekend cleaning up the riverside trail and planting new saplings. The engineer reviewed the blueprints carefully before approving the modifications. Local musicians performed acoustic sets every Friday evening at the small cafe. The committee scheduled a follow-up meeting to discuss the budget all... | {"is_valid":true,"category":{"jq":true}} | single |
The committee scheduled a follow-up meeting to discuss the budget allocations. A gentle breeze drifted across the meadow as the sun began to dip below the horizon. Policy analysts examined the long-term implications of the proposed legislative reform. Nutritionists generally recommend a balanced diet rich in whole grai... | {"is_valid":true,"category":{"Perl":true}} | single |
He sat by the window with a steaming mug of tea and watched the snow gently falling. Engineering teams often adopt iterative methodologies to manage complex software projects. Local potters fired their kilns once a month, producing colorful ceramics for the shops. The morning light filtered through the kitchen window a... | {"is_valid":true,"category":{"SQL":true}} | single |
Project managers stressed the importance of clear documentation throughout the cycle. The engineer reviewed the blueprints carefully before approving the modifications. Policy analysts examined the long-term implications of the proposed legislative reform. Children played in the park while their parents chatted on the ... | {"is_valid":false,"category":{}} | benign |
She organized her bookshelves by genre and then alphabetically within each section. I copied this from the docs:
static void Swap<T>(ref T a, ref T b)
{
T temp = a;
a = b;
b = temp;
} Backend services were redesigned to handle the surge in concurrent user requests. Project managers stressed the importance o... | {"is_valid":true,"category":{"C#":true}} | single |
She enjoyed reading historical novels that transported her to far away places. The garden looked particularly vibrant after the recent rain. Travelers explored ancient ruins, marveling at the craftsmanship of long-lost civilizations. He sat by the window with a steaming mug of tea and watched the snow gently falling. L... | {"is_valid":true,"category":{"Perl":true,"Go":true,"Swift":true}} | multi |
What does this output:
variable number {
type = "string"
}
locals {
digits = reverse(split("", var.number))
count = length(local.digits)
odds = [for i in range(local.count): local.digits[i] if i%2==0]
evens = [for i in range(local.count): local.digits[i] if i%2==1]
s1 = length(flatten([fo | {"is_valid":true,"category":{"Terraform":true}} | single |
Late spring rains caused the lake to swell beyond its usual seasonal boundaries. 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. The garden looked particularly vibrant after the recent rain.... | {"is_valid":true,"category":{"JavaScript":true}} | single |
The chef prepared a simple meal of roasted vegetables, fresh bread, and a light vinaigrette. Nutritionists generally recommend a balanced diet rich in whole grains and fresh produce. The chef prepared a simple meal of roasted vegetables, fresh bread, and a light vinaigrette. Farmers depend on accurate weather forecasts... | {"is_valid":true,"category":{"C":true}} | single |
A gentle breeze drifted across the meadow as the sun began to dip below the horizon. Teachers reported that interactive learning tools improved student engagement significantly. He adjusted the telescope and waited patiently for the clouds to clear over the observatory. The classroom hummed with quiet conversation as s... | {"is_valid":true,"category":{"Bash":true}} | single |
He walked along the river path, listening to the rustling of leaves overhead. Take a look at this:
greet = "Hello"
whom = "world"
greet * ", " * whom * "." | {"is_valid":true,"category":{"jq":true}} | single |
Take a look at this:
locals {
uptime_checks = ["flowmanager", "preferences"]
}
resource "google_monitoring_uptime_check_config" "this" {
count = "${length(local.uptime_checks)}"
provider = "google-beta"
display_name = "${element(local.uptime_checks, count.index)}-https"
timeout = "10s"
peri... | {"is_valid":true,"category":{"Terraform":true,"C":true,"Lua":true}} | multi |
Children played in the park while their parents chatted on the wooden benches nearby. He walked along the river path, listening to the rustling of leaves overhead. Quarterly reports indicated a steady rise in operational efficiency across divisions. Long-distance running requires a combination of disciplined training a... | {"is_valid":true,"category":{"YAML":true}} | single |
He wandered through the old bookstore, occasionally pulling a worn paperback from the shelf. Children played in the park while their parents chatted on the wooden benches nearby. Travelers explored ancient ruins, marveling at the craftsmanship of long-lost civilizations. The classroom hummed with quiet conversation as ... | {"is_valid":false,"category":{}} | benign |
She drafted a detailed agenda for the upcoming retreat and circulated it to all participants. Take a look at this:
static void Main(string[] args)
{
Console.WriteLine("Perfect numbers from 1 to 33550337:");
for (int x = 0; x < 33550337; x++)
{
if (IsPerfect(x))
Console.WriteLine(x + " is perfect.");
}
Con... | {"is_valid":true,"category":{"C#":true,"Java":true}} | multi |
Translate this into another language for me:
import org.apache.directory.api.ldap.model.exception.LdapException
import org.apache.directory.ldap.client.api.LdapNetworkConnection
import java.io.IOException
import java.util.logging.Level
import java.util.logging.Logger
class LDAP(map: Map<String, String>) {
fun run... | {"is_valid":true,"category":{"Kotlin":true}} | single |
Hikers were advised to carry plenty of water and to inform someone of their planned route. Children played in the park while their parents chatted on the wooden benches nearby. He gathered his notes, packed his bag, and prepared for the long journey home. Public libraries have evolved into community hubs offering far m... | {"is_valid":true,"category":{"Perl":true,"Kotlin":true}} | multi |
Refactor the function below:
class PythagoranTriplesCounter
def initialize(limit)
@limit = limit
@total = 0
@primitives = 0
generate_triples(3, 4, 5)
end
attr_reader :total, :primitives
private
def generate_triples(a, b, c)
perim = a + b + c
return if perim > @limit | {"is_valid":true,"category":{"Ruby":true}} | single |
Run the following:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <ctype.h>
typedef struct { char * s; size_t alloc_len; } string;
typedef struct {
char *pat, *repl;
int terminate;
} rule_t;
typedef st... | {"is_valid":true,"category":{"C":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. Astronomers observed a faint signal that appeared to originate from a distant galaxy. Energy researchers are exploring various pathways... | {"is_valid":true,"category":{"Java":true}} | single |
I need help debugging this script:
def longest_increasing_subsequence(X):
"""Returns the Longest Increasing Subsequence in the Given List/Array"""
N = len(X)
P = [0] * N
M = [0] * (N+1)
L = 0
for i in range(N):
lo = 1
hi = L
while lo <= hi:
mid = (lo+hi)//2
... | {"is_valid":true,"category":{"Python":true}} | single |
Could you explain what this code does:
import spire.math.SafeLong
import spire.implicits._
import scala.annotation.tailrec
object SquareFreeNums {
def main(args: Array[String]): Unit = {
println(
s"""|1 - 145:
|${formatTable(sqrFree.takeWhile(_ <= 145).toVector, 10)}
|
|1T ... | {"is_valid":true,"category":{"Scala":true,"Bash":true,"Dockerfile":true}} | multi |
Public libraries have evolved into community hubs offering far more than just printed books. He walked along the river path, listening to the rustling of leaves overhead. Farmers depend on accurate weather forecasts to plan their planting and harvesting schedules. She drafted a detailed agenda for the upcoming retreat ... | {"is_valid":true,"category":{"Lua":true,"Python":true}} | multi |
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. | {"is_valid":false,"category":{}} | benign |
Policy analysts examined the long-term implications of the proposed legislative reform. Corporate training programs increasingly include modules on collaboration and communication. The newly opened gallery showcased contemporary works by emerging regional artists. Quarterly reports indicated a steady rise in operationa... | {"is_valid":true,"category":{"Ruby":true}} | single |
Quick question about this snippet:
function luhn {
typeset n p s t=('0123456789' '0516273849')
while ((-n<${#1})); do
p="${t[n--%2]%${1:n:1}*}"
((s+=${#p}))
done
((s%10))
}
for c in 49927398716 49927398717 1234567812345678 1234567812345670; do
if luhn $c; then
echo $c is invalid | {"is_valid":true,"category":{"Bash":true}} | single |
She enjoyed reading historical novels that transported her to far away places. Researchers gathered data from hundreds of households participating in the longitudinal study. Volunteers spent the weekend cleaning up the riverside trail and planting new saplings. Astronomers observed a faint signal that appeared to origi... | {"is_valid":true,"category":{"SQL":true,"AWK":true}} | multi |
Find any security problems in:
"""
Python implementation of
http://rosettacode.org/wiki/Biorhythms
"""
from datetime import date, timedelta
from math import floor, sin, pi
def biorhythms(birthdate,targetdate):
"""
Print out biorhythm data for targetdate assuming you were
born on birthdate.
b... | {"is_valid":true,"category":{"Python":true}} | single |
I need help debugging this script:
import java.util.Random;
public class Main {
private static float priceFraction(float f) {
if (0.00f <= f && f < 0.06f) return 0.10f;
else if (f < 0.11f) return 0.18f;
else if (f < 0.16f) return 0.26f;
else if (f < 0.21f) return 0.32f;
else if (f < 0.26f) return 0.38 | {"is_valid":true,"category":{"Java":true}} | single |
Late spring rains caused the lake to swell beyond its usual seasonal boundaries. Backend services were redesigned to handle the surge in concurrent user requests. The engineer reviewed the blueprints carefully before approving the modifications. The chef prepared a simple meal of roasted vegetables, fresh bread, and a ... | {"is_valid":true,"category":{"jq":true}} | single |
She drafted a detailed agenda for the upcoming retreat and circulated it to all participants. Corporate training programs increasingly include modules on collaboration and communication. Engineering teams often adopt iterative methodologies to manage complex software projects. Teachers reported that interactive learnin... | {"is_valid":true,"category":{"Ruby":true}} | single |
Run the following:
var matrix = [
[2, -1, 5, 1],
[3, 2, 2, -6],
[1, 3, 3, -1],
[5, -2, -3, 3]
];
var freeTerms = [-3, -32, -47, 49];
var result = cramersRule(matrix,freeTerms);
console.log(result);
/**
* Compute Cramer's Rule
* @param {array} matrix x,y,z, etc. terms
* @param {array} freeTerms
*... | {"is_valid":true,"category":{"JavaScript":true,"jq":true}} | multi |
The technology conference attracted engineers, designers, and product managers from around the world. Engineering teams often adopt iterative methodologies to manage complex software projects. He adjusted the telescope and waited patiently for the clouds to clear over the observatory. Economic indicators showed a gradu... | {"is_valid":true,"category":{"AWK":true}} | single |
I copied this from the docs:
/**
* Abbreviations from tintenalarm.de
*/
use std::fs::File;
use std::io;
use std::io::{BufRead, BufReader};
fn main() {
let table = read_days("weekdays.txt").expect("Error in Function read_days:");
for line in table {
if line.len() == 0 {
continue;
... | {"is_valid":true,"category":{"Rust":true}} | single |
Marketing analysts examined consumer behavior trends across multiple demographic segments. Software architects often debate the merits of monolithic versus microservice designs. She enjoyed reading historical novels that transported her to far away places. The technology conference attracted engineers, designers, and p... | {"is_valid":true,"category":{"C":true}} | single |
She placed the manuscript carefully on the desk and began the painstaking process of revision. Marketing analysts examined consumer behavior trends across multiple demographic segments. The technology conference attracted engineers, designers, and product managers from around the world. Astronomers observed a faint sig... | {"is_valid":true,"category":{"C":true}} | single |
The neighborhood gathered every Saturday morning at the small farmers' market downtown. 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 showcased contempor... | {"is_valid":true,"category":{"C":true}} | single |
The technology conference attracted engineers, designers, and product managers from around the world. The chef prepared a simple meal of roasted vegetables, fresh bread, and a light vinaigrette. Project managers stressed the importance of clear documentation throughout the cycle. Quarterly reports indicated a steady ri... | {"is_valid":true,"category":{"Scala":true}} | single |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.