prompt
stringlengths
1.3k
3.64k
language
stringclasses
16 values
label
int64
-1
5
text
stringlengths
14
130k
Below is an extract from a C++ program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid C++ code, even if it's not educa...
cpp
3
// source: https://leetcode.com/problems/compare-version-numbers/ /** * * Compare two version numbers version1 and version2. * If version1 > version2 return 1, if version1 < version2 return -1, otherwise return 0. * * You may assume that the version strings are non-empty and contain only digits and the . characte...
Below is an extract from a C program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid C code, even if it's not education...
c
2
#include <types.h> #include <spinlock.h> #include <thread.h> #include <current.h> #include <proc.h> #include <synch.h> #include <pid.h> #define MAX_NO_PID 256 static struct pid *pids[MAX_NO_PID]; static struct lock *pid_lock; static uint16_t available = 2; struct pid *pid_create(pid_t p_pid, int index) { KASSERT...
Below is an extract from a C# program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: Add 1 point if the program contains valid C# code, even if it's not education...
csharp
2
using System; using System.Collections.Generic; using System.Data; using System.Data.SqlClient; using System.Linq; using System.Threading.Tasks; namespace ApiDapperCrud.Connection { public class SqlDbConnection : ISqlDbConnection { private string connectionString; public SqlDbConnection() ...
Below is an extract from a Swift program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid Swift code, even if it's not e...
swift
3
// // ViewControllerStateble.swift // Utility // // Created by jean.vinge on 14/06/19. // Copyright © 2019 <NAME>. All rights reserved. // import RxSwift import RxCocoa public protocol Stateable { var onEnterForeground: Driver<Notification> { get set } var onEnterBackground: Driver<Notification> { get set...
Below is an extract from a JavaScript program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid JavaScript code, even if ...
javascript
2
const mongoose = require('mongoose'); const passportLocalMongoose = require('passport-local-mongoose'); const TutorialSchema = mongoose.Schema({ title: {type:String,required:true}, content: {type: String,required:true} }); TutorialSchema.plugin(passportLocalMongoose); module.exports = mongoose.model("Tutori...
Below is an extract from a Ruby program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid Ruby code, even if it's not edu...
ruby
2
require "google_drive" require "./confluence" def build_create_table(ws, table_name) format = <<-EOS create table %{table} ( %{rows} minute int, second int ) partitioned by (year int, month int, day int, hour int) stored as parquet ; EOS row_format = " %{name} %{type} comment \"%{comment}\"," rows = (2..w...
Below is an extract from a PHP program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid PHP code, even if it's not educa...
php
3
<?php /** * @author <NAME> <<EMAIL>> * @copyright City of Edinburgh Council & <NAME> * @license Open Source under the 3-clause BSD License * @url https://github.com/City-Outdoors/City-Outdoors-Web */ class FeatureCheckinQuestionHigherOrLower extends BaseFeatureCheckinQuestion { public function __construct($dat...
Below is an extract from a PHP program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid PHP code, even if it's not educa...
php
2
<h1><?=$category['Category']['name'] ?></h1> <table class="product_listing"> <? foreach ( $products as $product ){ ?> <tr> <td class="image"> <?php if ( !empty($product['Product']['Image']) ){ ?> <a href="/users/products/view/<?=$product['Product']['id']?>"> <img src="/product-images/...
Below is an extract from a C# program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: Add 1 point if the program contains valid C# code, even if it's not education...
csharp
2
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace Escuela_Api.Models { public class Materia { public int idmateria { get; set; } public string no...
Below is an extract from a Ruby program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid Ruby code, even if it's not edu...
ruby
2
class EmployeesController < ApplicationController def index @names = Employee.all end def show @id=params['id'].to_i data=Employee.all @details = data.select{|a| a[:id].to_i==@id} end end
Below is an extract from a Swift program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid Swift code, even if it's not e...
swift
3
// // PolynomialFunction.swift // Math // // Created by <NAME> on 31.07.16. // Copyright © 2016 pauljohanneskraft. All rights reserved. // import Foundation public struct PolynomialFunction: Function { // stored properties public var polynomial: Polynomial<Double> // initializers public init(_ poly: Polyn...
Below is an extract from a shell script. Evaluate whether it has a high educational value and could help teach shell scripting. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the script contains valid shell commands, even if...
shell
1
git pull <EMAIL>:/spetum/SystemManagementScript.git
Below is an extract from a TypeScript program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid TypeScript code, even if ...
typescript
3
import * as LRU from 'lru-cache'; import { Account } from 'klendathu-json-types'; import { ObservableAccount } from './ObservableAccount'; import { session } from '../models'; export class AccountStore { private cacheById: LRU.Cache<string, ObservableAccount>; private cacheByName: LRU.Cache<string, Account>; co...
Below is an extract from a C++ program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid C++ code, even if it's not educa...
cpp
2
// // oscServer.cpp // Orchids // // Created by <NAME> on 16/04/14. // Copyright (c) 2014 <NAME>. All rights reserved. // #include "oscServer.h" OSCListener::OSCListener(Session* sessObj) { try { s = new UdpListeningReceiveSocket( IpEndpointName(IpEndpointName::ANY_ADDRESS, LOCAL_PORT),...
Below is an extract from a C++ program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid C++ code, even if it's not educa...
cpp
0
/********************************************************************* * * Software License Agreement (BSD License) * * Copyright (c) 2008, 2013, <NAME>, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the followi...
Below is an extract from a Rust program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid Rust code, even if it's not edu...
rust
5
// https://www.reddit.com/r/AlgoExpert/comments/etbi4o/day_4_20200124_problem_of_the_day_asked_by/ use std::cmp; // SS: O(N log N) fn merge_overlapping_ranges_1(ranges: &mut [(i64, i64)]) -> Vec<(i64, i64)> { // SS: check for empty if ranges.len() <= 1 { ranges.to_vec() } else { // SS: O(N...
Below is an extract from a Markdown document. Evaluate its educational value, considering both Markdown usage and the content itself. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the document uses basic Markdown syntax cor...
markdown
1
### first we mince the ginger
Below is an extract from a Kotlin program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid Kotlin code, even if it's not...
kotlin
1
package cryptography.console.command class CommandHide( val message: String, val password: String, val inputFile: String, val outputFile: String, ) : Command
Below is an extract from a Swift program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid Swift code, even if it's not e...
swift
2
// // GenreView.swift // SwiftUI_Starter // // Created by <NAME> on 29/08/20. // Copyright © 2020 <NAME>. All rights reserved. // import SwiftUI struct GenreView: View { var body: some View { return HStack(spacing: 15) { Button(action: actionMethod) { Text("Action") ...
Below is an extract of SQL code. Evaluate whether it has a high educational value and could help teach SQL and database concepts. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the code contains valid SQL syntax, even if it'...
sql
1
SELECT width_bucket(3.5::float8, 3.0::float8, 3.0::float8, 888);
Below is an extract from a Swift program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid Swift code, even if it's not e...
swift
3
// // CountriesTableViewController.swift // Weather // // Created by <NAME> on 9/26/20. // import UIKit protocol CountriesTableViewControllerDelegate { func filterVenues(by country: Country) } class CountriesTableViewController: UITableViewController { //MARK: - Storyboard Connections @IBOutlet var count...
Below is an extract from a shell script. Evaluate whether it has a high educational value and could help teach shell scripting. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the script contains valid shell commands, even if...
shell
1
#!/usr/bin/env bash # # Author: jacob # Email: # Github: https://github.com/bavdu # Date: echo ---------------------$(date)------------------------ awk '{ R[$3]++ } END{ for(i in R){ print i,R[i] }}' $1 |sort -k2 -rn awk -v number=0 '{ R[$3]++ } END{ for(i in R){ number=number+R[i] } print "总和为:"number }' $1 echo...
Below is an extract from a shell script. Evaluate whether it has a high educational value and could help teach shell scripting. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the script contains valid shell commands, even if...
shell
0
How to unmodify a modified file Using tags for version control Limiting log output by time Search for commits by author Remote repositories: fetching and pushing
Below is an extract from a JavaScript program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid JavaScript code, even if ...
javascript
3
const mongoose = require('mongoose'); const validator = require('validator'); const jwt = require('jsonwebtoken'); const bcrypt = require('bcryptjs'); const { Schema } = mongoose; const UserSchema = new Schema({ name: { type: String, required: true, trim: true, minlength: [3, 'Name should be at leas...
Below is an extract from a JavaScript program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid JavaScript code, even if ...
javascript
1
import { Base } from './base.js'; import { paramTypes } from './_types.js'; import { EJSON } from 'meteor/ejson'; export class Originate extends Base { get params() { return _.extend(super.params, { timeout: { type: paramTypes.uint }, destination: { type: paramTypes.string ...
Below is an extract from a C++ program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid C++ code, even if it's not educa...
cpp
2
/** * \file main_test_commandline.cpp * \brief This is the main file for the test commandline * * \date aug. 21, 2015 * \author alexander * * \ingroup autotest **/ #include <iostream> #include "gtest/gtest.h" #include "core/utils/global.h" #include "core/reflection/commandLineSetter.h" #include "core/refl...
Below is an extract from a PHP program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid PHP code, even if it's not educa...
php
3
<?php namespace TrabajoTarjeta; class TiempoFalso extends Tiempo implements TiempoInterface { protected $tiempo; public function __construct($tiempoInicial = 0) { $this->tiempo = $tiempoInicial; } public function avanzar($segundos) { $this->tiempo += $segundos; } public fu...
Below is an extract from a C++ program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid C++ code, even if it's not educa...
cpp
0
/* Copyright Statement: * * This software/firmware and related documentation ("MediaTek Software") are * protected under relevant copyright laws. The information contained herein is * confidential and proprietary to MediaTek Inc. and/or its licensors. Without * the prior written permission of MediaTek inc. and/or ...
Below is an extract from a Swift program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid Swift code, even if it's not e...
swift
2
// // AdidasChallenge // // Created by <NAME> on 05/12/2017. // Copyright © 2017 ERISCO. All rights reserved. // import Foundation public class Forecast { // MARK: - Properties var time: Date! var summary: String! var icon: String! var precipitation_probability: Double! var precipitati...
Below is an extract from a Go program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid Go code, even if it's not educati...
go
3
package main import ( "fmt" "io/ioutil" "log" "os" "os/exec" "path/filepath" "strings" "github.com/fatih/color" ) var ( workDir = "." workDirBasepath = "" ) func main() { fmt.Print("Checking your Ginkgo Installation...") cmd := exec.Command("ginkgo", "help") if err := cmd.Run(); err != nil { ...
Below is an extract from a Kotlin program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid Kotlin code, even if it's not...
kotlin
2
package raytracer import kotlin.math.PI fun degreesToRadians(degrees: Double) = degrees * PI / 180.0 fun Double.clamp(min: Double, max: Double): Double = when { this < min -> min this > max -> max else -> this }
Below is an extract from a Java program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid Java code, even if it's not edu...
java
2
package servlets; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; im...
Below is an extract from a Kotlin program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid Kotlin code, even if it's not...
kotlin
2
package com.androiddevs.githubjobsclient.repository import com.androiddevs.githubjobsclient.api.RetrofitInstance import com.androiddevs.githubjobsclient.db.JobsDatabase import com.androiddevs.githubjobsclient.models.JobsItem class NewsRepository( val db: JobsDatabase ) { suspend fun getBreakingNews() = ...
Below is an extract from a C++ program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid C++ code, even if it's not educa...
cpp
2
#ifndef CAMERA_HPP #define CAMERA_HPP #include <array> #include "GeomUtils.h" class Frustum { public: Frustum(const float4x4 mvp); bool isContainedWithin(const float4& point) const; bool isContainedWithin(const float3& point) const; Intersection isContainedWithin(const AABB& aabb) const; privat...
Below is an extract from a Kotlin program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid Kotlin code, even if it's not...
kotlin
5
package toc2 import kotlinx.coroutines.* fun main() = runBlocking { val job = launch { try { repeat(1000) { i -> println("job: I'm sleeping $i ...") delay(500L) } } finally { println("job: I'm running finally") } } ...
Below is an extract from a C# program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: Add 1 point if the program contains valid C# code, even if it's not education...
csharp
3
using Node; using UnityEngine; using UnityEngine.UI; namespace Events { public class Reviewprefab : MonoBehaviour { public Text Headline; public Text Effect; public Text Content; public void ChangeText(string headline,string preInsert,string effect) { Headline.text = headline; Content.text = preIn...
Below is an extract from a C++ program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid C++ code, even if it's not educa...
cpp
3
/*********************************************************************************************/ /* Problem: Misere Nim (HR) ********/ /*********************************************************************************************/ /* --Problem statement: Two people are playing game of Misère Nim. The basic rules for t...
Below is an extract from a C program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid C code, even if it's not education...
c
1
#ifndef __MOTOR_H #define __MOTOR_H #include "stm32f10x.h" #include "stm32f10x_tim.h" #include "delay.h" #include "sg90.h" #include "blue.h" #include "hcsr04.h" #include "red.h" void TIM4_PWM_Init(void); void Motor_Init(void); void CarGo(int); void CarStop(void); void CarBack(int); void CarLeft(int); //×óת void Car...
Below is an extract from a TypeScript program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid TypeScript code, even if ...
typescript
2
export interface Device { id: string, title: string, headers: Label[], rows: string[][] } export interface Label { label: string, full_label: string }
Below is an extract from a Ruby program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid Ruby code, even if it's not edu...
ruby
1
#Start thetvdb client $tvdb = $config['tvdb'] && $config['tvdb']['api_key'] ? TvdbParty::Search.new($config['tvdb']['api_key']) : nil
Below is an extract from a Java program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid Java code, even if it's not edu...
java
3
/** * Write a description of class BootTest here. * * @author (your name) * @version (a version number or a date) */ public class BoolTest { private int one; public BoolTest(int newOne) { one = newOne; } public int getOne() { return one; } public boolean isGreater1(BoolTest ...
Below is an extract from a shell script. Evaluate whether it has a high educational value and could help teach shell scripting. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the script contains valid shell commands, even if...
shell
1
#!/bin/sh ############################################################################### # # This file generated by Jython installer # Created on XXX by ian "/Users/ian/javadev/lib/jython-2.1/jython" "/Users/ian/javadev/lib/jython-2.1/Tools/jythonc/jythonc.py" "$@"
Below is an extract of SQL code. Evaluate whether it has a high educational value and could help teach SQL and database concepts. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the code contains valid SQL syntax, even if it'...
sql
2
CREATE OR REPLACE VIEW dga_employment_data_get_list( dga_employment_data_id, dga_employment_data_report_date, dga_employment_data_prepared_by, dga_employment_data_quarter, dga_employment_data_year, dga_employment_data_phone, dga_employment_data_company_id, dga_employment_data_company_nam...
Below is an extract of SQL code. Evaluate whether it has a high educational value and could help teach SQL and database concepts. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the code contains valid SQL syntax, even if it'...
sql
4
SELECT * FROM invoice i JOIN invoice_line il ON il.invoice_id = i.invoice_id WHERE il.unit_price > 0.99 SELECT i.invoice_date, c.first_name, c.last_name, i.total FROM invoice i JOIN customer c ON i.customer_id = c.customer_id; SELECT c.first_name, c.last_name, e.first_name, e.last_name FROM customer c J...
Below is an extract of SQL code. Evaluate whether it has a high educational value and could help teach SQL and database concepts. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the code contains valid SQL syntax, even if it'...
sql
3
TRUNCATE darksky_cards RESTART IDENTITY CASCADE; TRUNCATE darksky_folders RESTART IDENTITY CASCADE; INSERT INTO darksky_folders (title) VALUES ('Folder 1'), ('Folder 2'); INSERT INTO darksky_cards (title, modified, folder_id, details, favorited) VALUES ( 'Card 1', '02-27-2021', 1, ...
Below is an extract from a shell script. Evaluate whether it has a high educational value and could help teach shell scripting. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the script contains valid shell commands, even if...
shell
4
#!/bin/bash # A POSIX variable OPTIND=1 # Reset in case getopts has been used previously in the shell. # Initialize variables with default values output="output" # Directory where output should be stored. samplesheet="SampleSheet.csv" # Path to the samplesheet file. base_path="" ...
Below is an extract from a C++ program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid C++ code, even if it's not educa...
cpp
1
// 程序清单14.7.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include "Worker0.h" const int LIM = 4; int main() { { Waiter bob("<NAME>", 314L, 5); Singer bev("<NAME>", 522L, 3); Waiter w_temp; Singer s_temp; Worker * pw[LIM] = {&bob, &bev, &w_temp, &s_temp}; int i; for ( i = 2; i < LIM; i++) { pw...
Below is an extract from a Java program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid Java code, even if it's not edu...
java
3
//Classe de estrutura PRODUTO que contem: Nome, Departamento, Preço e Código de Barras public class Produto { private int codBarras; private String nome; private String departamento; double preco; // Já que meus atributos estão blindados (encapsulados) com "private" antes do atributo, precisamos de mecanismos ...
Below is an extract from a shell script. Evaluate whether it has a high educational value and could help teach shell scripting. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the script contains valid shell commands, even if...
shell
1
# Use Neovim instead of vim. # alias vim="nvim" # alias v="nvim"
Below is an extract from a Go program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid Go code, even if it's not educati...
go
1
package common import ( . "ray-tracing/pkg/vec3" ) // Probability density function type PDF interface { Value(direction Vec3) float64 Generate() Vec3 }
Below is an extract from a C program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid C code, even if it's not education...
c
4
/*************************************************************** * * @file: nty_timer.h * @author: wilson * @version: 1.0 * @date: 2021-08-21 13:54:25 * @license: MIT * @brief: * (1) 计时器(Timer)管理多个计时任务(TimerTask), * 每个计时任务(TimerTask)拥有独立的计时周期, 周期循环次数和回调函数 * (2) 采用红黑树维护计时任务结点 * (3) Thread unsafety...
Below is an extract from a Kotlin program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid Kotlin code, even if it's not...
kotlin
1
package com.veronica.idn.foodiest.login class LoginViewModel { }
Below is an extract from a C program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid C code, even if it's not education...
c
2
/* Run on e-sim as: * e-sim -r 1 -c 2 manual_message_pass.elf */ #include <stdio.h> #include "e_lib.h" int main(void) { e_coreid_t coreid = e_get_coreid(); unsigned i; if (coreid == 0x808) { volatile int *p; p = (int *) 0x80880000; while ((*p) == 0); /* Wait until message has...
Below is an extract from a C++ program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid C++ code, even if it's not educa...
cpp
3
#include "GeometryComponentSerializer.h" using namespace ticpp; #include "../../Maths/MathVector3.hpp" #include "../../Maths/MathQuaternion.hpp" using namespace Maths; #include "../../System/SystemTypeMapper.hpp" using namespace System; namespace Serialization { ISystemComponent* GeometryComponentSerializer::DeSer...
Below is an extract from a Go program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid Go code, even if it's not educati...
go
2
package docker import ( "context" "github.com/docker/docker/api/types" "github.com/docker/docker/client" ) type NetworkConfig struct { Name string Labels map[string]string AttachIfExist bool } type Network struct { ID string NetworkConfig cli *client.Client } func NewNetwork(client *Docke...
Below is an extract from a shell script. Evaluate whether it has a high educational value and could help teach shell scripting. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the script contains valid shell commands, even if...
shell
1
#!/bin/bash sed -i -e "\#::KIBANA_HOST::# s#::KIBANA_HOST::#${KIBANA_HOST}#g" /kibana/config/kibana.yml sed -i -e "\#::KIBANA_PORT::# s#::KIBANA_PORT::#${KIBANA_PORT}#g" /kibana/config/kibana.yml sed -i -e "\#::ES_URL::# s#::ES_URL::#${ES_URL}#g" /kibana/config/kibana.yml sed -i -e "\#::KIBANA_INDEX::# s#::KIBANA_INDE...
Below is an extract from a Kotlin program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid Kotlin code, even if it's not...
kotlin
1
package com.example.tmdbdemo.data import com.example.tmdbdemo.BuildConfig import com.jakewharton.retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory import okhttp3.OkHttpClient import okhttp3.logging.HttpLoggingInterceptor import retrofit2.Retrofit import retrofit2.converter.gson.GsonConverterFactory object Networkin...
Below is an extract from a PHP program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid PHP code, even if it's not educa...
php
2
<?php require("database.php"); //THIS PAGE SHOULD BE RUN EVERYDAY TO SEND OUT REMINDERS $due_books = "SELECT account.account_id,account.name, book.title, borrowed_books.due_date, " . "DATEDIFF(`due_date`,CURRENT_DATE) AS DateDiff from borrowed_books ," . " account, uploaded_books, book where a...
Below is an extract from a Markdown document. Evaluate its educational value, considering both Markdown usage and the content itself. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the document uses basic Markdown syntax cor...
markdown
2
# Creating-a-modern-blog-with-Django-and-Python This is a modern blog which contains features like: 1. Commenting Systems with Discus 2. SEO Friendly slugs 3. Modern and User-friendly interface 4. Advanced Text Editor
Below is an extract from a Swift program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid Swift code, even if it's not e...
swift
2
// // ZTOAuthViewController.swift // SinaWeibo // // Created by sharayuki on 2017/1/8. // Copyright © 2017年 sharayuki. All rights reserved. // import UIKit import SVProgressHUD class ZTOAuthViewController: UIViewController{ let webView = UIWebView() override func loadView() { view = webVi...
Below is an extract from a Swift program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid Swift code, even if it's not e...
swift
3
// // WarmUp.swift // HRSwift // // Created by <NAME> on 2015-11-24. // Copyright © 2015 <NAME>. All rights reserved. // import Foundation // https://www.hackerrank.com/challenges/angry-professor public class AngryProfessor { public init() {} func solution() -> Void { let TN = Int(getLin...
Below is an extract from a JavaScript program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid JavaScript code, even if ...
javascript
2
const userController = require("../controllers").user; const messageController = require("../controllers").message; // strategy for checking logged in status before delivering requested assets const checkAuthentication = (req, res, next) => { if (req.isAuthenticated()) { next(); } else { res.status(401).se...
Below is an extract from a C# program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: Add 1 point if the program contains valid C# code, even if it's not education...
csharp
2
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. namespace System.Data.Entity.Infrastructure.Interception { using System.Data.Entity.Infrastructure.DependencyResolution; using System.Data.Entity.Utilities; internal class D...
Below is an extract from an HTML document. Evaluate whether it has a high educational value and could help teach web development. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the document contains valid HTML markup, even i...
html
3
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>campfirecoffee.com</title> </head> <body> <img src="https://github.com/codefellows/seattle-201n6/blob/master/class-06-dom--objects--domain_modeling/lab/assets/campfire-coffee.jpg"> <img src="https://github.com/codefellows/seattle-201n6/bl...
Below is an extract from a Go program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid Go code, even if it's not educati...
go
3
package backend import ( "Pushsystem/src/protocol" "net" "Pushsystem/src/utils" "sync" "time" "math" "fmt" ) type Session struct { //ProtoCheck *protocol.ProtoCheck //负责粘包处理 ManagerID [32]byte // 解析服务器的唯一ID ManagerIDC uint16 // 解析服务的机房 Connection net.Conn // 连接handle State bool // 当前状态 R...
Below is an extract from an HTML document. Evaluate whether it has a high educational value and could help teach web development. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the document contains valid HTML markup, even i...
html
1
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <style type="t...
Below is an extract of SQL code. Evaluate whether it has a high educational value and could help teach SQL and database concepts. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the code contains valid SQL syntax, even if it'...
sql
3
CREATE TABLE IF NOT EXISTS customer ( customer_id serial, customer_info jsonb -- {name, contacts: {email, number}, age, nationality} -- we need name & contacts to inform customers about fests they might like; -- age and/or nationality can be used to make furthe...
Below is an extract from a JavaScript program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid JavaScript code, even if ...
javascript
1
export const FETCH_PLAYLIST_REQUEST = 'FETCH_PLAYLIST_REQUEST'; export const FETCH_PLAYLIST_SUCCESS = 'FETCH_PLAYLIST_SUCCESS'; export const FETCH_PLAYLIST_FAILED = 'FETCH_PLAYLIST_FAILED'; export const FETCH_PLAYLIST_ABORT = 'FETCH_PLAYLIST_ABORT'; export const UPDATE_PLAYLIST_NAME_SUCCESS = 'UPDATE_PLAYLIST_NAME_SUC...
Below is an extract of SQL code. Evaluate whether it has a high educational value and could help teach SQL and database concepts. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the code contains valid SQL syntax, even if it'...
sql
2
DROP PROCEDURE IF EXISTS getPaymentMethod; DELIMITER | CREATE DEFINER=`root`@`localhost` PROCEDURE `getPaymentMethod`( IN find_id_loc VARCHAR(20) ) BEGIN DECLARE n_paymentmethod INT; SET n_paymentmethod=(SELECT COUNT(*) FROM ifm_dbstoredgdsfile WHERE pnrLocator=find_id_loc AND content LIKE '%FPCASH%' AND `content` LI...
Below is an extract from a Markdown document. Evaluate its educational value, considering both Markdown usage and the content itself. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the document uses basic Markdown syntax cor...
markdown
4
#Date Utilities <NAME> June 11, 2009 Namespace: lib.devlinsf.joda-utils This library is designed to wrap the Joda Time library from clojure. It was inspired by <NAME> work with sequence abstractions. It depends on `clojure.contrib.str-utils`, `lib.devlinsf.date-utils`, and the Joda-time 1.6 jar. #Extending to-m...
Below is an extract of SQL code. Evaluate whether it has a high educational value and could help teach SQL and database concepts. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the code contains valid SQL syntax, even if it'...
sql
1
DROP TABLE IF EXISTS `meeseeks` CASCADE; CREATE TABLE `meeseeks` ( id BIGINT AUTO_INCREMENT, `name` VARCHAR(255), purpose VARCHAR(255), date_activated VARCHAR(255), PRIMARY KEY (id) );
Below is an extract of SQL code. Evaluate whether it has a high educational value and could help teach SQL and database concepts. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the code contains valid SQL syntax, even if it'...
sql
1
SELECT route_id, route_long_name FROM akl_transport.routes where route_long_name = "380 Queen St To Airport Via Mt Eden Rd";
Below is an extract from a Kotlin program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid Kotlin code, even if it's not...
kotlin
4
package dev.fritz2.components import dev.fritz2.components.data.File import dev.fritz2.dom.html.Input import dev.fritz2.dom.html.RenderContext import dev.fritz2.styling.StyleClass import dev.fritz2.styling.div import dev.fritz2.styling.params.BasicParams import dev.fritz2.styling.params.BoxParams import dev.fritz2.sty...
Below is an extract from a Rust program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid Rust code, even if it's not edu...
rust
2
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
Below is an extract from a Go program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid Go code, even if it's not educati...
go
2
package entities import ( uuid "github.com/satori/go.uuid" "gorm.io/gorm" "time" ) type Base struct { ID uuid.UUID `gorm:"type:uuid;primary_key;not null" json:"id"` CreatedAt time.Time `json:"createdAt,string" gorm:"not null"` UpdatedAt time.Time `json:"updatedAt,string" gorm:"not null"` } // BeforeCrea...
Below is an extract from a Kotlin program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid Kotlin code, even if it's not...
kotlin
2
package com.example.bookkeeping import androidx.appcompat.app.AppCompatActivity import android.os.Bundle import android.widget.Toast import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import java.text.SimpleDateFormat import java.util.* import kotlin.collections.Ar...
Below is an extract from a TypeScript program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid TypeScript code, even if ...
typescript
2
import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { LoginComponent } from './login.component'; import { MaterialModule } from '../../material.module'; import { AuthService } from '../../services/auth.service'; import { Ng4LoadingSpinnerModule } from 'ng4-loading-spinner'; ...
Below is an extract from a C# program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: Add 1 point if the program contains valid C# code, even if it's not education...
csharp
2
using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using EA; namespace EAcomments { public partial class CommentBrowserWindow : UserControl { ...
Below is an extract from a JavaScript program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid JavaScript code, even if ...
javascript
3
"use strict"; var TestVO_1 = require("./TestVO"); var SimpleInterface_1 = require("./SimpleInterface"); var TestsSprint2b = (function () { function TestsSprint2b() { this.tests = []; } TestsSprint2b.prototype.issue60_defaultMethodParams = function () { var ref = "http://noRef"; var f...
Below is an extract from a Kotlin program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid Kotlin code, even if it's not...
kotlin
2
package com.android.spacework.adapter import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentManager import androidx.fragment.app.FragmentPagerAdapter import com.android.spacework.fragments.CartFragment import com.android.spacework.fragments.HomeFragment class TabAdapter(fm: FragmentManager) : Fra...
Below is an extract from an HTML document. Evaluate whether it has a high educational value and could help teach web development. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the document contains valid HTML markup, even i...
html
4
{% extends "layout.html" %} {% block content %} <div class="container"> <center> <h1> The most danceable song is <font color = #2975a7>{{correct6}}</font>. </h1> <br> <h5> <p>You thought the most danceable song was {{answer6}}.</p> {% if answer6 == correct6 %} ...
Below is an extract from a TypeScript program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid TypeScript code, even if ...
typescript
2
import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; import { AddcontrollerPage } from './addcontroller'; @NgModule({ declarations: [ AddcontrollerPage, ], imports: [ IonicPageModule.forChild(AddcontrollerPage), ], }) export class AddcontrollerPageModule {}
Below is an extract from a Rust program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid Rust code, even if it's not edu...
rust
4
use std::fmt; #[derive(Debug)] pub enum Binary { Short(u8), TwoOctet(u8), Long(u8), } #[derive(Debug)] pub enum Integer { Direct(u8), Byte(u8), Short(u8), Normal, } #[derive(Debug)] pub enum Long { Direct(u8), Byte(u8), Short(u8), Int32, Normal, } #[derive(Debug)] pub...
Below is an extract from a Rust program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid Rust code, even if it's not edu...
rust
2
#[doc = "Register `FILTER` reader"] pub struct R(crate::R<FILTER_SPEC>); impl core::ops::Deref for R { type Target = crate::R<FILTER_SPEC>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } impl From<crate::R<FILTER_SPEC>> for R { #[inline(always)] fn from(reader: crate::R...
Below is an extract from a Rust program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid Rust code, even if it's not edu...
rust
3
use crate::{data::Percentile, receiver::Receiver}; use std::{fmt::Display, hash::Hash, marker::PhantomData, time::Duration}; /// A configuration builder for [`Receiver`]. #[derive(Clone)] pub struct Configuration<T> { metric_type: PhantomData<T>, pub(crate) capacity: usize, pub(crate) batch_size: usize, ...
Below is an extract from a Rust program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid Rust code, even if it's not edu...
rust
1
use std::net::SocketAddr; use std::result::Result::Ok; use futures_util::{future, pin_mut, SinkExt, StreamExt}; use log::*; use tokio::net::{TcpListener, TcpStream}; use tokio::sync; use tokio_socketcan::{CANFrame, CANSocket}; use tokio_tungstenite::tungstenite::Message; use can::CanFrame; mod can; type Sender<T = ...
Below is an extract from a Swift program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid Swift code, even if it's not e...
swift
2
// // PullRequestListViewController.swift // GitHubApp // // Created by <NAME> on 30/12/19. // Copyright © 2019 <NAME>. All rights reserved. // import UIKit final class PullRequestListViewController: UIViewController { private lazy var tableView: UITableView = { let tableView = UITableView() ...
Below is an extract from a Rust program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid Rust code, even if it's not edu...
rust
3
use clap::{ App, Arg }; use std::path::Path; use std::fs::File; use std::io::{BufReader}; use std::collections::HashMap; use serde::Deserialize; use std::error::Error; use serde_json; use csv; #[derive(Deserialize, Clone, PartialEq)] enum Sides { Red, Blue, } #[derive(Deserialize, Clone, PartialEq)] enum Leag...
Below is an extract from a Markdown document. Evaluate its educational value, considering both Markdown usage and the content itself. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the document uses basic Markdown syntax cor...
markdown
2
# MChc 蒙特卡罗法求解热传导方程 ## 请使用MATLAB运行 # bianjietj.csv 基本数据文件 # main.m 主程序文件 # MC_PDE.m 核心函数文件 # MC_PDE_mex.mexw64 核心函数经mex化后文件(使用JIT编译器) # data100s.mat M(掷点数)为100时,所求的数据集 ![求解范例](https://mmbiz.qpic.cn/mmbiz_png/rQQMmyY7EQvTQvWSKsc2stUuib8Mbc36bxUaMiccSPy6Xjb00z3Oic9vakWVDsHVWGKrwEYUnIECpIgO7w1YiaHIXg/640?wx_fmt=p...
Below is an extract from a C++ program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid C++ code, even if it's not educa...
cpp
2
/************************************************************************* > File Name: 39_输出一定数量的偶数.cpp > Author: > Mail: > Created Time: 2019年12月06日 星期五 19时29分01秒 ************************************************************************/ #include<iostream> #include<cstdio> #include<cstring> #include<vector> #i...
Below is an extract from a TypeScript program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid TypeScript code, even if ...
typescript
3
'use strict' import { Socket } from 'net'; import { ServerRequest } from 'http'; import { ModelConfig, Model } from './model/Base'; import parse from './lib/parse'; import * as cookie from 'cookie'; function createVerify(param: { uin: number, skey: string }): () => Promise<boolean> { let hasVerify: boolean; return (...
Below is an extract from a Swift program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid Swift code, even if it's not e...
swift
2
// // UIControl+SignalsTests.swift // Signals // // Created by <NAME> on 1.1.2016. // Copyright © 2016 <NAME>. All rights reserved. // import XCTest import Signals class UIControl_SignalsTests: XCTestCase { func testActionObservation() { let button = UIButton() var onTouchDownCount = 0 ...
Below is an extract from a Markdown document. Evaluate its educational value, considering both Markdown usage and the content itself. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the document uses basic Markdown syntax cor...
markdown
2
# Release History ## 0.5.0 (2022-05-17) ### Breaking Changes - Function `*AttestationsClient.BeginCreateOrUpdateAtSubscription` return value(s) have been changed from `(*armruntime.Poller[AttestationsClientCreateOrUpdateAtSubscriptionResponse], error)` to `(*runtime.Poller[AttestationsClientCreateOrUpdateAtSubscripti...
Below is an extract from a C program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid C code, even if it's not education...
c
3
byte oldKeyPadValues[]={0,0,0,0}; byte newKeyPadValues[]={0,0,0,0}; void setupKeypad(){ // matrix keypad pinMode(keypadOutputClockPin, OUTPUT); // make the clock pin an output pinMode(keypadOutputDataPin , OUTPUT); // make the data pin an output pinMode(ploadPin, OUTPUT); pinMode(clockPin, OUTPUT)...
Below is an extract from a C++ program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid C++ code, even if it's not educa...
cpp
2
#include "game/ui/general/ingameoptions.h" #include "forms/checkbox.h" #include "forms/form.h" #include "forms/label.h" #include "forms/listbox.h" #include "forms/scrollbar.h" #include "forms/textbutton.h" #include "forms/ui.h" #include "framework/configfile.h" #include "framework/data.h" #include "framework/event.h" #...
Below is an extract from a JavaScript program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid JavaScript code, even if ...
javascript
3
class Node { constructor(next, value) { this.next = next this.value = value } } class Stack { constructor() { this.stack = null } push(element) { let head = this.stack let newNode = new Node(null, element) if (!head) { this.stack = newNo...
Below is an extract from a TypeScript program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid TypeScript code, even if ...
typescript
2
import { Action } from 'redux-actions'; import { LOGIN, LOGIN_FAILURE, LOGIN_SUCCESS, UPDATE_PASSWORD, UPDATE_USERNAME } from '../constants/login'; export enum LoginStatus { Failure, Initial, Pending, Success } export function loginReducer(state = { password: '', status: LoginStatus.Initial, username...
Below is an extract from a C program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid C code, even if it's not education...
c
1
#include <stdio.h> #include <cs50.h> #include <math.h> int main() { // get input from user and save it to variable // get sum of all card digits // display result return 0; }
Below is an extract from a PHP program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid PHP code, even if it's not educa...
php
3
<?php namespace GuiaLocaliza\Companies\Admin\Domains\Models\Subcategory; use GuiaLocaliza\Companies\Admin\Domains\Models\Banner\Banner; use GuiaLocaliza\Companies\Admin\Domains\Models\Company\Company; use GuiaLocaliza\Companies\Admin\Domains\Models\Category\Category; use Illuminate\Database\Eloquent\Model; class Sub...
Below is an extract from a Ruby program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion: - Add 1 point if the program contains valid Ruby code, even if it's not edu...
ruby
2
module Crud #to import the module to other files: #same directory: require_relative 'crud' #can use the module through require 'crud' -> This wouldnt work if its in the same directory #in that case, put this before require 'crud' => $LOAD_PATH << "." #in the file that is requiring the module, call Crud.(methods from th...