language
stringclasses
15 values
src_encoding
stringclasses
34 values
length_bytes
int64
6
7.85M
score
float64
1.5
5.69
int_score
int64
2
5
detected_licenses
listlengths
0
160
license_type
stringclasses
2 values
text
stringlengths
9
7.85M
Markdown
UTF-8
1,340
2.78125
3
[ "MIT" ]
permissive
RedPencil ========= Red Pencil Kata For up to date tasks check out the trello board https://trello.com/b/6ruhJ5FV/red-pencil-kata #User stories ####~~A red pencil promotion starts due to a price reduction. The price has to be reduced by at least 5% but at most bei 30% and the previous price had to be stable for at ...
SQL
UTF-8
2,981
3.6875
4
[]
no_license
--- public.aluno CREATE TABLE public.aluno ( id serial NOT NULL, nome character varying(100) NOT NULL, data_nascimento date NOT NULL, created_at timestamp, updated_at timestamp, deleted_at timestamp, PRIMARY KEY (id) ); INSERT INTO public.aluno (nome, data_nascimento, created_at) VALUES ('Yuri ...
C++
UTF-8
4,267
2.546875
3
[ "MIT" ]
permissive
/* * Copyright (C) 2014 Pavel Kirienko <pavel.kirienko@gmail.com> */ #pragma once #include <uavcan/time.hpp> #include <uavcan/protocol/debug/LogMessage.hpp> #include <uavcan/marshal/char_array_formatter.hpp> #include <uavcan/node/publisher.hpp> #if !defined(UAVCAN_CPP_VERSION) || !defined(UAVCAN_CPP11) # error UAV...
Python
UTF-8
834
4.09375
4
[]
no_license
""" There are also some special attributes that begins with double underscore (__). For example: __doc__ attribute. It is used to fetch the docstring of that class. When we define a class, a new class object is created with the same class name. This new class object provides a facility to access the differe...
Markdown
UTF-8
9,711
3.28125
3
[]
no_license
# 第三章:出类拔萃-中级篇 ## 3.1 二分搜索 * lower\_bound * 假定一个解并判断是否可行 * POJ 1064 Cable Master 有N条绳子,它们的长度分别为Li。如果从他们中切割出K条长度相同的绳子的话,这K条绳子每条能有多长?答案保留小数点后两位。 用二分法来判断中间的解是否可行,然后缩小解区间。 * 最大化最小值 * POJ 2456 Aggressive cows 有N间牛舍的小屋。牛舍排在一条直线上,第i号牛舍在xi的位置。有m头牛,将每头牛都放在离其他牛就可能远的牛舍。也就是要最大化最近的两头牛之间的距离。 依然用二分法来判断中间的解是否可行,判断的时候采用贪心法,首先对牛舍...
C
UTF-8
6,341
4.0625
4
[]
no_license
#include <stdlib.h> #include <stdio.h> #include <string.h> #include <assert.h> struct node { char * data; struct node * next; }; struct node * node_new(char * passedData) { struct node * result = malloc(sizeof(struct node)); result->data = passedData; result->next = NULL; return result; } struct hashta...
C++
UTF-8
1,012
3.078125
3
[]
no_license
#include "../header/myheader.h" class LT0481 { public: // magical_string += string(magical_string[index++] - '0', magical_string.back() ^ 3); // count(magical_string.begin(), magical_string.begin() + n, '1'); // .......... //Runtime: 8 ms, faster than 79.19% of C++ online submissions for Magical String. //Memory ...
JavaScript
UTF-8
936
2.640625
3
[]
no_license
import React, { Component } from "react"; export default class NameInput extends Component { constructor(props) { super(props); this.state = { username: '' }; } setUsername(name) { this.setState({ username: name }); } render() { return ( <div className="NameInput"> <label>Ente...
Python
UTF-8
1,138
3.84375
4
[ "MIT" ]
permissive
from collections import Counter, defaultdict class Solution(object): def topKFrequent(self, nums, k): """ :type nums: List[int] :type k: int :rtype: List[int] """ freq, result = Counter(nums), [] inverse_freq = defaultdict(list) for k1,v1 in fr...
JavaScript
UTF-8
2,032
2.703125
3
[ "MIT" ]
permissive
"use strict"; const canMoveOffBoard = require("./can-move-off-board.js"); const canMoveToSpace = require("./can-move-to-space.js"); const _ = require("lodash"); const constants = require("./constants"); function findAvailableSpaces(gameState, numberOfSpaces) { const isPlayerOne = gameState.isPlayerOne; const ...
Java
UTF-8
15,572
1.5
2
[ "Apache-2.0", "MIT" ]
permissive
/* * Copyright 2012-2023 CodeLibs Project and the Others. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by ap...
Markdown
UTF-8
2,309
2.859375
3
[]
no_license
<a href="https://vimeo.com/167734723">![Movie](https://media.giphy.com/media/l0K47zjNCEXIhxMJi/giphy.gif)</a> Features ==== - FB login, logout - Browse multiple pages - Create new post(published/unpublished) - Browse posts in each pages Components ==== Application - [react.js](https://github.com/facebook/react)...
C
UTF-8
366
3.390625
3
[]
no_license
#include <stdio.h> #include <conio.h> int main() { double fat, n; printf("Insira um valor para o qual deseja calcular seu fatorial: "); scanf("%lf", &n); if (n <= 20) { for(fat = 1; n > 1; n = n - 1) fat = fat * n; printf("\nFatorial calculado: %lf", fat); } else printf("...
Python
UTF-8
5,506
3.5625
4
[]
no_license
#! /usr/bin/env python # -*- coding: utf-8 -*- """ @Author: Xgz @Date: 2020/4/12 """ from datastructure.树.二叉树 import BinTree, BinNode, in_order_traverse class BST(BinTree): """二叉搜索树,继承于二叉树""" def __init__(self): super().__init__() self._hot = None # 指向命中节点的父节点 def search...
PHP
UTF-8
383
3.140625
3
[]
no_license
<?php // cach 1 khai bao mang khong lien tuc $course = array(); $course["php"] = "php"; //key: php $course["zend"] = "Zend Framework"; //key: zend $course["laravel"] = "Laravel"; //key: laravel $course["symfony"] = "Symfony"; //key: symfony $course[] = "Item 1"; // key: 1 $course[] = "Item 2"; // key: 2 ...
Python
UTF-8
3,731
2.765625
3
[]
no_license
from flask import Flask, jsonify import sqlalchemy from sqlalchemy.ext.automap import automap_base from sqlalchemy.orm import Session from sqlalchemy import create_engine, func, desc import datetime as dt engine = create_engine("sqlite:///Resources/hawaii.sqlite") Base = automap_base() Base.prepare(engi...
Markdown
UTF-8
4,184
2.84375
3
[]
no_license
--- layout: listing title: Stanford University - Academic Technology Specialist link: country: United States subrEmail: cncoleman@stanford.edu organization: Stanford University date: 2007-10-15 closingDate: jobTitle: Academic Technology Specialist published: false postdate: location: name: latitude: lon...
Swift
UTF-8
997
4.0625
4
[ "Apache-2.0" ]
permissive
/* Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if: Open brackets must be closed by the same type of brackets. Open brackets must be closed in the correct order. Note that an empty string is also considered valid...
Python
UTF-8
1,654
2.890625
3
[]
no_license
from abc import abstractclassmethod from pygame.event import Event from final_project.handwritting_recognition import constants from final_project.handwritting_recognition.pygame.misc.image_panel import ImagePanel from final_project.handwritting_recognition.pygame.settings import Settings class Panel(): #C...
Java
UTF-8
5,891
2.859375
3
[ "MIT" ]
permissive
/** * This software is released as part of the Pumpernickel project. * * All com.pump resources in the Pumpernickel project are distributed under the * MIT License: * https://github.com/mickleness/pumpernickel/raw/master/License.txt * * More information about the Pumpernickel project is available here: * http...
C
UTF-8
10,876
2.734375
3
[ "MIT" ]
permissive
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <getopt.h> #include "klp_matrix_params.h" #include "shared/constants.h" KLP_PARAMS init_klp_matrix_params() { KLP_PARAMS parameters = { .start_state = -1, .end_state = -1, .bp_dist = 0, .max_dist = 0, .epsilo...
Java
UTF-8
11,339
1.578125
2
[ "LicenseRef-scancode-free-unknown", "LGPL-2.1-only", "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
/* * This file is part of Sponge, licensed under the MIT License (MIT). * * Copyright (c) SpongePowered <https://www.spongepowered.org> * Copyright (c) contributors * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Softwar...
C++
UTF-8
1,053
3.21875
3
[]
no_license
#include <string> #include <boost/type_traits.hpp> #include <iostream> class Bar; class FooBase { public: FooBase( Bar &ctx ) : _barCtx( ctx ) {}; virtual ~FooBase() {}; // Some other functions protected: Bar &_barCtx; }; class Baz; template< typename T > class Foo : public FooBase { public: Foo( Bar &ctx ...
Java
UTF-8
907
2.015625
2
[]
no_license
package com.roshan; import java.sql.SQLException; import java.util.List; import javax.servlet.RequestDispatcher; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.roshan...
TypeScript
UTF-8
755
2.828125
3
[]
no_license
import { GenerationBasedCache } from "../generation-based-cache" it("simple #1", () => { const cache = new GenerationBasedCache(); for (let i = 0; i < 100; i++) { expect(cache.has(`key${i}`)).toBeFalsy(); cache.set(`key${i}`, `value${i}`); expect(cache.has(`key${i}`)).toBeTruthy(); ...
C++
UTF-8
841
3.96875
4
[]
no_license
/* ./p03/main.cc */ #include <iostream> using namespace std; /* compare(t1,t2) * Returns a value greater than zero when t1 > t2, or * zero when t1 == t2, or a negative value when t1 < t2. */ template < typename T > int compare( const T &t1, const T &t2 ) { return ( t1 - t2 ); } class X { public: // conv...
SQL
UTF-8
769
3.53125
4
[]
no_license
CREATE TABLE TwitterUser ( id INT NOT NULL AUTO_INCREMENT, name varchar(100) NOT NULL, profileImageUrl VARCHAR(700), PRIMARY KEY(id), UNIQUE KEY idx_name_profileimg(name,profileImageUrl) ) engine=innodb CREATE TABLE Tweet ( id ...
C
UTF-8
2,297
3.109375
3
[ "CC0-1.0" ]
permissive
#include "leds.h" #include "hardware.h" #include <stdbool.h> // Matrix representing the on/off state of each LED. // each LED is row,col = anode,cathode #define N_PINS 3 static volatile bool led_states[N_PINS + 1][N_PINS + 1] = {{0}}; void set_led(uint16_t led, bool state) { const uint8_t row = (led & 0xff00u) >...
C++
UTF-8
9,614
2.859375
3
[]
no_license
/********************************************************************* * Filename: sha1_test.c * Author: Brad Conte (brad AT bradconte.com) * Copyright: * Disclaimer: This code is presented "as is" without any guarantees. * Details: Performs known-answer tests on the corresponding SHA1 implementation. The...
Python
UTF-8
1,448
2.828125
3
[]
no_license
from mysqlDb import mysql from flask import Flask, render_template, url_for, request, redirect, session, flash def tipoAnimalInicio(): print("TIPO ANIMAL:") cur = mysql.connection.cursor() cur.execute('SELECT * FROM tipoanimal') data = cur.fetchall() cur.close() return render_template("tipoAni...
C#
UTF-8
1,979
3.359375
3
[]
no_license
using Badges; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace _03_BadgeUI { public class ProgramUI { private readonly BadgeRepo _badgeRepo = new BadgeRepo(); public void Run() { RunMenu(); ...
Python
UTF-8
608
3.3125
3
[]
no_license
import pprint # for preety print messege='''A newly initialized Chatterbot instance starts off with no knowledge of how to communicate. To allow it to properly respond to user inputs, the instance needs to be trained to understand how conversations flow. Since Chatterbot relies on machine learning at its backend, it ca...
PHP
UTF-8
674
2.78125
3
[]
no_license
<?php /** * Created by PhpStorm. * User: samoilenko * Date: 2018-12-08 * Time: 22:40 */ declare(strict_types=1); namespace App\Basket\Model\ERP; use App\Basket\Model\Exception\UnknownProduct; interface ERP { /** * Get stock information for given product * * If stock information cannot be fet...
Java
UTF-8
2,313
2.15625
2
[]
no_license
package com.icms.cms.web.admin; import java.util.List; import com.icms.cms.base.AController; import com.icms.cms.model.Category; import com.icms.cms.model.Topic; import com.icms.cms.service.CategoryService; import com.icms.cms.service.TopicService; import com.icms.common.shiro.ShiroUtil; import com.icms.common.util.C...
Java
UTF-8
2,012
2.3125
2
[]
no_license
package team404.restaurant.employee.controller; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.CrossOrigin; import org.s...
C++
UTF-8
1,004
2.75
3
[]
no_license
#ifndef AVKeyCode_h #define AVKeyCode_h #include "OpenVanilla.h" #include <ctype.h> class AVKeyCode : public OVKeyCode { public: AVKeyCode (int p = 0) { chr = toupper(p); isShift_ = isCapsLock_ = isCtrl_ = isAlt_ = isNum_ =0; } virtual int code() { return (isShift_||isCapsLock_||isCtrl_||isAlt_) ? chr...
Python
UTF-8
185
3.140625
3
[]
no_license
d=int(input()) a=[] for i in range(0,d): g=int(input()) a.append(g) count=0 for i in a: for x in a: if i==x: count+=2 if count==2: print(i)
Markdown
UTF-8
1,524
3.796875
4
[ "Apache-2.0" ]
permissive
# Bluffalo Bluffalo allows you to do real mocking and stubbing in Swift. ## What does it do? It generates a subclass of whatever class you want with some extra methods and properties that allow you to stub values and see what was called. ## Limitations - Because this relies on subclassing, this will not work for stub...
TypeScript
UTF-8
1,710
2.9375
3
[]
no_license
import Point from '../math/Point'; import Screen from './Screen'; import GameObject from '../gameobject/GameObject'; export default class Camera extends GameObject { public position: Point = new Point(); private followTarget: GameObject | null; private followSpeed: number = 1; private screen: Screen; ...
Java
UTF-8
4,341
2.84375
3
[]
no_license
package grafika2b; import java.awt.Color; import java.awt.Graphics2D; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.awt.image.BufferedImage; import javax.swing.JFrame; public class Transformation implements KeyListener { private BufferedImage _tex; private Matrix _matrix = Ma...
Swift
UTF-8
1,279
2.734375
3
[ "MIT" ]
permissive
// // LinearLoader.swift // Yess // // Created by Massimiliano on 03/04/17. // Copyright © 2017 Digital Brain. All rights reserved. // import UIKit class LinearLoader: UIView { var timer: Timer? func startAnimating() { self.stopAnimating() self.alpha = 1 self.cornerRadius = 2...
PHP
UTF-8
1,046
2.640625
3
[ "MIT" ]
permissive
<?php namespace Oro\Bundle\MessageQueueBundle\Log\Formatter; use Symfony\Bridge\Monolog\Formatter\ConsoleFormatter as BaseConsoleFormatter; /** * Formats message queue consumer related log records for the console output * by coloring them depending on log level. */ class ConsoleFormatter extends BaseConsoleFormat...
Shell
UTF-8
301
2.84375
3
[]
no_license
#!/bin/bash repo=$(echo $1 | sed 's/https:\/\/github.com\///') filename=$(echo $repo | sed 's/.*\///').json curl -s https://raw.githubusercontent.com/$repo/HEAD/README.md | grep -o 'github.com/[-a-zA-Z0-9]\+/[-\.a-zA-Z0-9_]\+' | sed 's/.*github.com\///g' | jq --raw-input '[inputs]' >$filename
Java
UTF-8
471
2.296875
2
[]
no_license
package database; import android.arch.persistence.room.Room; import android.content.Context; public class DatabaseFactory { private static AppDatabase db = null; public static AppDatabase get(Context context) { if(db == null) { db = Room.databaseBuilder( context, ...
Shell
UTF-8
616
3.65625
4
[ "MIT" ]
permissive
source $stdenv/setup set -e if ! [ -f "$IVORY" ]; then echo "$IVORY doesn't exist" exit 1 fi # # heuristics to confirm the ivory pill is valid # # first 7 bytes != "version" (start of an lfs pointer) # if [ "$(head -c 7 "$IVORY")" = "version" ]; then echo "$IVORY is an LFS pointer (it starts with 'version')...
Java
UTF-8
1,259
1.960938
2
[]
no_license
package com.lzb.system.admin.doman; import lombok.Data; import javax.persistence.*; import java.io.Serializable; import java.util.HashSet; import java.util.Set; @Data @Entity @Table(name = "lzb_user") public class User implements Serializable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Colu...
C++
UTF-8
1,115
2.671875
3
[ "BSD-3-Clause" ]
permissive
#ifndef _LABELS_SHARED_H_INCLUDED_ #define _LABELS_SHARED_H_INCLUDED_ #include "Reprise/Statements.h" namespace OPS { namespace Shared { using OPS::Reprise::ReprisePtr; using OPS::Reprise::StatementBase; // You can use this function after replaceStatement function // if you need to translate label from sourceStmt...
Ruby
UTF-8
1,178
3.53125
4
[]
no_license
class Location attr_accessor :x , :y, :facing def initialize(x = 0, y = 0, facing = 'NORTH') if x.respond_to?(:to_str) if self.valid_instruction?(x) set_location(x) else raise(InvalidLocationInputError, "Invalid initial direction:#{x}") end else @x = x ...
Markdown
UTF-8
820
2.8125
3
[]
no_license
Brick Game Simulator / Simulador de Mini Game =============== [Eng] ### Description > Web application that simulates the old minigames, using HTML5. Documentation > Size The size attribute of the id div "minigame" defines the size of the minigame, values are accepted: small, medium and big; ### Example > The example...
PHP
UTF-8
488
2.515625
3
[ "BSD-2-Clause" ]
permissive
<?php namespace App\Http\Controllers\Api; use App\Contracts\Controller; use App\Services\EmirateService; use Illuminate\Http\Request; class EmirateController extends Controller { private $emirateSvc; /** * EmirateController constructor. * @param $emirateSvc */ public function __construct(...
C
UTF-8
981
2.671875
3
[]
no_license
/** * @file calc.h * @brief Onde fica a enum operations_t e funções que calculam dados para Stats * @author Natália Azevedo de Brito (https://github.com/bnatalha) * @since 10/04/2017 * @date 13/04/2017 * @sa http://www.cplusplus.com/ */ #ifndef CALC_H #define CALC_H #include "header.h" #include "comparator.h" #inc...
Java
UTF-8
2,103
1.882813
2
[]
no_license
package com.comm.pojo; import java.io.Serializable; public class PageInfo implements Serializable{ /** * */ private static final long serialVersionUID = 8171114812467078628L; private String url; private int index; private int total; private String name; private String functionId; private St...
Java
UTF-8
439
2.59375
3
[]
no_license
package commands; import receivers.Stereo; public class StereoOnWithCdCommand implements Command { private Stereo stereo; public StereoOnWithCdCommand(Stereo stereo) { this.stereo = stereo; } @Override public void execute() { stereo.setOn(); stereo.setCd(); stereo....
SQL
UTF-8
3,981
3.046875
3
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
-- phpMyAdmin SQL Dump -- version 3.3.9 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Jan 18, 2017 at 07:39 AM -- Server version: 5.5.8 -- PHP Version: 5.3.5 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SE...
Java
UTF-8
983
2.25
2
[]
no_license
import cn.aegisa.project.trading.config.MailSender; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; import java.io.File; import java.util.LinkedHashMap; import java.util.Map; import java.util.UUID; /** * Using IntelliJ IDEA. * * @author XIANYINGDA at 2018/6/15 13:24 */ public...
Java
UTF-8
2,048
2.3125
2
[]
no_license
/* * The MIT License * * Copyright 2014 Ryan Gilera. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, mod...
Python
UTF-8
716
2.515625
3
[]
no_license
import sql import MySQLdb import datetime sql_settings = { "ADDR": "ADDR", "USER": "USER", "PASS": "PASS", "DB": "DBNAME" } def update(query): db = MySQLdb.connect(sql_settings["ADDR"], sql_settings["USER"], sql_settings["PASS"], sql_settings["DB"]) return_code = 1 cursor = db.cursor() try: ...
Java
UTF-8
1,688
2.828125
3
[]
no_license
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package domain; /** * * @author Thibaut */ public class FoodType { private int Id; private String Descri...
Java
UTF-8
1,664
2.109375
2
[]
no_license
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.hasnain.travelagency.model; import java.io.Serializable; import javax.persistence.Entity; import javax.persistenc...
JavaScript
UTF-8
11,153
2.609375
3
[]
no_license
window.onload = function() { if (window.jQuery) { // jQuery is loaded alert("jQuery loaded"); } else { // jQuery is not loaded alert("no jQuery"); } } var teamALeader = null; var teamASub1 = null; var teamASub2 = null; var teamASub3 = null; var teamASub4 = null; var team...
Java
UTF-8
2,675
2.203125
2
[ "MIT" ]
permissive
package uk.gov.companieshouse.api.strikeoffobjections.common; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import org.apache.avro.Schema; import org.apache.avro.generic.GenericData; import org.apache.avro.generic.GenericDatumWriter; import org.apache.av...
C#
UTF-8
517
2.75
3
[]
no_license
using System; namespace MoneyCategorizer { [System.Diagnostics.DebuggerDisplay("{Description} = {Amount}")] public class Transaction { private string raw; public DateTime Date { get; set; } public string Description { get; set; } public double Amoun...
Java
UTF-8
3,398
2.234375
2
[]
no_license
package com.sixin.iot.service.impl; import com.sixin.common.annotation.DataSource; import com.sixin.common.enums.DataSourceType; import com.sixin.common.core.text.Convert; import com.sixin.iot.domain.LED; import com.sixin.iot.mapper.LEDMapper; import com.sixin.iot.service.ILEDService; import org.springframework.beans....
Markdown
UTF-8
4,480
2.625
3
[]
no_license
### github上clone到本地: 在终端输入 $ git usage: git [--version] [--help] [-C <path>] [-c name=value] [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path] [-p | --paginate | --no-pager] [--no-replace-objects] [--bare] [--git-dir=<path>] [--work-tree=<path>] ...
PHP
UTF-8
693
2.953125
3
[]
no_license
<?php namespace Alexeev; use core\EquationInterface; class Square extends Line implements EquationInterface { public function solve(float $a, float $b, float $c): array { if($a == 0){ return parent::line($b, $c); } $D = $this->searchD($a, $b, $c); if($D > 0){ ...
Markdown
UTF-8
19,014
3.1875
3
[ "MIT" ]
permissive
#! https://zhuanlan.zhihu.com/p/256444986 # rust 从零开始构建区块链(Bitcoin)系列 - 交易和一些辅助工具 Github链接,包含文档和全部代码: [https://github.com/yunwei37/blockchain-rust](https://github.com/yunwei37/blockchain-rust) 这篇文章对应着 Go 原文的第三部分和第四部分,包括 `持久化和命令行接口` 以及 `交易`。交易是一个由区块链构成的虚拟货币系统的核心,但在讨论交易之前,我们还会先着手做一些辅助的工具部分: - 将区块链持久化到一个数据库中(在内存中肯定是不现...
Markdown
UTF-8
2,291
2.75
3
[]
no_license
# Parte do Back-end Como proposto no desafio, foi utilzado o php para fazer o backend, porém eu tomei a liberdade de utilizar um dos frameworks php que mais gosto e utilizo na atualidade, o Laravel. O processo foi o seguinte: uma rota do tipo get foi criada (/api/v1/planos), nela chamando um controller, que cham...
C#
UTF-8
5,857
2.78125
3
[]
no_license
using System; using System.Collections.Generic; using WebStore.Entities; using WebStore.Models; namespace WebStore.Data { public class TestData { private static readonly List<Employee> _employees = new() { new() { Id = 1, LastName = "Ива...
C++
UTF-8
647
2.9375
3
[]
no_license
#include <iostream> #include <iomanip> using namespace std; int main(int argc, char const *argv[]) { int t,n; cin >> t; while(t-- > 0){ cin >> n; int A[n]; for (int i = 0; i < n; ++i) { cin >> A[i]; } int max_sum = 0, ctr = 0; for(int i=0; i<n ;i++){ for(int j = i+1; j < n;j++){ if(A[i]+A[j...
Java
UTF-8
1,594
2.984375
3
[ "Apache-2.0" ]
permissive
package tests.java.awt; import static org.junit.Assert.assertEquals; import org.junit.Test; import java.awt.AWTException; import java.awt.Dimension; import java.awt.GraphicsDevice; import java.awt.Rectangle; import java.awt.Robot; import java.awt.Toolkit; import java.awt.image.BufferedImage; public cl...
JavaScript
UTF-8
803
2.515625
3
[]
no_license
import React , {Component} from 'react'; import Fevent from './functionalEvent'; class Event extends Component{ state={ details: [ {name : 'jeevan', age: 22}, {name : 'rakesh', age: 30}, {name : 'chadarla', age: 42}, ], title: 'Hello React...
JavaScript
UTF-8
14,644
2.703125
3
[ "ISC" ]
permissive
'use strict'; var util = require('./../common/util.js'); var geometry = require('./../common/geometry.js'); var Pathfinder = require('./../actors/pathfinder.js'); var Slab = require('./slab.js'); var Tile = require('./tile.js'); var TileSheet = require('./sheet2.js'); module.exports = World; var Canvas = require('./....
Python
UTF-8
836
3.328125
3
[]
no_license
# # https://app.codility.com/programmers/lessons/12-euclidean_algorithm/common_prime_divisors/ # https://app.codility.com/demo/results/trainingKEBYGS-74H/ # def UniquePrimeDivisors(x): result = set() divisor = 2 while divisor < x: if x % divisor == 0: result.add(divisor) x ...
JavaScript
UTF-8
1,375
2.578125
3
[]
no_license
import { database } from '../firebase' const EditNote = ({ editId, editTitle, setEditTitle, editText, setEditText, setShowEditForm, setMessage1 }) => { const handleDoneButton = async () => { setShowEditForm(false) setMessage1('Loading...') function editNote(id, title, description) { const editNote =...
Markdown
UTF-8
848
2.859375
3
[]
no_license
--- title: "About me" date: 2019-09-01T09:05:18-05:00 --- I am a digital strategist who blogs about leadership and digital technology. I help organizations transform by using technology to make smarter decisions that improve performance. I am a former Economics Reporter at **The Wall Street Journal** and **two-time Goo...
Java
UTF-8
315
2.484375
2
[]
no_license
package lite.ast; public class DivisionNode extends BinaryOperatorNode { public DivisionNode(ExpressionNode e1, ExpressionNode e2, int line, int col) { super(e1, e2, line, col); } public String unparse(int indent) { return this.unparseBinaryOperator("/", indent); } } // class DivisionNode
Python
UTF-8
967
3.109375
3
[]
no_license
import os from tkinter import filedialog, Text from Ponto import * # funcao para ler pontos de um arquivo através de uma interface gráfica def lerPontos(): raiz = os.getcwd() fileName = filedialog.askopenfilename(initialdir="${raiz}", title="Selecione um arquivo", filetypes=(("text", "*.txt"),)) #os....
Java
UTF-8
1,315
2.8125
3
[]
no_license
package com.hackaton.visualrecognition.data; import android.os.Parcel; import android.os.Parcelable; /** * Created by fatih.erol on 19.10.2017. */ public class Class implements Parcelable { private String className; private float score; public String getClassName(){ return this.className; ...
PHP
UTF-8
2,128
2.8125
3
[]
no_license
<?php /** * @author Carlos Alberto Suarez Garrido <suarezcarlos@unbosque.edu.co> * @copyright Universidad el Bosque - Dirección de Tecnología * @package entidades */ class ModalidadSIC{ /** * @type int * @access private */ private $codigoModalidadAcademicaSic; /** * @type Str...
C
ISO-8859-1
3,720
2.796875
3
[]
no_license
#pragma once #ifndef JEU_H #define JEU_H #define DEBUG 1 #ifdef DEBUG // Module utile la detection de fuites memoires. #include "vld.h" #endif #define NB_CASES 78 #define MOTIF "[]" #define BAS 0 #define HAUT 1 #define LIGNES 0 #define COLONNES 1 #define ROULEUR 0 #define SPRINTEUR 1 #define print1D(i, tab, tag, t...
Shell
UTF-8
179
2.875
3
[]
no_license
#!/bin/bash echo "Menu:" echo "1. open nano" echo "2. open vi" echo "3. open links" echo "4. exit" opt=0 read opt case $opt in 1) nano ;; 2) vi ;; 3) links ;; *) exit 0 ;; esac
Markdown
UTF-8
6,559
2.640625
3
[ "MIT" ]
permissive
# tol-api-php [![Build Status](https://travis-ci.org/traderinteractive/tol-api-php.svg?branch=master)](https://travis-ci.org/traderinteractive/tol-api-php) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/traderinteractive/tol-api-php/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/traderinter...
JavaScript
UTF-8
19,754
2.703125
3
[ "Apache-2.0" ]
permissive
import polygonBoolean from 'poly-bool'; export default function makePolygonGroups(rects, pathOffset) { const polygons = unionRects(offsetRects(rects, pathOffset), pathOffset); const cleanedPolygons = polygons.map(poly => cleanPolygon(poly)); return cleanedPolygons; } function offsetRects(rects, offset) { // o...
Go
UTF-8
3,357
2.515625
3
[ "MIT" ]
permissive
package radarr import ( "bytes" "context" "encoding/json" "fmt" "golift.io/starr" ) const bpMovieEditor = bpMovie + "/editor" // BulkEdit is the input for the bulk movie editor endpoint. // You may use starr.True(), starr.False(), starr.Int64(), and starr.String() to add data to the struct members. // Use Avai...
Ruby
UTF-8
784
2.734375
3
[ "Apache-2.0" ]
permissive
#create_db require "sequel" begin DB = Sequel.sqlite('sinatra_shop.db') DB.create_table :products do primary_key :id String :name Float :price String :buy_link end rescue end begin DB = Sequel.sqlite('sinatra_shop.db') DB.create_table :carts do primary_key :id String :username F...
Java
UTF-8
13,236
1.960938
2
[]
no_license
/*!***************************************************************************** * * Selenium Tests For CTools * * Copyright (C) 2002-2016 by Pentaho : http://www.pentaho.com * ******************************************************************************* * * Licensed under the Apache License, Version 2.0 (the...
Java
UTF-8
264
2.109375
2
[]
no_license
package com.example.simple; import akka.actor.*; public class FirstActor extends UntypedAbstractActor { @Override public void onReceive(Object message) throws Throwable { System.out.println("FirstActor收到的消息为:"+message); } }
Swift
UTF-8
1,506
2.921875
3
[]
no_license
// // NamesTableViewController.swift // foo // // Created by Arthur Sabintsev on 6/29/15. // Copyright (c) 2015 GA. All rights reserved. // import UIKit class NamesTableViewController: UITableViewController { var names = ["Thomas", "Arthur", "Devin", "Luke", "Foo"] override func viewDidLoad() { ...
Java
UTF-8
477
1.828125
2
[]
no_license
package com.autogeneral.techtest.angservice.model.json; import com.fasterxml.jackson.annotation.JsonProperty; /** JSON object used as during the Patch (i.e. update) ToDoItem request */ public class ToDoItemUpdateRequest extends ToDoItemRequest { private Boolean completed; @JsonProperty("isCompleted") pu...
Rust
UTF-8
2,888
2.546875
3
[ "MIT", "LicenseRef-scancode-other-permissive", "Apache-2.0", "BSD-3-Clause", "BSD-2-Clause", "NCSA" ]
permissive
// run-pass // ignore-cloudabi no processes // ignore-emscripten no processes use std::process::{Command, Stdio}; use std::env; use std::sync::{Mutex, RwLock}; use std::time::Duration; use std::thread; fn test_mutex() { let m = Mutex::new(0); let _g = m.lock().unwrap(); let _g2 = m.lock().unwrap(); } fn ...
Python
UTF-8
888
3.515625
4
[]
no_license
import math from euler_21 import ESieve, sumOfFactorsPrime # find all abundant numbers # create and mark all numbers which can be created as the sum # of two abundant numbers # sum up all non-marked numbers limit = 28123 abundant = [] primeList = ESieve(int(math.sqrt(limit))) sum = 0 # find all abundant numbers for ...
Ruby
UTF-8
3,340
2.71875
3
[ "MIT" ]
permissive
module Rdm module Handlers class DependenciesHandler ALREADY_MENTIONED_DEPS = '...' class << self def show_names(package_name:, project_path:) new(package_name, project_path).show_names end def show_packages(package_name:, project_path:) new(package_...
Java
UTF-8
1,562
2.265625
2
[]
no_license
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package imac.dp.dao; import imac.dp.model.Parcela; import java.sql.PreparedStatement; import java.sql.ResultSet; import java...
C#
UTF-8
2,704
2.875
3
[ "MIT" ]
permissive
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace TouhouStock { public partial class BuySellForm : Form { public GameData gameDa...
Markdown
UTF-8
8,792
2.703125
3
[]
no_license
<center><h1>Axel 快速下载</h1></center> ## 1. 介绍 [Axel](https://axel.alioth.debian.org/) 是一个轻量级下载程序,它和其他加速器一样,对同一个文件建立多个连接,每个连接下载单独的文件片段以更快地完成下载。 Axel 支持 HTTP、HTTPS、FTP 和 FTPS 协议。它也可以使用多个镜像站点下载单个文件,所以,Axel 可以加速下载高达 40%(大约,我个人认为)。它非常轻量级,因为它没有依赖并且使用非常少的 CPU 和内存。 Axel 一步到位地将所有数据直接下载到目标文件(LCTT 译注:而不是像其它的下载软件那样下载成多个文件块,然后拼接...
TypeScript
UTF-8
2,376
2.578125
3
[ "MIT" ]
permissive
// tslint:disable:no-var-requires no-implicit-dependencies const test = require("tape"); import { Test } from "tape"; import { getProduct, getVendor } from "./usbinfo"; test("Test Get Product - existing vendor and device - 1", async (t: Test) => { // tslint:disable-next-line:no-debugger const expected = { prod...
Java
UTF-8
472
2.078125
2
[]
no_license
package com.example.lysuytry.itemprice; import android.content.Context; import com.readystatesoftware.sqliteasset.SQLiteAssetHelper; /** * Created by Ly Suytry on 8/5/2016. */ public class MyAssetsDatabase extends SQLiteAssetHelper{ private static final String DATABASE_NAME = "ItemDatabase.db"; private sta...
JavaScript
UTF-8
3,342
3.765625
4
[]
no_license
// window.alert("1"); // window опускается тк глобальная функция // window.prompt("как тебя зовут?"); // window.confirm("как тебя зовут?"); // const heading = document.getElementById("hello"); //возрощает ссылку на элемент // console.log(heading); // console.dir(heading); //раскрывает* // console.dir(heading.id); //по...
Shell
UTF-8
1,369
3.703125
4
[]
no_license
#!/usr/bin/env bash sketchget() { curl --create-dirs -f -k -L -o ${2} -S -s https://sketchmaster2001.github.io/RC24_Patcher/${1} } title() { clear printf "Wiimmfi WiiWare Patcher\tBy: Noah Pistilli\n" | fold -s -w "$(tput cols)" printf -- "=%.0s" $(seq "$(tput cols)") && printf "\n\n" } case $(uname -m...
JavaScript
UTF-8
1,610
2.515625
3
[]
no_license
$(function(){ $("#new_item").validate({ rules: { "item[name]":{ required: true, }, "item[description]":{ required: true, }, "item[category_id]":{ required: true, }, "item[state]":{ required: true, }, "item[delivery]":{ r...