prompt large_stringlengths 150 7.97k | target large_stringlengths 32 83 | kind large_stringclasses 3
values |
|---|---|---|
A gentle breeze drifted across the meadow as the sun began to dip below the horizon. Network operators continually upgrade infrastructure to keep pace with growing demand. Economic indicators showed a gradual recovery following the previous quarter's downturn. He walked along the river path, listening to the rustling o... | {"is_valid":true,"category":{"Rust":true}} | single |
She placed the manuscript carefully on the desk and began the painstaking process of revision. Find any security problems in:
import spire.math.SafeLong
import spire.implicits._
import scala.collection.parallel.immutable.ParVector
object Primorial {
def main(args: Array[String]): Unit = {
println(
s"""|... | {"is_valid":true,"category":{"Scala":true,"JavaScript":true}} | multi |
The community center offered free workshops on photography, pottery, and creative writing. Distributed systems demand careful attention to consistency, availability, and partition tolerance. I copied this from the docs:
#include <unordered_map>
#include <string>
int main()
{
std::string keys[] = { "1", "2", "3" };
... | {"is_valid":true,"category":{"C++":true}} | single |
Farmers depend on accurate weather forecasts to plan their planting and harvesting schedules. Travelers explored ancient ruins, marveling at the craftsmanship of long-lost civilizations. Refactor the function below:
variable "job_instances" {
description = "List of pairs <job_name>:<job_count> of expected bosh job in... | {"is_valid":true,"category":{"Terraform":true,"C":true}} | multi |
I need help debugging this script:
#include <math.h>
#include <numbers>
#include <stdio.h>
#include <vector>
// Calculate the coefficients used by Spouge's approximation (based on the C
// implemetation)
std::vector<double> CalculateCoefficients(int numCoeff)
{
std::vector<double> c(numCoeff);
double k1_factr... | {"is_valid":true,"category":{"C++":true}} | single |
Policy analysts examined the long-term implications of the proposed legislative reform. Researchers have been studying migration patterns of monarch butterflies for years. The morning light filtered through the kitchen window as the coffee brewed. Volunteers spent the weekend cleaning up the riverside trail and plantin... | {"is_valid":true,"category":{"PowerShell":true}} | single |
Quick question about this snippet:
class RedBlackTree[A](implicit ord: Ordering[A]) {
sealed abstract class Color
case object R extends Color
case object B extends Color
sealed abstract class Tree {
def insert(x: A): Tree = ins(x) match {
case T(_, a, y, b) => T(B, a, y, b)
case E | {"is_valid":true,"category":{"Scala":true}} | single |
Backend services were redesigned to handle the surge in concurrent user requests. Astronomers observed a faint signal that appeared to originate from a distant galaxy. Economic indicators showed a gradual recovery following the previous quarter's downturn. The garden looked particularly vibrant after the recent rain. L... | {"is_valid":true,"category":{"Rust":true,"Java":true}} | multi |
Astronomers observed a faint signal that appeared to originate from a distant galaxy. Astronomers observed a faint signal that appeared to originate from a distant galaxy. Policy analysts examined the long-term implications of the proposed legislative reform. Refactor the function below:
99
| (. - range(0;.+1) )
| "
\(... | {"is_valid":true,"category":{"jq":true}} | single |
Here is the code I was given:
CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCHAR); CREATE TABLE student (stu_fname VARCHAR, stu_num VARCHAR); CREATE TABLE enroll (class_code VARCHAR, stu_num VARCHAR, enroll_grade VARCHAR);
SELECT T3.stu_fname FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOI... | {"is_valid":true,"category":{"SQL":true}} | single |
She organized her bookshelves by genre and then alphabetically within each section. Run the following:
#!/usr/bin/perl -w
use strict ;
sub mapValue {
my ( $range1 , $range2 , $number ) = @_ ;
return ( $range2->[ 0 ] +
(( $number - $range1->[ 0 ] ) * ( $range2->[ 1 ] - $range2->[ 0 ] ) ) / ( $range1->[ -1 ... | {"is_valid":true,"category":{"Perl":true,"C++":true}} | multi |
Local musicians performed acoustic sets every Friday evening at the small cafe. The committee scheduled a follow-up meeting to discuss the budget allocations. Climate scientists continue to refine their models in light of newly available data. Local potters fired their kilns once a month, producing colorful ceramics fo... | {"is_valid":false,"category":{}} | benign |
Public libraries have evolved into community hubs offering far more than just printed books. Project managers stressed the importance of clear documentation throughout the cycle. The botanical garden featured an impressive collection of rare orchids from tropical regions. Long-distance running requires a combination of... | {"is_valid":true,"category":{"C++":true}} | single |
The community center offered free workshops on photography, pottery, and creative writing. The chef prepared a simple meal of roasted vegetables, fresh bread, and a light vinaigrette. Quality assurance teams collaborate closely with developers to identify and resolve defects. Engineering teams often adopt iterative met... | {"is_valid":true,"category":{"Swift":true}} | single |
Database administrators monitor query performance and index utilization across busy schemas. Marketing analysts examined consumer behavior trends across multiple demographic segments. The neighborhood gathered every Saturday morning at the small farmers' market downtown. Long-distance running requires a combination of ... | {"is_valid":true,"category":{"JavaScript":true}} | single |
Quick question about this snippet:
public class Currier<ARG1, ARG2, RET> {
public interface CurriableFunctor<ARG1, ARG2, RET> {
RET evaluate(ARG1 arg1, ARG2 arg2);
}
public interface CurriedFunctor<ARG2, RET> {
RET evaluate(ARG2 arg);
}
final Curr | {"is_valid":true,"category":{"Java":true}} | single |
The library hosted a weekly book club focused on classic and contemporary literature. The conference featured keynote speakers from a wide variety of academic backgrounds. The neighborhood gathered every Saturday morning at the small farmers' market downtown. Historians continue to debate the significance of the treaty... | {"is_valid":true,"category":{"Swift":true}} | single |
The conference featured keynote speakers from a wide variety of academic backgrounds. A gentle breeze drifted across the meadow as the sun began to dip below the horizon. Astronomers observed a faint signal that appeared to originate from a distant galaxy. She drafted a detailed agenda for the upcoming retreat and circ... | {"is_valid":true,"category":{"Python":true}} | single |
He gathered his notes, packed his bag, and prepared for the long journey home. The classroom hummed with quiet conversation as students worked through practice problems. The committee scheduled a follow-up meeting to discuss the budget allocations. The neighborhood gathered every Saturday morning at the small farmers' ... | {"is_valid":true,"category":{"Makefile":true}} | single |
What does this output:
#include <iostream>
#include <sstream>
#include <iomanip>
using namespace std;
class magicSqr
{
public:
magicSqr( int d ) {
while( d % 4 > 0 ) { d++; }
sz = d;
sqr = new int[sz * sz];
fillSqr();
}
~magicSqr() { delete [] sqr; }
void display() c... | {"is_valid":true,"category":{"C++":true}} | single |
Quick question about this snippet:
@echo off
:_main
call:_variadicfunc arg1 "arg 2" arg-3
pause>nul
:_variadicfunc
setlocal
for %%i in (%*) do echo %%~i
exit /b
:: Note: if _variadicfunc was called from cmd.exe with arguments parsed to it, it would only need to contain:
:: @for %%i in (%*) do echo %%i | {"is_valid":true,"category":{"Batch":true}} | single |
Travelers explored ancient ruins, marveling at the craftsmanship of long-lost civilizations. Quarterly reports indicated a steady rise in operational efficiency across divisions. Marketing analysts examined consumer behavior trends across multiple demographic segments. The committee scheduled a follow-up meeting to dis... | {"is_valid":true,"category":{"C++":true,"Dockerfile":true,"Ruby":true}} | multi |
She placed the manuscript carefully on the desk and began the painstaking process of revision. Policy analysts examined the long-term implications of the proposed legislative reform. Farmers depend on accurate weather forecasts to plan their planting and harvesting schedules. The engineer reviewed the blueprints carefu... | {"is_valid":true,"category":{"Ruby":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. Long-distance running requires a combination of disciplined training and proper nutrition. She drafted a detailed agenda for the upcoming retreat and... | {"is_valid":false,"category":{}} | benign |
Corporate training programs increasingly include modules on collaboration and communication. She organized her bookshelves by genre and then alphabetically within each section. Project managers stressed the importance of clear documentation throughout the cycle. Public libraries have evolved into community hubs offerin... | {"is_valid":true,"category":{"Batch":true}} | single |
Corporate training programs increasingly include modules on collaboration and communication. Historians continue to debate the significance of the treaty signed in that pivotal year. Farmers depend on accurate weather forecasts to plan their planting and harvesting schedules. The bakery on the corner was famous for its... | {"is_valid":true,"category":{"Batch":true}} | single |
Project managers stressed the importance of clear documentation throughout the cycle. Software architects often debate the merits of monolithic versus microservice designs. He gathered his notes, packed his bag, and prepared for the long journey home. Software architects often debate the merits of monolithic versus mic... | {"is_valid":true,"category":{"SQL":true}} | single |
What does this output:
using System;
using System.Collections.Generic;
using System.Linq;
namespace LatinSquares {
using matrix = List<List<int>>;
class Program {
static void Swap<T>(ref T a, ref T b) {
var t = a;
a = b;
b = t;
}
static matrix DL... | {"is_valid":true,"category":{"C#":true}} | single |
The neighborhood gathered every Saturday morning at the small farmers' market downtown. Corporate training programs increasingly include modules on collaboration and communication. The committee scheduled a follow-up meeting to discuss the budget allocations. Children played in the park while their parents chatted on t... | {"is_valid":true,"category":{"Kotlin":true}} | single |
Backend services were redesigned to handle the surge in concurrent user requests. 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. Statistical models can sometimes obscure the limitations of the underlyi... | {"is_valid":true,"category":{"PowerShell":true}} | single |
Policy analysts examined the long-term implications of the proposed legislative reform. The morning light filtered through the kitchen window as the coffee brewed. Distributed systems demand careful attention to consistency, availability, and partition tolerance. She placed the manuscript carefully on the desk and bega... | {"is_valid":true,"category":{"SQL":true}} | single |
Researchers have been studying migration patterns of monarch butterflies for years. Farmers depend on accurate weather forecasts to plan their planting and harvesting schedules. Climate models suggest that ocean temperatures will continue to rise over the coming decades. The library hosted a weekly book club focused on... | {"is_valid":true,"category":{"Dockerfile":true,"Kotlin":true}} | multi |
Here is the code I was given:
[int]$count = 0
[int]$maxCount = 0
[datetime[]]$times = @()
$jobs = Get-Content -Path ".\mlijobs.txt" | ForEach-Object {
[string[]]$fields = $_.Split(" ",[StringSplitOptions]::RemoveEmptyEntries)
[datetime]$datetime = Get-Date $fields[3].Replace("_"," ")
[PSCustom | {"is_valid":true,"category":{"PowerShell":true}} | single |
I copied this from the docs:
typealias NodePtr<T> = UnsafeMutablePointer<Node<T>>
class Node<T> {
var value: T
fileprivate var prev: NodePtr<T>?
fileprivate var next: NodePtr<T>?
init(value: T, prev: NodePtr<T>? = nil, next: NodePtr<T>? = nil) {
self.value = value
self.prev = prev
self.next = ne... | {"is_valid":true,"category":{"Swift":true}} | single |
Database administrators monitor query performance and index utilization across busy schemas. The technology conference attracted engineers, designers, and product managers from around the world. Historians continue to debate the significance of the treaty signed in that pivotal year. Can you optimize this implementatio... | {"is_valid":true,"category":{"Perl":true}} | single |
Corporate training programs increasingly include modules on collaboration and communication. Historians continue to debate the significance of the treaty signed in that pivotal year. The committee scheduled a follow-up meeting to discuss the budget allocations. Astronomers observed a faint signal that appeared to origi... | {"is_valid":true,"category":{"Scala":true}} | single |
Engineering teams often adopt iterative methodologies to manage complex software projects. The morning light filtered through the kitchen window as the coffee brewed. Project managers stressed the importance of clear documentation throughout the cycle. She organized her bookshelves by genre and then alphabetically with... | {"is_valid":true,"category":{"PowerShell":true}} | single |
Refactor the function below:
library(XML)
library(RCurl)
doc <- xmlInternalTreeParse("http://www.rosettacode.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:Programming_Tasks&cmlimit=500&format=xml")
nodes <- getNodeSet(doc,"//cm")
titles = as.character( sapply(nodes, xmlGetAttr, "title") )
headers <- ... | {"is_valid":true,"category":{"R":true}} | single |
The engineer reviewed the blueprints carefully before approving the modifications. Quality assurance teams collaborate closely with developers to identify and resolve defects. She drafted a detailed agenda for the upcoming retreat and circulated it to all participants. Quarterly reports indicated a steady rise in opera... | {"is_valid":true,"category":{"C#":true}} | single |
The bakery on the corner was famous for its sourdough loaves and seasonal pastries. A gentle breeze drifted across the meadow as the sun began to dip below the horizon. Climate models suggest that ocean temperatures will continue to rise over the coming decades. Engineering teams often adopt iterative methodologies to ... | {"is_valid":true,"category":{"Java":true}} | single |
Could you explain what this code does:
package main
import (
"fmt"
)
func main() {
days := []string{"first", "second", "third", "fourth", "fifth", "sixth",
"seventh", "eighth", "ninth", "tenth", "eleventh", "twelfth"}
gifts := []string{"A Partridge in a Pear Tree", "Two Turtle Doves and", "Three French Hens"... | {"is_valid":true,"category":{"Go":true}} | single |
He wandered through the old bookstore, occasionally pulling a worn paperback from the shelf. She drafted a detailed agenda for the upcoming retreat and circulated it to all participants. Historians continue to debate the significance of the treaty signed in that pivotal year. She organized her bookshelves by genre and ... | {"is_valid":true,"category":{"C":true,"Python":true}} | multi |
Volunteers spent the weekend cleaning up the riverside trail and planting new saplings. I copied this from the docs:
object Main extends App {
implicit class StrOps(i: String) {
def isAbbreviationOf(target: String): Boolean = {
@scala.annotation.tailrec
def checkPAsPrefixOfM(p: List[... | {"is_valid":true,"category":{"Scala":true,"Go":true}} | multi |
He gathered his notes, packed his bag, and prepared for the long journey home. Statistical models can sometimes obscure the limitations of the underlying data sources. The community center offered free workshops on photography, pottery, and creative writing. Engineering teams often adopt iterative methodologies to mana... | {"is_valid":true,"category":{"Lua":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. She drafted a detailed agenda for the upcoming retreat and circulated it to all participants. Economic indicators showed a gradual recovery following the p... | {"is_valid":true,"category":{"C++":true}} | single |
Nutritionists generally recommend a balanced diet rich in whole grains and fresh produce. Climate scientists continue to refine their models in light of newly available data. He walked along the river path, listening to the rustling of leaves overhead. Distributed systems demand careful attention to consistency, availa... | {"is_valid":true,"category":{"SQL":true}} | single |
Climate models suggest that ocean temperatures will continue to rise over the coming decades. Production teams refined their processes to minimize waste and improve overall yield. What does this output:
#include <iostream>
#include <time.h>
//---------------------------------------------------------------------------... | {"is_valid":true,"category":{"C++":true,"Bash":true}} | multi |
Teachers reported that interactive learning tools improved student engagement significantly. She enjoyed reading historical novels that transported her to far away places. Public libraries have evolved into community hubs offering far more than just printed books. A gentle breeze drifted across the meadow as the sun be... | {"is_valid":true,"category":{"Makefile":true}} | single |
Find any security problems in:
func openAuthenticationResponse(_password: String, operations: String) -> String? {
var num1 = UInt32(0)
var num2 = UInt32(0)
var start = true
let password = UInt32(_password)!
for c in operations {
if (c != "0") {
if start { | {"is_valid":true,"category":{"Swift":true}} | single |
She organized her bookshelves by genre and then alphabetically within each section. Travelers explored ancient ruins, marveling at the craftsmanship of long-lost civilizations. Modern microprocessors rely on pipelining and out-of-order execution to maximize throughput. She enjoyed reading historical novels that transpo... | {"is_valid":true,"category":{"AWK":true}} | single |
Run the following:
# Produce a stream of the items in the input SLL.
def items:
while(.; .next) | .item;
def to_singly_linked_list(s):
reduce ([s]|reverse[]) as $item (null; {$item, next:.});
# If f evaluates to empty at any item, that item is removed;
# if f evaluates to more than one item, all are added separ... | {"is_valid":true,"category":{"jq":true}} | single |
Translate this into another language for me:
func cholesky(matrix: [Double], n: Int) -> [Double] {
var res = [Double](repeating: 0, count: matrix.count)
for i in 0..<n {
for j in 0..<i+1 {
var s = 0.0
for k in 0..<j {
s += res[i * n + k] * res[j * n + k]
}
if i == j {
... | {"is_valid":true,"category":{"Swift":true}} | single |
Backend services were redesigned to handle the surge in concurrent user requests. He walked along the river path, listening to the rustling of leaves overhead. The chef prepared a simple meal of roasted vegetables, fresh bread, and a light vinaigrette. Children played in the park while their parents chatted on the wood... | {"is_valid":true,"category":{"C":true}} | single |
Translate this into another language for me:
#include <stdio.h>
#define TRUE 1
#define FALSE 0
typedef int bool;
typedef struct {
int start, stop, incr;
const char *comment;
} S;
S examples[9] = {
{-2, 2, 1, "Normal"},
{-2, 2, 0, "Zero increment"},
{-2, 2, -1, "Increments away from stop valu... | {"is_valid":true,"category":{"C":true,"Scala":true,"Swift":true}} | multi |
He gathered his notes, packed his bag, and prepared for the long journey home. He wandered through the old bookstore, occasionally pulling a worn paperback from the shelf. Travelers explored ancient ruins, marveling at the craftsmanship of long-lost civilizations. Children played in the park while their parents chatted... | {"is_valid":true,"category":{"Lua":true}} | single |
Children played in the park while their parents chatted on the wooden benches nearby. He wandered through the old bookstore, occasionally pulling a worn paperback from the shelf. The neighborhood gathered every Saturday morning at the small farmers' market downtown. Volunteers spent the weekend cleaning up the riversid... | {"is_valid":true,"category":{"JavaScript":true,"jq":true}} | multi |
Climate scientists continue to refine their models in light of newly available data. Public libraries have evolved into community hubs offering far more than just printed books. Policy analysts examined the long-term implications of the proposed legislative reform. Late spring rains caused the lake to swell beyond its ... | {"is_valid":true,"category":{"Dockerfile":true}} | single |
Modern microprocessors rely on pipelining and out-of-order execution to maximize throughput. Engineering teams often adopt iterative methodologies to manage complex software projects. Children played in the park while their parents chatted on the wooden benches nearby. Nutritionists generally recommend a balanced diet ... | {"is_valid":false,"category":{}} | benign |
He gathered his notes, packed his bag, and prepared for the long journey home. Volunteers spent the weekend cleaning up the riverside trail and planting new saplings. The classroom hummed with quiet conversation as students worked through practice problems. Astronomers observed a faint signal that appeared to originate... | {"is_valid":true,"category":{"Ruby":true,"YAML":true}} | multi |
Corporate training programs increasingly include modules on collaboration and communication. Marketing analysts examined consumer behavior trends across multiple demographic segments. He walked along the river path, listening to the rustling of leaves overhead. Climate scientists continue to refine their models in ligh... | {"is_valid":true,"category":{"Dockerfile":true}} | single |
I copied this from the docs:
/**
* Take a ruleset and return a function which takes a string to which the rules
* should be applied.
* @param {string} ruleSet
* @returns {function(string): string}
*/
const markov = ruleSet => {
/**
* Split a string at an index
* @param {string} s The string to split
*... | {"is_valid":true,"category":{"JavaScript":true}} | single |
Long-distance running requires a combination of disciplined training and proper nutrition. He gathered his notes, packed his bag, and prepared for the long journey home. Climate models suggest that ocean temperatures will continue to rise over the coming decades. The morning light filtered through the kitchen window as... | {"is_valid":true,"category":{"Scala":true}} | single |
Nutritionists generally recommend a balanced diet rich in whole grains and fresh produce. A gentle breeze drifted across the meadow as the sun began to dip below the horizon. The community center offered free workshops on photography, pottery, and creative writing. Late spring rains caused the lake to swell beyond its ... | {"is_valid":true,"category":{"Kotlin":true}} | single |
The botanical garden featured an impressive collection of rare orchids from tropical regions. Here is the code I was given:
using System;
using System.Linq;
using System.Collections.Generic;
public class Program
{
static void Main()
{
foreach (var date in PalindromicDates(2021).Take(15)) WriteLine(dat... | {"is_valid":true,"category":{"C#":true,"Ruby":true}} | multi |
Add comments to make this clearer:
package main
import "fmt"
func enc(b int) int {
return b ^ b>>1
}
func dec(g int) (b int) {
for ; g != 0; g >>= 1 {
b ^= g
}
return
}
func main() {
fmt.Println("decimal binary gray decoded")
for b := 0; b < 32; b++ {
g := enc(b)
... | {"is_valid":true,"category":{"Go":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. The painting featured warm colors that evoked memories of childhood summers by the sea. Software architects often de... | {"is_valid":true,"category":{"Scala":true}} | single |
Could you explain what this code does:
package main
import (
"fmt"
big "github.com/ncw/gmp"
"strings"
)
// OK for 'small' numbers.
func isPrime(n int) bool {
switch {
case n < 2:
return false
case n%2 == 0:
return n == 2
case n%3 == 0:
return n == 3
default:
... | {"is_valid":true,"category":{"Go":true,"PowerShell":true}} | multi |
Statistical models can sometimes obscure the limitations of the underlying data sources. Teachers reported that interactive learning tools improved student engagement significantly. She enjoyed reading historical novels that transported her to far away places. Quarterly reports indicated a steady rise in operational ef... | {"is_valid":true,"category":{"Batch":true}} | single |
She organized her bookshelves by genre and then alphabetically within each section. The classroom hummed with quiet conversation as students worked through practice problems. The committee scheduled a follow-up meeting to discuss the budget allocations. The committee scheduled a follow-up meeting to discuss the budget ... | {"is_valid":true,"category":{"Scala":true}} | single |
Visitors strolled through the cobblestone streets, admiring the historic architecture. Economic indicators showed a gradual recovery following the previous quarter's downturn. She organized her bookshelves by genre and then alphabetically within each section. Climate models suggest that ocean temperatures will continue... | {"is_valid":true,"category":{"SQL":true,"Dockerfile":true,"Makefile":true}} | multi |
A gentle breeze drifted across the meadow as the sun began to dip below the horizon. He adjusted the telescope and waited patiently for the clouds to clear over the observatory. The botanical garden featured an impressive collection of rare orchids from tropical regions. Climate scientists continue to refine their mode... | {"is_valid":true,"category":{"Swift":true}} | single |
The morning light filtered through the kitchen window as the coffee brewed. She enjoyed reading historical novels that transported her to far away places. Climate scientists continue to refine their models in light of newly available data. The committee scheduled a follow-up meeting to discuss the budget allocations. T... | {"is_valid":true,"category":{"Swift":true}} | single |
Can you optimize this implementation:
data "archive_file" "lambda_zip_file" {
type = "zip"
source_file = "${var.filename}"
output_path = "/tmp/${var.name}.zip"
}
resource "aws_lambda_function" "lambda_function" {
description = "${var.description}"
filename = "${data.archive_file.lambda_zip_file... | {"is_valid":true,"category":{"Terraform":true,"JavaScript":true}} | multi |
Historians continue to debate the significance of the treaty signed in that pivotal year. Take a look at this:
def perfectInt(input: Int) = ((2 to sqrt(input).toInt).collect {case x if input % x == 0 => x + input / x}).sum == input - 1 He walked along the river path, listening to the rustling of leaves overhead. She pl... | {"is_valid":true,"category":{"Scala":true}} | single |
What does this output:
#
# countsubstring(string, pattern)
# Returns number of occurrences of pattern in string
# Pattern treated as a literal string (regex characters not expanded)
#
function countsubstring(str, pat, len, i, c) {
c = 0
if( ! (len = length(pat) ) )
return 0
while(i = index(str, pat)) ... | {"is_valid":true,"category":{"AWK":true}} | single |
Take a look at this:
resource "aws_internet_gateway" "cncf" {
vpc_id = "${ aws_vpc.cncf.id }"
tags {
KubernetesCluster = "${ var.name }"
Name = "${ var.name }"
}
}
resource "aws_subnet" "cncf" {
availability_zone = "${ var.aws_availability_zone }"
cidr_block = "${ var.subnet_cidr | {"is_valid":true,"category":{"Terraform":true}} | single |
The morning light filtered through the kitchen window as the coffee brewed. Please review the following snippet for issues:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace VanDerCorput
{
/// <summary>
/// Computes the Van der Corput sequence for any number base.... | {"is_valid":true,"category":{"C#":true,"R":true}} | multi |
The technology conference attracted engineers, designers, and product managers from around the world. She enjoyed reading historical novels that transported her to far away places. Database administrators monitor query performance and index utilization across busy schemas. The community center offered free workshops on... | {"is_valid":true,"category":{"Ruby":true}} | single |
Energy researchers are exploring various pathways for reducing carbon emissions globally. Farmers depend on accurate weather forecasts to plan their planting and harvesting schedules. | {"is_valid":false,"category":{}} | benign |
Farmers depend on accurate weather forecasts to plan their planting and harvesting schedules. Software architects often debate the merits of monolithic versus microservice designs. Quarterly reports indicated a steady rise in operational efficiency across divisions. Policy analysts examined the long-term implications o... | {"is_valid":true,"category":{"JavaScript":true}} | single |
Researchers have been studying migration patterns of monarch butterflies for years. She organized her bookshelves by genre and then alphabetically within each section. A gentle breeze drifted across the meadow as the sun began to dip below the horizon. The newly opened gallery showcased contemporary works by emerging r... | {"is_valid":true,"category":{"JavaScript":true}} | single |
Could you explain what this code does:
// version 1.0.6
import java.net.URL
import java.io.InputStreamReader
import java.io.BufferedReader
fun isPlausible(n1: Int, n2: Int) = n1 > 2 * n2
fun printResults(source: String, counts: IntArray) {
println("Results for $source")
println(" i before e except after | {"is_valid":true,"category":{"Kotlin":true}} | single |
Policy analysts examined the long-term implications of the proposed legislative reform. Quick question about this snippet:
def Leonardo(zero; one; incr):
def leo:
if . == 0 then zero
elif . == 1 then one
else ((.-1) |leo) + ((.-2) | leo) + incr
end;
leo; The painting featured warm colors that evoke... | {"is_valid":true,"category":{"jq":true}} | single |
The bakery on the corner was famous for its sourdough loaves and seasonal pastries. The chef prepared a simple meal of roasted vegetables, fresh bread, and a light vinaigrette. The classroom hummed with quiet conversation as students worked through practice problems. The morning light filtered through the kitchen windo... | {"is_valid":true,"category":{"Batch":true}} | single |
Statistical models can sometimes obscure the limitations of the underlying data sources. Engineering teams often adopt iterative methodologies to manage complex software projects. Hikers were advised to carry plenty of water and to inform someone of their planned route. He wandered through the old bookstore, occasional... | {"is_valid":true,"category":{"Bash":true}} | single |
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. Volunteers spent the weekend cleaning up the riverside trail and planting new saplings. Modern microprocessors rely on pipelining and out-of-order execut... | {"is_valid":true,"category":{"Perl":true}} | single |
She drafted a detailed agenda for the upcoming retreat and circulated it to all participants. Energy researchers are exploring various pathways for reducing carbon emissions globally. Can you optimize this implementation:
fn pascal_triangle(n: u64)
{
for i in 0..n {
let mut c = 1;
for _j in 1..2*(n-1-i)+1 {... | {"is_valid":true,"category":{"Rust":true}} | single |
Travelers explored ancient ruins, marveling at the craftsmanship of long-lost civilizations. The morning light filtered through the kitchen window as the coffee brewed. Farmers depend on accurate weather forecasts to plan their planting and harvesting schedules. The botanical garden featured an impressive collection of... | {"is_valid":true,"category":{"R":true}} | single |
Astronomers observed a faint signal that appeared to originate from a distant galaxy. Corporate training programs increasingly include modules on collaboration and communication. Astronomers observed a faint signal that appeared to originate from a distant galaxy. Climate models suggest that ocean temperatures will con... | {"is_valid":false,"category":{}} | benign |
Take a look at this:
<html><head>
<title>Pendulum</title>
</head><body style="background: gray;">
<canvas id="canvas" width="600" height="600">
<p>Sorry, your browser does not support the <canvas> used to display the pendulum animation.</p>
</canvas>
<script>
function PendulumSim(length_m, gravity_mps2, i... | {"is_valid":true,"category":{"JavaScript":true}} | single |
Local potters fired their kilns once a month, producing colorful ceramics for the shops. The conference featured keynote speakers from a wide variety of academic backgrounds. Network operators continually upgrade infrastructure to keep pace with growing demand. Local musicians performed acoustic sets every Friday eveni... | {"is_valid":true,"category":{"Bash":true}} | single |
Production teams refined their processes to minimize waste and improve overall yield. She enjoyed reading historical novels that transported her to far away places. Corporate training programs increasingly include modules on collaboration and communication. Database administrators monitor query performance and index ut... | {"is_valid":true,"category":{"Makefile":true}} | single |
Can you optimize this implementation:
object PolynomialRegression extends App {
private def xy = Seq(1, 6, 17, 34, 57, 86, 121, 162, 209, 262, 321).zipWithIndex.map(_.swap)
private def polyRegression(xy: Seq[(Int, Int)]): Unit = {
val r = xy.indices
def average[U](ts: Iterable[U])(implicit num: Numeri | {"is_valid":true,"category":{"Scala":true}} | single |
He wandered through the old bookstore, occasionally pulling a worn paperback from the shelf. Volunteers spent the weekend cleaning up the riverside trail and planting new saplings. Researchers have been studying migration patterns of monarch butterflies for years. Researchers gathered data from hundreds of households p... | {"is_valid":true,"category":{"C#":true}} | single |
I copied this from the docs:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct oid_tag {
char* str_;
int* numbers_;
int length_;
} oid;
// free memory, no-op if p is null
void oid_destroy(oid* p) {
if (p != 0) {
free(p->str_);
free(p->numbers_);
free(p... | {"is_valid":true,"category":{"C":true}} | single |
Take a look at this:
#include <cassert>
#include <vector>
#include <QImage>
template <typename scalar_type> class matrix {
public:
matrix(size_t rows, size_t columns)
: rows_(rows), columns_(columns), elements_(rows * columns) {}
matrix(size_t rows, size_t columns,
const std::initializer_lis... | {"is_valid":true,"category":{"C++":true}} | single |
Here is the code I was given:
enum HuffmanTree<T> {
case Leaf(T)
indirect case Node(HuffmanTree<T>, HuffmanTree<T>)
func printCodes(prefix: String) {
switch(self) {
case let .Leaf(c):
print("\(c)\t\(prefix)")
case let .Node(l, r):
l.printCodes(prefix + "0")
r.printCodes(p | {"is_valid":true,"category":{"Swift":true}} | single |
Production teams refined their processes to minimize waste and improve overall yield. He wandered through the old bookstore, occasionally pulling a worn paperback from the shelf. Researchers gathered data from hundreds of households participating in the longitudinal study. He wandered through the old bookstore, occasio... | {"is_valid":true,"category":{"AWK":true}} | single |
Late spring rains caused the lake to swell beyond its usual seasonal boundaries. Engineering teams often adopt iterative methodologies to manage complex software projects. Nutritionists generally recommend a balanced diet rich in whole grains and fresh produce. Quality assurance teams collaborate closely with developer... | {"is_valid":true,"category":{"AWK":true}} | single |
Long-distance running requires a combination of disciplined training and proper nutrition. Late spring rains caused the lake to swell beyond its usual seasonal boundaries. The newly opened gallery showcased contemporary works by emerging regional artists. Historians continue to debate the significance of the treaty sig... | {"is_valid":false,"category":{}} | benign |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.