content stringlengths 263 5.24M | pred_label stringclasses 1
value | pred_score_pos float64 0.6 1 |
|---|---|---|
@testitem "018_how_many_times_HumanEvalPlus_v0_1_9_test.jl" tags=[:HumanEvalPlus_v0_1_9] begin
include(joinpath(ENV["GENERATION_DIR"], "018_how_many_times.jl"))
@test how_many_times("ababa","aba") == 2
@test how_many_times("abcdefg","efg") == 1
@test how_many_times("abababab","aba") == 3
@test how_m... | __label__POS | 0.866035 |
@testitem "083_starts_one_ends_HumanEvalPlus_v0_1_9_test.jl" tags=[:HumanEvalPlus_v0_1_9] begin
include(joinpath(ENV["GENERATION_DIR"], "083_starts_one_ends.jl"))
@test starts_one_ends(6) == 180000
@test starts_one_ends(10) == 1800000000
@test starts_one_ends(12) == 180000000000
@test starts_one_end... | __label__POS | 0.976632 |
@testitem "072_will_it_fly_HumanEvalPlus_v0_1_9_test.jl" tags=[:HumanEvalPlus_v0_1_9] begin
include(joinpath(ENV["GENERATION_DIR"], "072_will_it_fly.jl"))
@test will_it_fly([0],0) == true
@test will_it_fly([1, 2, 1],4) == true
@test will_it_fly([2, 3, 2],7) == true
@test will_it_fly([1],0) == false
... | __label__POS | 0.988612 |
@testitem "117_select_words_HumanEvalPlus_v0_1_9_test.jl" tags=[:HumanEvalPlus_v0_1_9] begin
include(joinpath(ENV["GENERATION_DIR"], "117_select_words.jl"))
@test select_words("apple banana cherry",3) == SubString{String}["apple", "banana"]
@test select_words("random words are fun to write",5) == SubString{... | __label__POS | 0.834491 |
@testitem "141_file_name_check_HumanEvalPlus_v0_1_9_test.jl" tags=[:HumanEvalPlus_v0_1_9] begin
include(joinpath(ENV["GENERATION_DIR"], "141_file_name_check.jl"))
@test file_name_check("example.py") == "No"
@test file_name_check("my.docx") == "No"
@test file_name_check("hello world.exe") == "Yes"
@t... | __label__POS | 0.993889 |
@testitem "159_eat_HumanEvalPlus_v0_1_9_test.jl" tags=[:HumanEvalPlus_v0_1_9] begin
include(joinpath(ENV["GENERATION_DIR"], "159_eat.jl"))
@test eat(0,0,0) == [0, 0]
@test eat(10,0,10) == [10, 10]
@test eat(0,10,5) == [5, 0]
@test eat(5,0,5) == [5, 5]
@test eat(2,2,2) == [4, 0]
@test eat(999... | __label__POS | 0.921532 |
@testitem "086_anti_shuffle_HumanEvalPlus_v0_1_9_test.jl" tags=[:HumanEvalPlus_v0_1_9] begin
include(joinpath(ENV["GENERATION_DIR"], "086_anti_shuffle.jl"))
@test anti_shuffle("12345") == "12345"
@test anti_shuffle("\n\n123 456\n789\n") == "123 456 789"
@test anti_shuffle("Mary had a little lamb") == "M... | __label__POS | 0.930377 |
@testitem "140_fix_spaces_HumanEvalPlus_v0_1_9_test.jl" tags=[:HumanEvalPlus_v0_1_9] begin
include(joinpath(ENV["GENERATION_DIR"], "140_fix_spaces.jl"))
@test fix_spaces("Hello, world!") == "Hello,-world!"
@test fix_spaces("happy 123") == "happy_123"
@test fix_spaces("Hey there!") == "Hey-there!"
... | __label__POS | 0.916299 |
@testitem "049_modp_HumanEvalPlus_v0_1_9_test.jl" tags=[:HumanEvalPlus_v0_1_9] begin
include(joinpath(ENV["GENERATION_DIR"], "049_modp.jl"))
@test modp(5,17) == 15
@test modp(10,23) == 12
@test modp(20,37) == 33
@test modp(50,79) == 73
@test modp(100,89) == 2
@test modp(200,113) == 16
@t... | __label__POS | 0.656736 |
@testitem "066_digitSum_HumanEvalPlus_v0_1_9_test.jl" tags=[:HumanEvalPlus_v0_1_9] begin
include(joinpath(ENV["GENERATION_DIR"], "066_digitSum.jl"))
@test digitSum("123") == 0
@test digitSum("ABCD") == 266
@test digitSum("abcd") == 0
@test digitSum("HELLOworld") == 372
@test digitSum(":;<=>?@[\\... | __label__POS | 0.905313 |
@testitem "008_sum_product_HumanEvalPlus_v0_1_9_test.jl" tags=[:HumanEvalPlus_v0_1_9] begin
include(joinpath(ENV["GENERATION_DIR"], "008_sum_product.jl"))
@test sum_product([2, 4, 6, 8, 10]) == (30, 3840)
@test sum_product([0, 1, 2, 3, 4, 5]) == (15, 0)
@test sum_product([-1, 1, -2, 2, -3, 3]) == (0, -3... | __label__POS | 0.784184 |
@testitem "042_incr_list_HumanEvalPlus_v0_1_9_test.jl" tags=[:HumanEvalPlus_v0_1_9] begin
include(joinpath(ENV["GENERATION_DIR"], "042_incr_list.jl"))
@test incr_list([100, 200, 300, 400, 500]) == [101, 201, 301, 401, 501]
@test incr_list([-1, -2, -3, -4, -5]) == [0, -1, -2, -3, -4]
@test incr_list([0, ... | __label__POS | 0.743051 |
@testitem "093_encode_swap_HumanEvalPlus_v0_1_9_test.jl" tags=[:HumanEvalPlus_v0_1_9] begin
include(joinpath(ENV["GENERATION_DIR"], "093_encode_swap.jl"))
@test encode_swap("abcdefghijklmnopqrstuvwxyz") == "CBCDGFGHKJKLMNQPQRSTWVWXYZ"
@test encode_swap("ZYXWVUTSRQPONMLKJIHGFEDCBA") == "zyxwvwtsrqpqnmlkjkhgf... | __label__POS | 0.696665 |
@testitem "131_count_digits_HumanEvalPlus_v0_1_9_test.jl" tags=[:HumanEvalPlus_v0_1_9] begin
include(joinpath(ENV["GENERATION_DIR"], "131_count_digits.jl"))
@test count_digits(951) == 45
@test count_digits(246) == 0
@test count_digits(135797531) == 99225
@test count_digits(888) == 0
@test count_... | __label__POS | 0.87288 |
@testitem "127_intersection_HumanEvalPlus_v0_1_9_test.jl" tags=[:HumanEvalPlus_v0_1_9] begin
include(joinpath(ENV["GENERATION_DIR"], "127_intersection.jl"))
@test intersection([0, 0],[0, 1]) == "NO"
@test intersection([10, 20],[15, 25]) == "YES"
@test intersection([-15, 15],[-10, 10]) == "NO"
@test ... | __label__POS | 0.869898 |
@testitem "048_is_palindrome_HumanEvalPlus_v0_1_9_test.jl" tags=[:HumanEvalPlus_v0_1_9] begin
include(joinpath(ENV["GENERATION_DIR"], "048_is_palindrome.jl"))
@test is_palindrome("a") == true
@test is_palindrome("ab") == false
@test is_palindrome("abc") == false
@test is_palindrome("abca") == false
... | __label__POS | 0.955808 |
@testitem "128_prod_signs_HumanEvalPlus_v0_1_9_test.jl" tags=[:HumanEvalPlus_v0_1_9] begin
include(joinpath(ENV["GENERATION_DIR"], "128_prod_signs.jl"))
@test prod_signs([0, 0, 0, 0]) == 0
@test prod_signs([-1, -2, -2, -4]) == 9
@test prod_signs([-1, 0, 1, 2]) == 0
@test prod_signs([-2, -2, -2, 4]) ... | __label__POS | 0.769335 |
@testitem "107_even_odd_palindrome_HumanEvalPlus_v0_1_9_test.jl" tags=[:HumanEvalPlus_v0_1_9] begin
include(joinpath(ENV["GENERATION_DIR"], "107_even_odd_palindrome.jl"))
@test even_odd_palindrome(1000) == (48, 60)
@test even_odd_palindrome(500) == (28, 30)
@test even_odd_palindrome(777) == (38, 48)
... | __label__POS | 0.872469 |
@testitem "129_min_path_HumanEvalPlus_v0_1_9_test.jl" tags=[:HumanEvalPlus_v0_1_9] begin
include(joinpath(ENV["GENERATION_DIR"], "129_min_path.jl"))
@test min_path([[1, 2, 3], [4, 5, 6], [7, 8, 9]],1) == [1]
@test min_path([[1, 2, 3], [4, 5, 6], [7, 8, 9]],9) == [1, 2, 1, 2, 1, 2, 1, 2, 1]
@test min_pat... | __label__POS | 0.998049 |
@testitem "032_find_zero_HumanEvalPlus_v0_1_9_test.jl" tags=[:HumanEvalPlus_v0_1_9] begin
include(joinpath(ENV["GENERATION_DIR"], "032_find_zero.jl"))
@test isapprox(find_zero([5, 10, -3, 1]), -0.4350002948524824, atol=0.0001)
@test isapprox(find_zero([1, -20, 156, -864, 2667, -4392, 3744, -1440]), 0.087650... | __label__POS | 0.601494 |
@testitem "058_common_HumanEvalPlus_v0_1_9_test.jl" tags=[:HumanEvalPlus_v0_1_9] begin
include(joinpath(ENV["GENERATION_DIR"], "058_common.jl"))
@test common([1, 2, 3],[1, 2, 3]) == [1, 2, 3]
@test common(Union{}[],[1, 2, 3]) == Int64[]
@test common([1, 2, 3],Union{}[]) == Int64[]
@test common(Union... | __label__POS | 0.981441 |
@testitem "137_compare_one_HumanEvalPlus_v0_1_9_test.jl" tags=[:HumanEvalPlus_v0_1_9] begin
include(joinpath(ENV["GENERATION_DIR"], "137_compare_one.jl"))
@test compare_one(3,3) == nothing
@test compare_one(-1,-1) == nothing
@test compare_one(0,0) == nothing
@test compare_one(-2.5,2.5) == 2.5
@t... | __label__POS | 0.910337 |
@testitem "115_max_fill_HumanEvalPlus_v0_1_9_test.jl" tags=[:HumanEvalPlus_v0_1_9] begin
include(joinpath(ENV["GENERATION_DIR"], "115_max_fill.jl"))
@test max_fill([[1, 0, 0, 1], [0, 1, 1, 1], [0, 0, 0, 0], [1, 0, 1, 1]],2) == 5
@test max_fill([[1, 1, 1], [1, 0, 1], [1, 1, 1], [1, 1, 1]],3) == 4
@test m... | __label__POS | 0.850653 |
@testitem "102_choose_num_HumanEvalPlus_v0_1_9_test.jl" tags=[:HumanEvalPlus_v0_1_9] begin
include(joinpath(ENV["GENERATION_DIR"], "102_choose_num.jl"))
@test choose_num(20,30) == 30
@test choose_num(30,30) == 30
@test choose_num(50,60) == 60
@test choose_num(12,14) == 14
@test choose_num(10,12)... | __label__POS | 0.981075 |
@testitem "112_reverse_delete_HumanEvalPlus_v0_1_9_test.jl" tags=[:HumanEvalPlus_v0_1_9] begin
include(joinpath(ENV["GENERATION_DIR"], "112_reverse_delete.jl"))
@test reverse_delete("racecar","ace") == ("rr", true)
@test reverse_delete("level","ve") == ("ll", true)
@test reverse_delete("noon","on") == (... | __label__POS | 0.620287 |
@testitem "109_move_one_ball_HumanEvalPlus_v0_1_9_test.jl" tags=[:HumanEvalPlus_v0_1_9] begin
include(joinpath(ENV["GENERATION_DIR"], "109_move_one_ball.jl"))
@test move_one_ball([1]) == true
@test move_one_ball([5, 6, 7, 8, 1, 2, 3, 4]) == true
@test move_one_ball([1, 2, 3, 4, 5, 6, 7, 8]) == true
... | __label__POS | 0.932899 |
@testitem "105_by_length_HumanEvalPlus_v0_1_9_test.jl" tags=[:HumanEvalPlus_v0_1_9] begin
include(joinpath(ENV["GENERATION_DIR"], "105_by_length.jl"))
@test by_length([9, 8, 7, 6, 5, 4, 3, 2, 1]) == ["Nine", "Eight", "Seven", "Six", "Five", "Four", "Three", "Two", "One"]
@test by_length([-1, 0, 5, 6, 10]) =... | __label__POS | 0.733608 |
@testitem "069_search.jl" tags=[:HumanEval] begin
include(joinpath(ENV["GENERATION_DIR"], "069_search.jl"))
# manually generated tests
@test search([5, 5, 5, 5, 1]) == 1
@test search([4, 1, 4, 1, 4, 4]) == 4
@test search([3, 3]) == -1
@test search([8, 8, 8, 8, 8, 8, 8, 8]) == 8
@test searc... | __label__POS | 0.974524 |
@testitem "063_fibfib.jl" tags=[:HumanEval] begin
include(joinpath(ENV["GENERATION_DIR"], "063_fibfib.jl"))
@test fibfib(1) == 0
@test fibfib(2) == 1
@test fibfib(3) == 1
@test fibfib(4) == 2
@test fibfib(5) == 4
@test fibfib(6) == 7
@test fibfib(7) == 13
@test fibfib(8) == 24
... | __label__POS | 0.681216 |
@testitem "153_strongest_extension.jl" tags=[:HumanEval] begin
include(joinpath(ENV["GENERATION_DIR"], "153_strongest_extension.jl"))
# Check some simple cases
@test strongest_extension("Watashi", ["tEN", "niNE", "eIGHt8OKe"]) == "Watashi.eIGHt8OKe"
@test strongest_extension("Boku123", ["nani", "NazeD... | __label__POS | 0.734971 |
@testitem "129_min_path.jl" tags=[:HumanEval] begin
include(joinpath(ENV["GENERATION_DIR"], "129_min_path.jl"))
# Check some simple cases
@test min_path([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 3) == [1, 2, 1]
@test min_path([[5, 9, 3], [4, 1, 6], [7, 8, 2]], 1) == [1]
@test min_path([[1, 2, 3, 4], [5, ... | __label__POS | 0.993984 |
@testitem "141_file_name_check.jl" tags=[:HumanEval] begin
include(joinpath(ENV["GENERATION_DIR"], "141_file_name_check.jl"))
# Check some simple cases
@test file_name_check("example.txt") == "Yes"
@test file_name_check("1example.dll") == "No"
@test file_name_check("s1sdf3.asd") == "No"
@test ... | __label__POS | 0.977614 |
"""
pluck(xs::Vector{Int})::Vector{Int}
Given an array representing a branch of a tree that has non-negative integer
nodes your task is to pluck one of the nodes and return it. The plucked node
should be the node with the smallest even value. If multiple nodes with the same
smallest even value are found return the... | __label__POS | 0.987086 |
"""
get_odd_collatz(n::Int)::Vector{BigInt}
Given a positive integer `n`, return a sorted list that has the odd numbers in
collatz sequence.
The Collatz conjecture is a conjecture in mathematics that concerns a sequence
defined as follows: start with any positive integer n. Then each term is
obtained from the pre... | __label__POS | 0.998141 |
"""
bf(planet1::String, planet2::String)::NTuple
There are eight planets in our solar system: the closerst to the Sun is Mercury,
the next one is Venus, then Earth, Mars, Jupiter, Saturn, Uranus, Neptune. Write
a function that takes two planet names as strings `planet1` and `planet2`. The
function should return a ... | __label__POS | 0.886131 |
"""
skjkasdkd(xs::Vector{Int})::Int
You are given a list of integers. You need to find the largest prime value and
return the sum of its digits.
# Examples
```jldoctest
julia> skjkasdkd([0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3])
10
julia> skjkasdkd([1, 0, 1, 8, 2, 4597, 2, 1, 3, ... | __label__POS | 0.996813 |
"""
select_words(s::String, n::Int)::Vector{<:AbstractString}
Given a string `s` and a natural number `n`, you have been tasked to implement a
function that returns a list of all words from string `s` that contain exactly
`n` consonants, in order these words appear in the string `s`. If the string `s`
is empty the... | __label__POS | 0.998943 |
"""
separate_paren_groups(paren_string::String)::Vector{String}
Input to this function is a string containing multiple groups of nested
parentheses. Your goal is to separate those group into separate strings and
return the list of those. Separate groups are balanced (each open brace is
properly closed) and not nes... | __label__POS | 0.98919 |
"""
move_one_ball(xs::Vector{Int})::Bool
We have an array `xs` of N integers xs[1], xs[2], ..., xs[N].The numbers in the
array will be randomly ordered. Your task is to determine if it is possible to
get an array sorted in non-decreasing order by performing the following
operation on the given array: You are allow... | __label__POS | 0.985086 |
"""
eat(number::Int, need::Int, remaining::Int)::Vector{Int}
You're a hungry rabbit, and you already have eaten a certain number of carrots,
but now you need to eat more carrots to complete the day's meals. you should
return an array of [ total number of eaten carrots after your meals, the number
of carrots left a... | __label__POS | 0.995514 |
"""
by_length(xs::Vector{Int})::Vector{String}
Given an array of integers, sort the integers that are between 1 and 9
inclusive, reverse the resulting array, and then replace each digit by its
corresponding name from "One", "Two", "Three", "Four", "Five", "Six", "Seven",
"Eight", "Nine".
If the array is empty, re... | __label__POS | 0.985655 |
"""
get_row(xs::Vector{Vector{Int}}, x::Int)::Vector{Tuple{Int, Int}}
You are given a 2 dimensional data, as a nested lists, which is similar to
matrix, however, unlike matrices, each row may contain a different number of
columns. Given `xs`, and integer `x`, find integers `x` in the list `xs`, and
return list of ... | __label__POS | 0.968103 |
"""
match_parens(lst::Vector{String})::String
You are given a list of two strings, both strings consist of open parentheses
"(" or close parentheses ")" only. Your job is to check if it is possible to
concatenate the two strings in some order, that the resulting string will be
good. A string S is considered to be ... | __label__POS | 0.996458 |
"""
even_odd_palindrome(n::Int)::Tuple{Int, Int}
Given a positive integer n, return a tuple that has the number of even and odd
integer palindromes that fall within the range(1, n), inclusive.
!!! note
1. 1 <= n <= 10^3
2. returned tuple has the number of even and odd integer palindromes respectively.
... | __label__POS | 0.997778 |
"""
intersection(interval1::Vector{Int}, interval2::Vector{Int})::String
You are given two intervals, where each interval is a pair of integers. For
example, interval = (start, end) = (1, 2). The given intervals are closed which
means that the interval (start, end) includes both start and end. For each given
inter... | __label__POS | 0.999941 |
"""
min_path(grid::Vector{Vector{Int}}, k::Int)::Vector{Int}
Given a grid with `N` rows and `N` columns (`N >= 2`) and a positive integer
`k`, each cell of the grid contains a value. Every integer in the range `[1, N * N]` inclusive appears exactly once on the cells of the grid.
You have to find the minimum path ... | __label__POS | 0.999214 |
/** holy_wrapper
*
* Author : BRH
* Project : Holy Core V2
* Description : Second wrapper for vivado, serves as plain verilog top module.
* (Suitable for all targets)
*/
module holy_wrapper (
input wire clk,
input wire rst_n,
input wire aclk,
input wire aresetn,
// AXI FULL interface
o... | __label__POS | 0.777486 |
/** holy_top
*
* Author : BRH
* Project : Holy Core V2
* Description : Second wrapper for vivado, serves as plain verilog top module.
* (Suitable for all targets)
*/
module top #(
)(
input wire clk,
input wire rst_n,
input wire periph_rst_n,
// AXI FULL interface
output wire [3:0] ... | __label__POS | 0.705283 |
#include <stdint.h>
#include "holycore.h"
#include "holy_core_soc.h"
#define SCREEN_WIDTH 20
#define SCREEN_HEIGHT 10
int ball_x = 1;
int ball_y = 1;
// int ball_dx = 1;
// int ball_dy = 1;
// int paddle_y = SCREEN_HEIGHT / 2;
void draw_char(int x, int y, char c) {
uart_putchar(27); // ESC
uart_putchar('... | __label__POS | 0.856989 |
#include <stdint.h>
#include <stddef.h>
#include "holycore.h"
#define BMP280_I2C_ADDR (uint8_t)0x77
/*
NOTES :
100h => Control
104h => Sattus
108h => TX_FIFO
10Ch => RX_FIFO
*/
int main() {
uart_puts("Initializing AXI IIC IP...\n\r");
config_i2c_core();
uart_puts("Config done ! Sending IIR filter ... | __label__POS | 0.926631 |
#include "StdAfx.h"
#include "WHIniData.h"
#include "WHEncrypt.h"
//////////////////////////////////////////////////////////////////////////////////
//캯
CWHIniData::CWHIniData()
{
//ñ
ZeroMemory(m_szIniFile,sizeof(m_szIniFile));
return;
}
//
CWHIniData::~CWHIniData()
{
}
//·
VOID CWHIniData::SetIniFilePath(LPCT... | __label__POS | 0.702483 |
#include "StdAfx.h"
#include "WHCommandLine.h"
//////////////////////////////////////////////////////////////////////////////////
//캯
CWHCommandLine::CWHCommandLine()
{
}
//
CWHCommandLine::~CWHCommandLine()
{
}
//ѯ
bool CWHCommandLine::SearchCommandItem(LPCTSTR pszCommandLine, LPCTSTR pszCommand, TCHAR szParameter... | __label__POS | 0.855647 |
#include "StdAfx.h"
#include "ProcessDataControl.h"
//////////////////////////////////////////////////////////////////////////////////
//
#define IDT_IMMEDIATE 0x0101 //ͬ
#define IDT_ASYNCHRONISM 0x0201 //첽
//////////////////////////////////////////////////////////////////////////////////
//
CPro... | __label__POS | 0.739197 |
#ifndef INIR_PARAMETER_HEAD_FILE
#define INIR_PARAMETER_HEAD_FILE
#pragma once
#include "Stdafx.h"
//////////////////////////////////////////////////////////////////////////////////
//ò
class CInitParameter
{
//ϵͳ
public:
BYTE m_cbDelayList; //ʱб
WORD m_wMaxConnect; //
WORD m_wServic... | __label__POS | 0.996641 |
#include "StdAfx.h"
#include "ServiceUnits.h"
#include "ControlPacket.h"
//////////////////////////////////////////////////////////////////////////////////
//̬
CServiceUnits * CServiceUnits::g_pServiceUnits=NULL; //ָ
//////////////////////////////////////////////////////////////////////////////////
BEGIN_MESSAG... | __label__POS | 0.932389 |
#ifndef SERVER_LIST_MANAGER_HEAD_FILE
#define SERVER_LIST_MANAGER_HEAD_FILE
#pragma once
#include "Stdafx.h"
#include "AfxTempl.h"
//////////////////////////////////////////////////////////////////////////////////
//б
namespace NServerListManager
{
/////////////////////////////////////////////////////////////////... | __label__POS | 0.704472 |
#include "StdAfx.h"
#include "DataBaseAide.h"
#include "DataBase.h"
//캯
CDataBaseAide::CDataBaseAide(IUnknownEx * pIUnknownEx)
{
}
//
CDataBaseAide::~CDataBaseAide()
{
}
bool CDataBaseAide::SetDataBase(IUnknownEx *pIUnKnownEx)
{
m_pIDataBase = (IDataBase *)pIUnKnownEx;
if (m_pIDataBase != NULL)
return true;
else... | __label__POS | 0.761976 |
#pragma once
#include "RGS/Base/Maths.h"
#include "RGS/Render/Framebuffer.h"
#include <string>
#include <vector>
namespace RGS {
class Texture
{
public:
Texture(const std::string& path);
Texture(const Framebuffer& framebuffer);
~Texture();
Vec4 Sample(const Vec2 texCoords... | __label__POS | 0.950216 |
using System;
using System.Diagnostics.CodeAnalysis;
using WinterspringLauncher.Utils;
namespace WinterspringLauncher;
public static class LauncherVersion
{
public static string ShortVersionString
{
get
{
string version = GitVersionInformation.MajorMinorPatch;
if (Git... | __label__POS | 0.817627 |
using System;
using System.IO;
namespace WinterspringLauncher.Utils;
public static class DirectoryCopy
{
public static void Copy(string sourceDirectory, string targetDirectory)
{
DirectoryInfo diSource = new DirectoryInfo(sourceDirectory);
DirectoryInfo diTarget = new DirectoryInfo(targetDire... | __label__POS | 0.999062 |
using System;
using System.Collections.Generic;
using System.Data;
using System.Net;
using System.Net.Http;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace WinterspringLauncher.Utils;
public static class GitHubApi
{
public static string GitHubApiAddress { get; set; } = "https://api.github... | __label__POS | 0.929351 |
using System;
using System.IO;
using System.Security.Cryptography;
using System.Text;
namespace WinterspringLauncher.Utils;
public class HashHelper
{
public static string CreateHexSha256HashFromFilename(string filePath)
{
using (FileStream stream = new FileStream(filePath, FileMode.Open, FileAccess.R... | __label__POS | 0.998773 |
using System;
using System.Data;
using System.Net.Http;
using System.Text.Json;
namespace WinterspringLauncher.Utils;
public static class SimpleFileDownloader
{
public static string PerformGetStringRequest(string url)
{
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Us... | __label__POS | 0.914632 |
import java.io.*;
import java.net.Socket;
public class TectonicClient {
private static final byte SUCCESS_BYTE = 0x1;
private Socket conn;
private String host;
private String port;
private String currentDB;
public TectonicClient(String host, String port) throws IOException {
this.host... | __label__POS | 0.898965 |
import { DBUpdate } from './typings';
import TectonicDB, { SocketQuery, TectonicResponse } from './tectonic';
export default class TectonicPool {
threads: number;
port: number;
address: string;
sockets: TectonicDB[];
count: number;
constructor(threads?: number, port?: number, address?: string);
... | __label__POS | 0.864101 |
using System.ClientModel;
using System.ClientModel.Primitives;
using DurableMultiAgentTemplate.Agent;
using DurableMultiAgentTemplate.Agent.Orchestrator;
using DurableMultiAgentTemplate.Agent.Synthesizer;
using DurableMultiAgentTemplate.Model;
using DurableMultiAgentTemplate.Shared.Model;
using Microsoft.Extensions.Lo... | __label__POS | 0.896758 |
using DurableMultiAgentTemplate.Json;
using DurableMultiAgentTemplate.Model;
using OpenAI.Chat;
namespace DurableMultiAgentTemplate.Agent;
/// <summary>
/// Class providing agent definitions.
/// Defines the functionality, descriptions, and parameters for each agent.
/// </summary>
//https://learn.microsoft.com/ja-jp... | __label__POS | 0.870376 |
---
nav_order: 2
title: list
parent: Library Documentation
---
# list.ml
A simple linked list implementation.
## Definitions
### Types
```haskell
data List a
= Cons a (List a)
| Nil
```
> The default list type generated<br>
> by `[...]`
### Creating lists
```haskell
range : Number -> Number -> List Number
`... | __label__POS | 0.907198 |
#!/usr/bin/env ruby
require 'eventmachine-distributed-notification'
require 'json'
require 'active_support/core_ext/string/inflections'
Encoding.default_external = Encoding::UTF_8
class Hash
def to_utf8
Hash[
self.collect do |k, v|
if (v.respond_to?(:to_utf8))
[ k, v.to_utf8 ]
... | __label__POS | 0.748527 |
(* Copyright (C) 2013, Thomas Leonard
* See the README file for details, or visit http://0install.net.
*)
(** Manages the process of downloading feeds during a solve.
We use the solver to get the current best solution and the set of feeds it queried.
We download any missing feeds and update any out-of-date o... | __label__POS | 0.662435 |
#include "u.h"
#include "../port/lib.h"
#include "mem.h"
#include "dat.h"
#include "fns.h"
#include "../port/error.h"
static char Ebadlogctl[] = "unknown log ctl message";
void
logopen(Log *alog)
{
lock(alog);
if(waserror()){
unlock(alog);
nexterror();
}
if(alog->opens == 0){
if(alog->nlog == 0)
alog->nl... | __label__POS | 0.95251 |
#include <u.h>
#include <libc.h>
#include <../boot/boot.h>
int
plumb(char *dir, char *dest, int *efd, char *here)
{
char buf[128];
char name[128];
int n;
sprint(name, "%s/clone", dir);
efd[0] = open(name, ORDWR);
if(efd[0] < 0)
return -1;
n = read(efd[0], buf, sizeof(buf)-1);
if(n < 0){
close(efd[0]);
r... | __label__POS | 0.999154 |
#include <u.h>
#include <libc.h>
#include <../boot/boot.h>
uchar statbuf[Statsz];
int
cache(int fd)
{
int argc, i, p[2];
char *argv[5], bd[32], buf[256], partition[64], *pp;
if(stat("/boot/cfs", statbuf, sizeof statbuf) < 0)
return fd;
*partition = 0;
readfile("#e/cfs", buf, sizeof(buf));
if(*buf){
argc ... | __label__POS | 0.92922 |
#include <u.h>
#include <libc.h>
#include <auth.h>
#include <fcall.h>
#include "../boot/boot.h"
static long lusertime(char*);
char *timeserver = "#s/boot";
void
settime(int islocal, int afd, char *rp)
{
int n, f;
int timeset;
Dir dir[2];
char timebuf[64];
print("time...");
timeset = 0;
if(islocal){
/*
*... | __label__POS | 0.672398 |
#include "u.h"
#include "../port/lib.h"
#include "mem.h"
#include "dat.h"
#include "fns.h"
#include "io.h"
#include "../port/error.h"
typedef union Hblock Hblock;
#define TBLOCK 512
#define NAMSIZ 100
union Hblock
{
char dummy[TBLOCK];
struct header
{
char name[NAMSIZ];
char mode[8];
char uid[8];
char gid[... | __label__POS | 0.753608 |
import { TRAAEffect } from "./traa/TRAAEffect"
import { SSGIEffect } from "./ssgi/SSGIEffect"
import { SSREffect } from "./ssgi/SSREffect"
import { MotionBlurEffect } from "./motion-blur/MotionBlurEffect"
import { VelocityDepthNormalPass } from "./temporal-reproject/pass/VelocityDepthNormalPass"
import { VelocityPass ... | __label__POS | 0.682348 |
#include "dat.h"
#include <assert.h>
#include <bio.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include "fns.h"
static void
splice(Item *i) {
if(i->next != nil)
i->next->prev = i->prev;
if(i->prev != nil)
i->prev->next = i->next;
}
char*
history_search(int dir, char *string, int n) {
Item *i;... | __label__POS | 0.623969 |
#include "dat.h"
#include <ctype.h>
#include <strings.h>
#include <unistd.h>
#include "fns.h"
typedef struct Key Key;
struct Key {
Key* next;
long mask;
char* key;
char** action;
};
static Key* bindings;
static int numlock;
/*
* To do: Find my red black tree implementation.
*/
void
parse_keys(char *spec) {
s... | __label__POS | 0.655946 |
#include "dat.h"
#include <ctype.h>
#include <string.h>
#include "fns.h"
static int
iswordrune(Rune r) {
if(isalpharune(r))
return 1;
return r < 0x80 && (r == '_' || isdigit(r));
}
static char*
prev_rune(char *start, char *p, Rune *r) {
*r = 0;
if(p == start)
return p;
while(p > start && (*(--p)&0xC0) == 0x... | __label__POS | 0.686965 |
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
#include "bele.h"
#include "elf.h"
#include "dat.h"
#include "fns.h"
static int verbose;
typedef struct Data Data;
typedef struct Class Class;
struct Data {
int type;
char *name;
unsigned int (*get8)(void*, uint8... | __label__POS | 0.912504 |
<?xml version="1.0" ?>
<interface xmlns="http://zero-install.sourceforge.net/2004/injector/interface" uri="https://apps.0install.net/javascript/node.xml">
<name>Node.js</name>
<summary>open-source, cross-platform JavaScript runtime environment</summary>
<description>Node.js is a JavaScript runtime built on Chrome... | __label__POS | 0.880942 |
#include "taskimpl.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <sys/poll.h>
#include "ip.h"
static int
family(unsigned char *addr)
{
if(isv4(addr))
return AF_INET;
return AF_INET6;
}
int
netannounce(int istcp... | __label__POS | 0.933857 |
#include "taskimpl.h"
/*
* locking
*/
static int
_qlock(QLock *l, int block)
{
if(l->owner == nil){
l->owner = taskrunning;
return 1;
}
if(!block)
return 0;
addtask(&l->waiting, taskrunning);
taskstate("qlock");
taskswitch();
if(l->owner != taskrunning){
fprint(2, "qlock: owner=%p self=%p oops\n", l->... | __label__POS | 0.659693 |
#!/bin/bash
# shellcheck disable=SC2059
now=$(date +"%T")
g='\033[0;32m'
c='\033[0m'
log_file="autovod_installation.log"
# Log all the outputs of the script to the log file
exec &> >(tee -a "$log_file")
# Check if apt or dnf is installed
if command -v apt-get &>/dev/null; then
package_manager='apt-get'
install_c... | __label__POS | 0.617047 |
package newagent;
import common.CommonUtil;
import com.google.gson.Gson;
import entity.JvmInfo;
import java.io.File;
import java.lang.instrument.Instrumentation;
import java.text.SimpleDateFormat;
import java.util.Date;
public class HookMain {
/**
* 加载的框架
* @param args
* @param inst
*/
p... | __label__POS | 0.91282 |
package newagent;
import com.google.gson.Gson;
import common.CommonUtil;
import entity.JvmInfo;
import entity.RunUserInfo;
import com.sun.tools.attach.VirtualMachine;
import com.sun.tools.attach.VirtualMachineDescriptor;
import entity.ResultInfo;
import maven.MavenHandle;
import org.apache.commons.io.FileUtils;
import... | __label__POS | 0.806548 |
package maven;
import common.CommonUtil;
import entity.DependencyInfo;
import entity.JvmInfo;
import org.springframework.boot.loader.jar.Handler;
import java.util.*;
/**
* @author fate
* @date 2019-11-08 上午12:31
* 从jvm实例中构建pom.xml
*/
public class MavenHandle extends Handler {
/**
* 获取jar读取到的依赖 用于针对于应用的... | __label__POS | 0.998955 |
package maven;
import common.CommonUtil;
import entity.DependencyInfo;
import org.springframework.boot.loader.jar.JarFile; // 偷懒 直接使用springboot的
import java.io.File;
import java.util.Enumeration;
import java.util.List;
import java.util.Properties;
import java.util.jar.JarEntry;
/**
* @author fate
* @date 2019-11-22 ... | __label__POS | 0.996665 |
package maven;
import common.CommonUtil;
import entity.DependencyInfo;
import java.io.File;
import java.util.Enumeration;
import java.util.List;
import java.util.Properties;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
/**
* @author fate
* @date 2019-11-22 下午12:05
*/
public class EasyJarHandle {
... | __label__POS | 0.996957 |
package runuser;
import common.CommonUtil;
import entity.RunUserInfo;
import java.io.*;
import java.util.ArrayList;
import java.util.List;
/**
* 主要用于多用户的处理
*/
public class RunHandle {
/**
* 获取运行的结果 封装了处理多路径的情况
* @return
*/
public static List<RunUserInfo> getUser() {
// 实测发现有的linux版... | __label__POS | 0.957869 |
local iChapterNum = 33
local tChapterName =
{
"Getting Started",
"Interlude: The Eight-Queen Puzzle",
"Numbers",
"Strings",
"Tables",
"Functions",
"The External World",
"Filling Some Gaps",
"Closures",
"Pattern Matching",
"Interlude: Most Frequent Words",
"Date and Time",
"Bits and Bytes",
"Data Structure... | __label__POS | 0.699699 |
# Lua代码规范
撰写人员|时间|用途
-|:-|:-
kk47|2019-10-29|规范代码,提高开发效率,减少踩坑
## 命名
* #### 类和文件命名
驼峰式命名,类和文件命名最好一致,单词首字母大写,按照[模块]+[功能]+[基础类型] (Race+Shop+UI = RaceShopUI)
类似如下代码不应出现,一个类名至少要一眼看过去就能了解它的基本功能
```Lua
local MainView = class("MainView", require("UI/GameUI/Base/UIBase")) --不好的命名
local RaceShopUI = class("RaceSh... | __label__POS | 0.937773 |
---练习1.1 运行阶乘的实例并观察,如果输入的是负数,程序会出现什么问题?试着修改代码来解决问题
-- 输入负数程序会无限递归至栈溢出
-- 修改
local function fact(n)
if n < 0 then
print("invalid n")
return
end
if n == 0 then
return 1
else
return n * fact(n - 1)
end
end
--fact(-1)
---练习1.2 分别使用 -i 参数和 dofile 加载脚本并运行twice示例,你更喜欢哪种方式... | __label__POS | 0.965821 |
local geometry = {}
local function disk(cx,cy,r)
return function(x , y)
return ( x - cx) ^ 2 + (y - cy) ^ 2 <= r ^ 2
end
end
local function rect(left,right,bottom,up)
return function(x,y)
return left <= x and x <= right and bottom <= y and y <= up
end
end
local function complement(r)
... | __label__POS | 0.999936 |
---练习8.1 大多数C语法风格的编程语言都不支持elseif结构,为什么Lua比这些语言更需要这种结构?
--其他语言基本都有else if 和 switch 。
--个人认为Lua为了精简语法将else if 和 switch整合到一起形成了elseif。
---练习8.2 描述Lua语言中实现无条件循环的4种不同方法。你更喜欢哪一种?
--1
--while true do print("loop1") end
--2
-- for i = 1,math.huge do
-- print("loop2")
-- end
--3
-- ::loop::
-- print("loop3")
-- goto l... | __label__POS | 0.99828 |
---练习11.1 当我们对一段文本执行统计单词出现频率的程序时,结果常常是一些注入冠词和介词之类的没有太多意义
---的短词汇。请改写该程序,使他忽略长度小于4个字母的单词
---练习11.2 重复上面的练习,除了按照长度忽略单词外,该程序还能从一个文本文件中读取要忽略的单词列表。
local ignore = {}
for line in io.lines("ignorewords.txt") do
for word in string.gmatch(line,"%w+") do
ignore[word] = true
end
end
local counter = {}
for lin... | __label__POS | 0.998554 |
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include <stdlib.h>
extern "C"
{
#include "../lua_src/lua.h"
#include "../lua_src/lauxlib.h"
#include "../lua_src/lualib.h"
}
static int summation(lua_State* L) //Exercise 29.1
{
lua_Number sum = 0;
int n = lua_gettop(L);
for(int i = 1;i <=n; i++)
... | __label__POS | 0.893428 |
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
extern "C"
{
#include "../lua_src/lua.h"
#include "../lua_src/lauxlib.h"
#include "../lua_src/lualib.h"
}
void error(lua_State *L, const char *fmt,...)
{
va_list argp;
va_start(argp, fmt);
vfprintf(stderr, fmt, argp);
va_end(argp);
lua_clos... | __label__POS | 0.722273 |
---Exercise 25.1: Adapt getvarvalue (Figure 25.1, “Getting the value of a variable”) to work with different coroutines (like the functions from the debug library).
function co_getvarvalue (co,name, level, isenv)
if type(co) ~= "thread" then
co = coroutine.running()
end
local value
local found = ... | __label__POS | 0.674757 |
--Example Set
local Set = {}
local mt = nil
function Set.new(l)
local newSet = {}
mt = mt or {__add = Set.union ,
__tostring = Set.tostring ,
__sub = Set.difference,
__len = Set.size,
__metatable = "not your business"
}
setmetatable(newSet... | __label__POS | 0.932884 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.