prompt large_stringlengths 150 7.97k | target large_stringlengths 32 83 | kind large_stringclasses 3
values |
|---|---|---|
Quick question about this snippet:
#include<limits.h>
#include<stdio.h>
int fusc(int n){
if(n==0||n==1)
return n;
else if(n%2==0)
return fusc(n/2);
else
return fusc((n-1)/2) + fusc((n+1)/2);
}
int numLen(int n){
int sum = 1;
w... | {"is_valid":true,"category":{"C":true}} | single |
The morning light filtered through the kitchen window as the coffee brewed. The morning light filtered through the kitchen window as the coffee brewed. Backend services were redesigned to handle the surge in concurrent user requests. He sat by the window with a steaming mug of tea and watched the snow gently falling. R... | {"is_valid":true,"category":{"C++":true,"PowerShell":true}} | multi |
Climate models suggest that ocean temperatures will continue to rise over the coming decades. Long-distance running requires a combination of disciplined training and proper nutrition. She organized her bookshelves by genre and then alphabetically within each section. The garden looked particularly vibrant after the re... | {"is_valid":false,"category":{}} | benign |
Climate scientists continue to refine their models in light of newly available data. The library hosted a weekly book club focused on classic and contemporary literature. Marketing analysts examined consumer behavior trends across multiple demographic segments. The engineer reviewed the blueprints carefully before appr... | {"is_valid":true,"category":{"Rust":true}} | single |
Quick question about this snippet:
import java.awt._
import java.awt.event.ActionEvent
import javax.swing._
object PolySpiral extends App {
SwingUtilities.invokeLater(() =>
new JFrame("PolySpiral") {
class PolySpiral extends JPanel {
private var inc = 0.0
override def paintComponen... | {"is_valid":true,"category":{"Scala":true}} | single |
Can you optimize this implementation:
object ApolloniusSolver extends App {
case class Circle(x: Double, y: Double, r: Double)
object Tangent extends Enumeration {
type Tangent = Value
val intern = Value(-1)
val extern = Value(1)
}
import Tangent._
import scala.Math._
val solveApollonius: (Circle, Ci... | {"is_valid":true,"category":{"Scala":true}} | single |
Distributed systems demand careful attention to consistency, availability, and partition tolerance. Climate scientists continue to refine their models in light of newly available data. Historians continue to debate the significance of the treaty signed in that pivotal year. Quarterly reports indicated a steady rise in ... | {"is_valid":true,"category":{"Python":true}} | single |
The conference featured keynote speakers from a wide variety of academic backgrounds. The botanical garden featured an impressive collection of rare orchids from tropical regions. The bakery on the corner was famous for its sourdough loaves and seasonal pastries. Network operators continually upgrade infrastructure to ... | {"is_valid":true,"category":{"PowerShell":true}} | single |
Take a look at this:
#include <stdio.h>
#include <stdbool.h>
#include <time.h>
#define n 100
#define nn ((n * (n + 1)) >> 1)
bool Contains(int lst[], int item, int size) {
for (int i = size - 1; i >= 0; i--)
if (item == lst[i]) return true;
return false;
}
int * MianChowla()
{
static int mc[n]; mc[0] = 1;
... | {"is_valid":true,"category":{"C":true,"Kotlin":true}} | multi |
Hikers were advised to carry plenty of water and to inform someone of their planned route. The chef prepared a simple meal of roasted vegetables, fresh bread, and a light vinaigrette. Translate this into another language for me:
fn main() {
// Rust has a lot of neat things you can do with functions: let's go over t... | {"is_valid":true,"category":{"Rust":true}} | single |
The conference featured keynote speakers from a wide variety of academic backgrounds. Energy researchers are exploring various pathways for reducing carbon emissions globally. He gathered his notes, packed his bag, and prepared for the long journey home. Public libraries have evolved into community hubs offering far mo... | {"is_valid":true,"category":{"C":true}} | single |
Could you explain what this code does:
#include <iostream>
std::string scs(std::string x, std::string y) {
if (x.empty()) {
return y;
}
if (y.empty()) {
return x;
}
if (x[0] == y[0]) {
return x[0] + scs(x.substr(1), y.substr(1));
}
if (scs(x, y.substr(1)).size() <= ... | {"is_valid":true,"category":{"C++":true}} | single |
Nutritionists generally recommend a balanced diet rich in whole grains and fresh produce. Quick question about this snippet:
CREATE TABLE ARTIST (artistid VARCHAR); CREATE TABLE ALBUM (artistid VARCHAR);
SELECT COUNT(*) FROM ARTIST WHERE NOT artistid IN (SELECT artistid FROM ALBUM)
Then there's this one in another lan... | {"is_valid":true,"category":{"SQL":true,"Batch":true,"Scala":true}} | multi |
Project managers stressed the importance of clear documentation throughout the cycle. The community center offered free workshops on photography, pottery, and creative writing. Could you explain what this code does:
#include <stdio.h>
#include <stdlib.h>
typedef struct floatList {
float *list;
int size;
} *... | {"is_valid":true,"category":{"C":true}} | single |
Take a look at this:
#include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>
std::vector<int> divisors(int n) {
std::vector<int> divs = { 1 };
std::vector<int> divs2;
for (int i = 2; i * i <= n; i++) {
if (n % i == 0) {
int j = n / i;
divs.push_back(... | {"is_valid":true,"category":{"C++":true,"Dockerfile":true}} | multi |
Researchers gathered data from hundreds of households participating in the longitudinal study. The committee scheduled a follow-up meeting to discuss the budget allocations. The bakery on the corner was famous for its sourdough loaves and seasonal pastries. Teachers reported that interactive learning tools improved stu... | {"is_valid":false,"category":{}} | benign |
She enjoyed reading historical novels that transported her to far away places. Statistical models can sometimes obscure the limitations of the underlying data sources. Project managers stressed the importance of clear documentation throughout the cycle. Quarterly reports indicated a steady rise in operational efficienc... | {"is_valid":true,"category":{"AWK":true}} | single |
Children played in the park while their parents chatted on the wooden benches nearby. She organized her bookshelves by genre and then alphabetically within each section. Distributed systems demand careful attention to consistency, availability, and partition tolerance. Nutritionists generally recommend a balanced diet ... | {"is_valid":true,"category":{"C":true,"Java":true}} | multi |
She enjoyed reading historical novels that transported her to far away places. Network operators continually upgrade infrastructure to keep pace with growing demand. Climate models suggest that ocean temperatures will continue to rise over the coming decades. She placed the manuscript carefully on the desk and began th... | {"is_valid":true,"category":{"Perl":true,"PowerShell":true}} | multi |
Volunteers spent the weekend cleaning up the riverside trail and planting new saplings. He adjusted the telescope and waited patiently for the clouds to clear over the observatory. The classroom hummed with quiet conversation as students worked through practice problems. Local potters fired their kilns once a month, pr... | {"is_valid":false,"category":{}} | benign |
The classroom hummed with quiet conversation as students worked through practice problems. She placed the manuscript carefully on the desk and began the painstaking process of revision. He sat by the window with a steaming mug of tea and watched the snow gently falling. Take a look at this:
package main
import (
... | {"is_valid":true,"category":{"Go":true}} | single |
Local potters fired their kilns once a month, producing colorful ceramics for the shops. Modern microprocessors rely on pipelining and out-of-order execution to maximize throughput. Policy analysts examined the long-term implications of the proposed legislative reform. Refactor the function below:
CREATE TABLE player (... | {"is_valid":true,"category":{"SQL":true}} | single |
Quick question about this snippet:
using System;
using System.Collections.Generic;
using System.Linq;
public class Program
{
public static void Main() {
var baseData = new Dictionary<string, object> {
["name"] = "Rocket Skates",
["price"] = 12.75,
["color"] = "yell | {"is_valid":true,"category":{"C#":true}} | single |
Local musicians performed acoustic sets every Friday evening at the small cafe. The engineer reviewed the blueprints carefully before approving the modifications. Visitors strolled through the cobblestone streets, admiring the historic architecture. Long-distance running requires a combination of disciplined training a... | {"is_valid":false,"category":{}} | benign |
The community center offered free workshops on photography, pottery, and creative writing. He wandered through the old bookstore, occasionally pulling a worn paperback from the shelf. Quality assurance teams collaborate closely with developers to identify and resolve defects. Quality assurance teams collaborate closely... | {"is_valid":true,"category":{"jq":true,"SQL":true}} | multi |
Refactor the function below:
FROM python:2.7
MAINTAINER Dan Osborne <daniel@projectcalico.org>
WORKDIR /code/
RUN pip install --upgrade pip
RUN pip install PyInstaller
ADD requirements.txt /code/
RUN pip install -r requirements.txt
RUN easy_install http://downloads.mesosphere.io/master/debian/8/mesos-0.26 | {"is_valid":true,"category":{"Dockerfile":true}} | single |
Could you explain what this code does:
function ackermann(m, n)
{
if ( m == 0 ) {
return n+1
}
if ( n == 0 ) {
return ackermann(m-1, 1)
}
return ackermann(m-1, ackermann(m, n-1))
}
BEGIN {
for(n=0; n < 7; n++) {
for(m=0; m < 4; m++) {
print "A(" m "," n ") = " ackermann(m,n)
}
}... | {"is_valid":true,"category":{"AWK":true,"Python":true}} | multi |
Researchers gathered data from hundreds of households participating in the longitudinal study. Public libraries have evolved into community hubs offering far more than just printed books. Please review the following snippet for issues:
// here "object" is a reference
if (object == null) {
System.out.println("object ... | {"is_valid":true,"category":{"Java":true,"AWK":true}} | multi |
He wandered through the old bookstore, occasionally pulling a worn paperback from the shelf. Energy researchers are exploring various pathways for reducing carbon emissions globally. Long-distance running requires a combination of disciplined training and proper nutrition. Backend services were redesigned to handle the... | {"is_valid":false,"category":{}} | benign |
Add comments to make this clearer:
import scala.util.Random
object MontyHallSimulation {
def main(args: Array[String]) {
val samples = if (args.size == 1 && (args(0) matches "\\d+")) args(0).toInt else 1000
val doors = Set(0, 1, 2)
var stayStrategyWins = 0
var switchStrategyWins = 0
1 to | {"is_valid":true,"category":{"Scala":true}} | single |
The newly opened gallery showcased contemporary works by emerging regional artists. Run the following:
# EULER.PS1
$max = 250
$powers = New-Object System.Collections.ArrayList
for ($i = 0; $i -lt $max; $i++) {
$tmp = $powers.Add([Math]::Pow($i, 5))
}
for ($x0 = 1; $x0 -lt $max; $x0++) {
for ($x1 = 1; $x1 -lt ... | {"is_valid":true,"category":{"PowerShell":true}} | single |
Nutritionists generally recommend a balanced diet rich in whole grains and fresh produce. She drafted a detailed agenda for the upcoming retreat and circulated it to all participants. Astronomers observed a faint signal that appeared to originate from a distant galaxy. Backend services were redesigned to handle the sur... | {"is_valid":true,"category":{"Perl":true}} | single |
Farmers depend on accurate weather forecasts to plan their planting and harvesting schedules. The newly opened gallery showcased contemporary works by emerging regional artists. Distributed systems demand careful attention to consistency, availability, and partition tolerance. Software architects often debate the merit... | {"is_valid":true,"category":{"C#":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. Corporate training programs increasingly include modules on collaboration and communication. The technology conference attracted engineers, designer... | {"is_valid":true,"category":{"Batch":true,"R":true}} | multi |
Quality assurance teams collaborate closely with developers to identify and resolve defects. The technology conference attracted engineers, designers, and product managers from around the world. Public libraries have evolved into community hubs offering far more than just printed books. Nutritionists generally recommen... | {"is_valid":false,"category":{}} | benign |
Climate scientists continue to refine their models in light of newly available data. Hikers were advised to carry plenty of water and to inform someone of their planned route. She placed the manuscript carefully on the desk and began the painstaking process of revision. The morning light filtered through the kitchen wi... | {"is_valid":true,"category":{"Rust":true}} | single |
Refactor the function below:
use strict;
use warnings;
use DateTime;
use constant PI => 2 * atan2(1, 0);
my %cycles = ( 'Physical' => 23, 'Emotional' => 28, 'Mental' => 33 );
my @Q = ( ['up and rising', 'peak'],
['up but falling', 'transition'],
['down and falling', 'valley'], | {"is_valid":true,"category":{"Perl":true}} | single |
Add comments to make this clearer:
using System;
class SubStringTestClass
{
public static int CountSubStrings(this string testString, string testSubstring)
{
int count = 0;
if (testString.Contains(testSubstring))
{
for (int i = 0; i < testString.Length; i++)
{
... | {"is_valid":true,"category":{"C#":true}} | single |
Economic indicators showed a gradual recovery following the previous quarter's downturn. Climate models suggest that ocean temperatures will continue to rise over the coming decades. Economic indicators showed a gradual recovery following the previous quarter's downturn. Volunteers spent the weekend cleaning up the riv... | {"is_valid":true,"category":{"JavaScript":true}} | single |
Modern microprocessors rely on pipelining and out-of-order execution to maximize throughput. Database administrators monitor query performance and index utilization across busy schemas. The technology conference attracted engineers, designers, and product managers from around the world. Statistical models can sometimes... | {"is_valid":true,"category":{"jq":true}} | single |
I copied this from the docs:
/**
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless | {"is_valid":true,"category":{"Terraform":true}} | single |
Distributed systems demand careful attention to consistency, availability, and partition tolerance. Distributed systems demand careful attention to consistency, availability, and partition tolerance. I copied this from the docs:
class Integer
# Converts a normal integer to a Gray code.
def to_gray
raise Math::D... | {"is_valid":true,"category":{"Ruby":true,"C#":true}} | multi |
She organized her bookshelves by genre and then alphabetically within each section. The morning light filtered through the kitchen window as the coffee brewed. He adjusted the telescope and waited patiently for the clouds to clear over the observatory. The botanical garden featured an impressive collection of rare orch... | {"is_valid":true,"category":{"C++":true}} | single |
Travelers explored ancient ruins, marveling at the craftsmanship of long-lost civilizations. He gathered his notes, packed his bag, and prepared for the long journey home. | {"is_valid":false,"category":{}} | benign |
She drafted a detailed agenda for the upcoming retreat and circulated it to all participants. Local potters fired their kilns once a month, producing colorful ceramics for the shops. I copied this from the docs:
showmenu <- function(choices = NULL)
{
if (is.null(choices)) return("")
ans <- menu(choices)
if(ans... | {"is_valid":true,"category":{"R":true}} | single |
Local potters fired their kilns once a month, producing colorful ceramics for the shops. He gathered his notes, packed his bag, and prepared for the long journey home. Run the following:
'She was a soul stripper. She took my heart!' -replace '[aei]', ''
Sh ws soul strppr. Sh took my hrt! He adjusted the telescope and ... | {"is_valid":true,"category":{"PowerShell":true}} | single |
She organized her bookshelves by genre and then alphabetically within each section. Production teams refined their processes to minimize waste and improve overall yield. Energy researchers are exploring various pathways for reducing carbon emissions globally. Policy analysts examined the long-term implications of the p... | {"is_valid":true,"category":{"Bash":true,"YAML":true,"jq":true}} | multi |
Researchers have been studying migration patterns of monarch butterflies for years. She enjoyed reading historical novels that transported her to far away places. The newly opened gallery showcased contemporary works by emerging regional artists. The community center offered free workshops on photography, pottery, and ... | {"is_valid":true,"category":{"C++":true}} | single |
Engineering teams often adopt iterative methodologies to manage complex software projects. Quick question about this snippet:
sub another {
# take a function and a value
my $func = shift;
my $val = shift;
# call the function with the value as argument
return $func->($val);
};
sub reverser {
... | {"is_valid":true,"category":{"Perl":true}} | single |
Researchers have been studying migration patterns of monarch butterflies for years. Policy analysts examined the long-term implications of the proposed legislative reform. He wandered through the old bookstore, occasionally pulling a worn paperback from the shelf. Researchers have been studying migration patterns of mo... | {"is_valid":true,"category":{"Lua":true,"AWK":true}} | multi |
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 library hosted a weekly book club focused on classic and contemporary literature. The chef prepared a simple meal of roasted vegetables, fresh br... | {"is_valid":true,"category":{"Rust":true}} | single |
Add comments to make this clearer:
package main
import (
"fmt"
"strconv"
)
const DMAX = 20 // maximum digits
const LIMIT = 20 // maximum number of disariums to find
func main() {
// Pre-calculated exponential and power serials
EXP := make([][]uint64, 1+DMAX)
POW := make([][]uint64, 1+DMA | {"is_valid":true,"category":{"Go":true}} | single |
Can you optimize this implementation:
extern crate image;
use image::{GenericImageView, Rgba};
fn diff_rgba3(rgba1 : Rgba<u8>, rgba2 : Rgba<u8>) -> i32 {
(rgba1[0] as i32 - rgba2[0] as i32).abs()
+ (rgba1[1] as i32 - rgba2[1] as i32).abs()
+ (rgba1[2] as i32 - rgba2[2] as i32).abs()
}
fn main() { | {"is_valid":true,"category":{"Rust":true}} | single |
Please review the following snippet for issues:
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENS... | {"is_valid":true,"category":{"Makefile":true}} | single |
Quick question about this snippet:
require "abbrev"
File.read("daynames.txt").each_line do |line|
next if line.strip.empty?
abbr = line.split.abbrev.invert
puts "Minimum size: #{abbr.values.max_by(&:size).size}", abbr.inspect, "\n"
end | {"is_valid":true,"category":{"Ruby":true}} | single |
Travelers explored ancient ruins, marveling at the craftsmanship of long-lost civilizations. Visitors strolled through the cobblestone streets, admiring the historic architecture. Researchers gathered data from hundreds of households participating in the longitudinal study. He adjusted the telescope and waited patientl... | {"is_valid":true,"category":{"PowerShell":true}} | single |
She drafted a detailed agenda for the upcoming retreat and circulated it to all participants. Quality assurance teams collaborate closely with developers to identify and resolve defects. He walked along the river path, listening to the rustling of leaves overhead. Distributed systems demand careful attention to consist... | {"is_valid":true,"category":{"AWK":true}} | single |
Network operators continually upgrade infrastructure to keep pace with growing demand. Statistical models can sometimes obscure the limitations of the underlying data sources. Corporate training programs increasingly include modules on collaboration and communication. Visitors strolled through the cobblestone streets, ... | {"is_valid":true,"category":{"Bash":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. Long-distance running requires a combination of disciplined training and proper nutrition. Policy analysts examined the long-term implications of t... | {"is_valid":true,"category":{"Rust":true}} | single |
Add comments to make this clearer:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: strimzi-cluster-operator-kafka-broker-delegation
labels:
app: strimzi
# The Kafka broker cluster role must be bound to the cluster operator service account so that it can delegate the cluste | {"is_valid":true,"category":{"YAML":true}} | single |
Production teams refined their processes to minimize waste and improve overall yield. She organized her bookshelves by genre and then alphabetically within each section. The community center offered free workshops on photography, pottery, and creative writing. Policy analysts examined the long-term implications of the ... | {"is_valid":true,"category":{"C#":true}} | single |
Economic indicators showed a gradual recovery following the previous quarter's downturn. Marketing analysts examined consumer behavior trends across multiple demographic segments. | {"is_valid":false,"category":{}} | benign |
Local potters fired their kilns once a month, producing colorful ceramics for the shops. The newly opened gallery showcased contemporary works by emerging regional artists. Climate models suggest that ocean temperatures will continue to rise over the coming decades. Corporate training programs increasingly include modu... | {"is_valid":false,"category":{}} | benign |
I need help debugging this script:
#include <algorithm>
#include <complex>
#include <iomanip>
#include <iostream>
std::complex<double> inv(const std::complex<double>& c) {
double denom = c.real() * c.real() + c.imag() * c.imag();
return std::complex<double>(c.real() / denom, -c.imag() / denom);
}
class Quat... | {"is_valid":true,"category":{"C++":true,"Rust":true}} | multi |
Marketing analysts examined consumer behavior trends across multiple demographic segments. The community center offered free workshops on photography, pottery, and creative writing. Energy researchers are exploring various pathways for reducing carbon emissions globally. Policy analysts examined the long-term implicati... | {"is_valid":true,"category":{"SQL":true}} | single |
Please review the following snippet for issues:
package main
import (
"fmt"
"strconv"
)
func divisors(n int) []int {
divs := []int{1}
divs2 := []int{}
for i := 2; i*i <= n; i++ {
if n%i == 0 {
j := n / i
divs = append(divs, i)
if i != j {
... | {"is_valid":true,"category":{"Go":true}} | single |
She drafted a detailed agenda for the upcoming retreat and circulated it to all participants. Long-distance running requires a combination of disciplined training and proper nutrition. Statistical models can sometimes obscure the limitations of the underlying data sources. Farmers depend on accurate weather forecasts t... | {"is_valid":true,"category":{"Kotlin":true}} | single |
Quick question about this snippet:
import java.awt.*
fun getMouseColor(): Color {
val location = MouseInfo.getPointerInfo().location
return getColorAt(location.x, location.y)
}
fun getColorAt(x: Int, y: Int): Color {
return Robot().getPixelColor(x, y)
} | {"is_valid":true,"category":{"Kotlin":true}} | single |
Visitors strolled through the cobblestone streets, admiring the historic architecture. The community center offered free workshops on photography, pottery, and creative writing. Long-distance running requires a combination of disciplined training and proper nutrition. He wandered through the old bookstore, occasionally... | {"is_valid":false,"category":{}} | benign |
The morning light filtered through the kitchen window as the coffee brewed. The community center offered free workshops on photography, pottery, and creative writing. He wandered through the old bookstore, occasionally pulling a worn paperback from the shelf. The newly opened gallery showcased contemporary works by eme... | {"is_valid":false,"category":{}} | benign |
The committee scheduled a follow-up meeting to discuss the budget allocations. The committee scheduled a follow-up meeting to discuss the budget allocations. Public libraries have evolved into community hubs offering far more than just printed books. Project managers stressed the importance of clear documentation throu... | {"is_valid":true,"category":{"R":true,"Bash":true}} | multi |
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. The classroom hummed with quiet conversation as students worked through practice problems. The painting featured warm colors that evoked memories of... | {"is_valid":true,"category":{"Ruby":true,"C":true}} | multi |
The morning light filtered through the kitchen window as the coffee brewed. Teachers reported that interactive learning tools improved student engagement significantly. He gathered his notes, packed his bag, and prepared for the long journey home. The morning light filtered through the kitchen window as the coffee brew... | {"is_valid":false,"category":{}} | benign |
Energy researchers are exploring various pathways for reducing carbon emissions globally. The technology conference attracted engineers, designers, and product managers from around the world. Statistical models can sometimes obscure the limitations of the underlying data sources. Hikers were advised to carry plenty of ... | {"is_valid":false,"category":{}} | benign |
The library hosted a weekly book club focused on classic and contemporary literature. She enjoyed reading historical novels that transported her to far away places. The bakery on the corner was famous for its sourdough loaves and seasonal pastries. He sat by the window with a steaming mug of tea and watched the snow ge... | {"is_valid":true,"category":{"Go":true,"Swift":true}} | multi |
Take a look at this:
#include <algorithm>
#include <cstdlib>
#include <fstream>
#include <iostream>
#include <iterator>
#include <string>
#include <unordered_map>
#include <vector>
int main(int ac, char** av) {
std::ios::sync_with_stdio(false);
int head = (ac > 1) ? std::atoi(av[1]) : 10;
std::istreambuf_iterat... | {"is_valid":true,"category":{"C++":true,"Java":true}} | multi |
Can you optimize this implementation:
-- This function returns another function that
-- keeps n1 and n2 in scope, ie. a closure.
function multiplier (n1, n2)
return function (m)
return n1 * n2 * m
end
end
-- Multiple assignment a-go-go
local x, xi, y, yi = 2.0, 0.5, 4.0, 0.25
local | {"is_valid":true,"category":{"Lua":true}} | single |
Here is the code I was given:
/**
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required ... | {"is_valid":true,"category":{"Terraform":true}} | single |
What does this output:
FROM php:8.0.19-fpm-alpine
ARG TIMEZONE="UTC"
SHELL ["sh", "-eo", "pipefail", "-c"]
# install composer and extensions: pdo_pgsql, intl, zip
RUN apk update && \
apk add --no-cache -q \
bash \
git \
subversion \
openssh-client
RUN curl -sSLf \
-o /usr/lo | {"is_valid":true,"category":{"Dockerfile":true}} | single |
The technology conference attracted engineers, designers, and product managers from around the world. Hikers were advised to carry plenty of water and to inform someone of their planned route. Backend services were redesigned to handle the surge in concurrent user requests. The chef prepared a simple meal of roasted ve... | {"is_valid":true,"category":{"C++":true}} | single |
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. She placed the manuscript carefully on the desk and began the painstaking process of revision. Late spring rains caused the lake to swell beyond its usual seasonal... | {"is_valid":true,"category":{"Terraform":true,"Scala":true}} | multi |
Take a look at this:
# Usage: GAWK -f ITERATED_DIGITS_SQUARING.AWK
BEGIN {
# Setup buffer for results up to 9*9*8
for (i = 1; i <= 648; i++) {
k = i
do {
k = squaredigitsum(k)
} while ((k != 1) && (k != 89))
if (k == 1) # This will give us 90 entries
buffe... | {"is_valid":true,"category":{"AWK":true}} | single |
Visitors strolled through the cobblestone streets, admiring the historic architecture. Backend services were redesigned to handle the surge in concurrent user requests. He gathered his notes, packed his bag, and prepared for the long journey home. I copied this from the docs:
<executable name> <width of graphics window... | {"is_valid":true,"category":{"C":true}} | single |
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. Network operators continually upgrade infrastructure to keep pace with growing demand. Long-distance running requires a combination of disciplined... | {"is_valid":true,"category":{"Terraform":true}} | single |
Translate this into another language for me:
'''Cheryl's Birthday'''
from itertools import groupby
from re import split
# main :: IO ()
def main():
'''Derivation of the date.'''
month, day = 0, 1
print(
# (3 :: A "Then I also know")
# (A's month contains only one remaining day)
... | {"is_valid":true,"category":{"Python":true,"YAML":true}} | multi |
What does this output:
:: Floyd's triangle Task from Rosetta Code
:: Batch File Implementation
@echo off
rem main thing
setlocal enabledelayedexpansion
call :floydtriangle 5
echo(
call :floydtriangle 14
exit /b 0
:floydtriangle
set "fila=%1"
for /l %%c in (1,1,%fila%) do (
set /a "lastRowNum=%%c+fila*(fila-1)/2... | {"is_valid":true,"category":{"Batch":true,"Swift":true}} | multi |
Quick question about this snippet:
apiVersion: apps/v1
kind: Deployment
metadata:
name: captureorder
spec:
selector:
matchLabels:
app: captureorder
replicas: 2
template:
metadata:
labels:
app: captureorder
spec:
containers:
- name: captureorder
... | {"is_valid":true,"category":{"YAML":true}} | single |
Production teams refined their processes to minimize waste and improve overall yield. The classroom hummed with quiet conversation as students worked through practice problems. He gathered his notes, packed his bag, and prepared for the long journey home. The painting featured warm colors that evoked memories of childh... | {"is_valid":true,"category":{"Scala":true}} | single |
Software architects often debate the merits of monolithic versus microservice designs. Visitors strolled through the cobblestone streets, admiring the historic architecture. A gentle breeze drifted across the meadow as the sun began to dip below the horizon. Engineering teams often adopt iterative methodologies to mana... | {"is_valid":true,"category":{"Python":true}} | single |
Translate this into another language for me:
package main
import "fmt"
// Define set as a type to hold a set of complex numbers. A type
// could be defined similarly to hold other types of elements. A common
// variation is to make a map of interface{} to represent a set of
// mixed types. Also here the map valu... | {"is_valid":true,"category":{"Go":true}} | single |
Could you explain what this code does:
// version 1.1.2
fun subleq(program: String) {
val words = program.split(' ').map { it.toInt() }.toTypedArray()
val sb = StringBuilder()
var ip = 0
while (true) {
val a = words[ip]
val b = words[ip + 1]
var c = words[ip + 2]
ip += ... | {"is_valid":true,"category":{"Kotlin":true}} | single |
Long-distance running requires a combination of disciplined training and proper nutrition. The garden looked particularly vibrant after the recent rain. Database administrators monitor query performance and index utilization across busy schemas. Climate scientists continue to refine their models in light of newly avail... | {"is_valid":true,"category":{"Swift":true}} | single |
She drafted a detailed agenda for the upcoming retreat and circulated it to all participants. Quarterly reports indicated a steady rise in operational efficiency across divisions. Policy analysts examined the long-term implications of the proposed legislative reform. The neighborhood gathered every Saturday morning at ... | {"is_valid":true,"category":{"Terraform":true}} | single |
He gathered his notes, packed his bag, and prepared for the long journey home. Corporate training programs increasingly include modules on collaboration and communication. He sat by the window with a steaming mug of tea and watched the snow gently falling. Quality assurance teams collaborate closely with developers to ... | {"is_valid":true,"category":{"Bash":true}} | single |
The classroom hummed with quiet conversation as students worked through practice problems. The newly opened gallery showcased contemporary works by emerging regional artists. Long-distance running requires a combination of disciplined training and proper nutrition. Modern microprocessors rely on pipelining and out-of-o... | {"is_valid":true,"category":{"Python":true}} | single |
Quality assurance teams collaborate closely with developers to identify and resolve defects. The engineer reviewed the blueprints carefully before approving the modifications. Network operators continually upgrade infrastructure to keep pace with growing demand. He adjusted the telescope and waited patiently for the cl... | {"is_valid":true,"category":{"Lua":true}} | single |
Astronomers observed a faint signal that appeared to originate from a distant galaxy. Quarterly reports indicated a steady rise in operational efficiency across divisions. Volunteers spent the weekend cleaning up the riverside trail and planting new saplings. She drafted a detailed agenda for the upcoming retreat and c... | {"is_valid":true,"category":{"Python":true}} | single |
The chef prepared a simple meal of roasted vegetables, fresh bread, and a light vinaigrette. Modern microprocessors rely on pipelining and out-of-order execution to maximize throughput. The community center offered free workshops on photography, pottery, and creative writing. The committee scheduled a follow-up meeting... | {"is_valid":true,"category":{"R":true}} | single |
Network operators continually upgrade infrastructure to keep pace with growing demand. Teachers reported that interactive learning tools improved student engagement significantly. Astronomers observed a faint signal that appeared to originate from a distant galaxy. Marketing analysts examined consumer behavior trends a... | {"is_valid":false,"category":{}} | benign |
Late spring rains caused the lake to swell beyond its usual seasonal boundaries. Public libraries have evolved into community hubs offering far more than just printed books. Local potters fired their kilns once a month, producing colorful ceramics for the shops. Refactor the function below:
pool = {} -- create an "aren... | {"is_valid":true,"category":{"Lua":true}} | single |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.