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
C++
UTF-8
9,078
2.765625
3
[]
no_license
/*** *** See the file "mba/disclaimers-and-notices-L2.txt" for *** information on usage and redistribution of this file, *** and for a DISCLAIMER OF ALL WARRANTIES. ***/ #ifndef MBA_STRING_H #define MBA_STRING_H // // Simple implementation of strings. // $Id: MBA_string.h,v 1.20 2004/01/28 23:31:36 lbrown Exp $ //...
Go
UTF-8
736
2.6875
3
[ "MIT" ]
permissive
package notify import ( "context" "sync" "testing" "time" "github.com/stretchr/testify/require" ) func TestSubscriptionMultipleEvents(t *testing.T) { const timeout = 1 * time.Second ctx := context.Background() r := require.New(t) b := NewBroadcaster() sub := SubscriptionTo(ctx, b) defer sub.Stop() con...
SQL
UTF-8
1,245
3.515625
4
[]
no_license
CREATE TABLE `doctor` ( `id` INT NOT NULL AUTO_INCREMENT, `name` VARCHAR(45) NOT NULL, `birth_date` DATETIME NOT NULL, `gender` VARCHAR(10) NOT NULL, `address` VARCHAR(45) NOT NULL, `email` VARCHAR(45) NOT NULL, `password` VARCHAR(45) NOT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=UTF8; CR...
Java
UTF-8
3,332
2.09375
2
[]
no_license
package com.beeasy.easyshop.model; import java.math.*; import java.util.Date; import java.sql.Timestamp; import org.beetl.sql.core.annotatoin.Table; /* * * gen by beetlsql 2019-05-17 */ @Table(name="yoehi.ra_p_mansong_quota") public class RaPMansongQuota { // alias public static final String ALIAS_quota_id = ...
Java
UTF-8
548
1.515625
2
[]
no_license
package com.allocationservice; import java.util.TimeZone; import javax.annotation.PostConstruct; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;...
Java
UTF-8
2,629
2.015625
2
[]
no_license
package timefish.com.rings4w; import android.net.Uri; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.view.animation.AccelerateInterpolator; import android.view.animation.Animation; import android.view.animation.AnimationUtils; import android.widget.I...
Java
UTF-8
2,874
1.890625
2
[]
no_license
package com.ymkj.cms.web.boss.facade.master; import java.util.List; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import com.ymkj.base.core.biz.api.message.PageResponse; import com.ymkj.base.core.biz.api.mes...
Python
UTF-8
3,779
2.703125
3
[]
no_license
import Utils from twitter import * import twitter__login import json, time, sys, os, shutil twitter = Twitter() ''' THE INUITION: A user listed by many other users under a certain topic is likely to be expert ''' class UserListCrawler(): def __init__(self): self.listOfFiles = None self.listOfU...
Java
UTF-8
1,861
3.28125
3
[]
no_license
import java.io.*; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import java.util.HashMap; import java.util.Map; import java.util.Scanner; public class main_class { public static void main(String[] args)throws Exception { //open file Scanner consoleinput...
Python
UTF-8
4,466
3.78125
4
[]
no_license
class TreeNode: def __init__(self, val=0, left=None, right=None): self.val = val self.left = left self.right = right self.height = 1 class AVLTree: def getHeight(self, root): """ Return the height of root node """ if not root: return 0 r...
Python
UTF-8
2,769
3.265625
3
[]
no_license
#!/usr/bin/env python """ This is a script that walks through some of the basics of working with images with opencv in ROS. """ import rospy from sensor_msgs.msg import Image from copy import deepcopy from cv_bridge import CvBridge import cv2 import numpy as np import time class BlobDetector(object): """ The...
Markdown
UTF-8
1,036
2.515625
3
[]
no_license
# rsa_client ``` 填充模式 密钥长度 输入分组有效载荷 输出分组长度 PKCS#1 768 85 96 PKCS#1 1024 117 128 PKCS#1 2048 245 256 OAEP 768 54 96 OAEP 1024 86 128 OAEP 2048 214 ...
Python
UTF-8
805
3.09375
3
[]
no_license
import time from package_runoob.runoob1 import runoob1 from package_runoob.runoob2 import * # 可选参数函数说明 def printinfo(arg1, *vartuple): print("输出:") print(arg1) for var in vartuple: print(var) return # 调用printinfo 函数 printinfo(10) printinfo(70, 60, 50) # lambad def add(arg1, arg2): return ...
C++
UTF-8
41,591
3.25
3
[]
no_license
//////////////////////////////////////////////////////////////////////////////// /** \file \brief \ru Вектор в трехмерном пространстве. \en Vector in three-dimensional space. \~ */ //////////////////////////////////////////////////////////////////////////////// #ifndef __MB_VECTOR3D_H #define __MB_VECT...
Java
UTF-8
1,375
3.34375
3
[ "MIT" ]
permissive
package com.bcreagh.javaalgos.graph; import java.util.*; public class DepthFirstSearch { private Digraph digraph; private int searchRoot; private boolean[] visited; private int[] previousVertex; public DepthFirstSearch(Digraph digraph, int searchRoot) { this.digraph = digraph; th...
C#
UTF-8
1,339
2.875
3
[]
no_license
 using System; using System.Diagnostics; namespace NLite { /// <summary> /// 监听器接口 /// </summary> /// <remarks>充当观察者模式中的抽象观察者角色</remarks> public interface IListener { } ///// <summary> ///// ///// </summary> ///// <typeparam name="TEnum"></typeparam> ...
C#
UTF-8
1,088
2.71875
3
[]
no_license
static void Main(string[] args) { try{ var mapperCfg = new AutoMapper.MapperConfiguration(cfg => { cfg.CreateMap<Source, DestinationOuter>().ForCtorParam("destinationNested", o => o.MapFrom(s => new DestinationNested(s.InnerValue))); }); mapperCfg.AssertConfigurationIsValid(); var mapper = mapperCfg...
Java
UTF-8
356
1.921875
2
[]
no_license
package ua.training.taxsystem.persistence.repositories; import org.springframework.data.jpa.repository.JpaRepository; import ua.training.taxsystem.persistence.entities.StateApproval; import java.util.Optional; public interface StateApprovalRepository extends JpaRepository<StateApproval, Long> { Optional<StateApp...
PHP
UTF-8
330
3.375
3
[]
no_license
<?php $arr = [ 0 => ['Test 1.1', 'Test 1.2', 'Test 1.3'], 1 => ['Test 2.1', 'Test 2.2', 'Test 2.3'], ]; echo '<pre>'; print_r($arr); echo '</pre>'; for ($i = 0; $i < count($arr); $i++) { for ($k = 0; $k < count($arr[$i]); $k++) { echo " >> " . $arr[$i][$k]; } echo "<br>"; } echo "<hr>"; $arr2 = array...
PHP
UTF-8
1,104
2.703125
3
[ "MIT" ]
permissive
<?php use Illuminate\Database\Seeder; use App\Author; use App\AuthorDetail; use App\Post; use Faker\Generator as Faker; class AuthorSeeder extends Seeder { /** * Run the database seeds. * * @return void */ public function run(Faker $faker) { for ($i=0; $i < 45; $i++) { ...
JavaScript
UTF-8
1,881
2.65625
3
[]
no_license
const Profile = require("../../../models/Profile"); const User = require("../../../models/User"); // fetch current user profile info module.exports.fetchProfile = function (req, res) { const errors = {}; // console.log("Fetch profile", req.user); Profile.findOne({ user: req.user.id }) .populate("user"...
C++
GB18030
1,603
3.09375
3
[]
no_license
#pragma once #include<iostream> #include<string> using namespace std; enum student_gender{ man=0, women }; struct student_time{ unsigned short int _year;// unsigned short int _month;// unsigned short int _day;// student_time(unsigned short int year=1990, unsigned short int month=1, unsigned short int day=1...
C++
UTF-8
3,154
2.578125
3
[]
no_license
#ifndef MESSAGE_H #define MESSAGE_H /////////////////////////////////////////////////////////////////////////////////// // Message.h - Constructs messages to send and Interpret the received message // // Ver 1.0 // // Language: Visual C++ 2013 // ...
Python
UTF-8
2,954
3
3
[]
no_license
# webserver utility for embedded development # # Date: 06/24/2017 # Author: mcalyer # Python 3.7 # Description: # Converts html index page to gzip format # Then creates a c header file with this structure: # #define file_name_html_gz_len NNNN # const uint8_t index_html_gz[] = { 0x1F, 0x8B, 0x08, ...
C++
UTF-8
2,136
2.625
3
[]
no_license
#include "chargen.h" #include "fun/base/logging.h" #include "fun/net/event_loop.h" #include <stdio.h> #include <boost/bind.hpp> using namespace fun; using namespace fun::net; ChargenServer::ChargenServer(EventLoop* loop, const InetAddress& listen_addr, bool print) : server_(loop, li...
Python
UTF-8
269
2.90625
3
[]
no_license
import itertools import numpy as np MOD = 10**9 + 7 K = int(input()) if K%9 != 0: print(0) exit() dp = [0] * (K+1) dp[0] = 1 for i in range(len(dp)): b = min(i, 9) for j in range(1, b+1): dp[i] += dp[i-j] dp[i] %= MOD print(dp[K])
Java
UTF-8
619
1.671875
2
[]
no_license
/* * Decompiled with CFR 0.145. */ import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; public class Class_46939 extends Class_44015 { public Class_46939(Class_44290 class_44290, Class class_) { super(class_44290, class_, (17027 & 10337) != 0); } private void Method_46940...
Java
UTF-8
1,219
2.5
2
[]
no_license
package com.next.dream.service; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.ValueOperations; import org.springframework.stereotype.Component; import java.util.concu...
Ruby
UTF-8
207
4.15625
4
[]
no_license
# create a method, called print_array, that takes an argument of an array and uses #each to iterate through the array and puts each element. def print_array(array) array.each{|element| puts element} end
Java
UTF-8
6,094
3.296875
3
[]
no_license
package aoc.day11; import aoc.Day; import aoc.helper.IntegerComputerV6; import lombok.Data; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.stream.Collectors; public class Day11a implements Day { @Data private class HullRobot { private IntegerComputerV6 com...
C#
UTF-8
1,044
2.546875
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging;...
Python
UTF-8
3,719
2.640625
3
[]
no_license
import numpy as np import theano.tensor as T import lasagne from lasagne import init from lasagne import nonlinearities from lasagne.layers.base import Layer from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams import theano from theano import printing import theano.sparse as sparse import sparse_new ...
C
UTF-8
704
3.578125
4
[]
no_license
#include <stdio.h> #include <math.h> #include <time.h> typedef int bool; #define true 1 #define false 0 int main() { unsigned long long int tri, hex, pent; for(unsigned long long int i = 1; i < 300000; i++) { tri = (i*(i+1))/2; for(unsigned long long int j = 1; j < 300000; j++) { pent = (j*(3*j-1))/2; ...
Java
UTF-8
723
1.828125
2
[]
no_license
// clone pairs:1118:90% // 1931:maven/maven-core/src/main/java/org/apache/maven/project/artifact/DefaultMavenMetadataCache.java public class Nicad_t1_maven318 { public boolean equals( Object o ) { if ( o == this ) { return true; } ...
Java
UTF-8
503
3.59375
4
[]
no_license
package Carcreation; // this is Carcreation packege public class Car { // here Car is a class public String color; public String fueltype; public int cc; public void start() { System.out.println("car started"); } public void move() { System.out.println("car is moving"); } public void stop() { System....
Python
UTF-8
2,172
3.046875
3
[]
no_license
import os import csv import requests from bs4 import BeautifulSoup def readHtml(path): # 返回一个列表,其中包含在目录条目的名称(google翻译) files = os.listdir(path) # 返回该目录下的所有文件 # 先添加目录级别 index = 0; for f in files: try: file = open(path + '\\' + f, encoding='utf-8') # 打开文件 getData(fi...
Python
UTF-8
28,246
2.59375
3
[]
permissive
#-*- coding: utf-8 -*- '''utility functions for causality analysis''' import math import numpy as np def _tsdata_to_var(X, p): """ Calculate coefficients and recovariance and noise covariance of the optimized model order. ref: http://users.sussex.ac.uk/~lionelb/MVGC/html/tsdata_to_var.html Parame...
PHP
UTF-8
1,346
2.828125
3
[ "MIT" ]
permissive
<?php namespace OPRestclient; /** * OOP PHP REST Client * https://github.com/ocjojo/op-restclient * (c) 2017 Lukas Ehnle <me@ehnle.fyi> */ /** * Client is just a wrapper class for tcdent/RestClient * it is implemented as singleton */ class Client extends \RestClient { private $api; public function __constr...
Ruby
UTF-8
1,368
3.109375
3
[ "WTFPL" ]
permissive
require 'calculator' require 'rectangle' module Rectangles describe Calculator do describe "#union" do it "returns -1 for two nonintersecting rectangles" do rectangle1 = Rectangle.new(10,10,20) rectangle2 = Rectangle.new(50,50,10) Calculator::union(rectangle1,rectangle2).should ...
C++
UTF-8
7,242
2.671875
3
[]
no_license
#pragma once #include <assert.h> #include <fstream> #include <memory> #include <sstream> #undef max #undef min #include "cereal/cereal.hpp" #include "cereal/archives/binary.hpp" #include "cereal/archives/json.hpp" namespace Donya { class Serializer { public: enum class Extension { Binary = 0, JSON, }...
PHP
UTF-8
1,508
2.71875
3
[]
no_license
<?php namespace Dgm\Wp\Trigger; use Dgm\Wp\IHook; use Dgm\Wp\ActionHooks\TriggerRequest\IDispatcher; use Dgm\Wp\ITrigger; use Dgm\IOpts; use Dgm\Connectivity\Request\IAddress; abstract class Factory { private static $inputDecorators = []; private static $outputDecorators = []; public static function c...
Java
UTF-8
8,020
1.953125
2
[]
no_license
package in.co.santhoshiot.rigapp; import android.annotation.SuppressLint; import android.app.ProgressDialog; import android.os.AsyncTask; import android.os.Bundle; import android.os.StrictMode; import android.support.design.widget.Snackbar; import android.support.design.widget.TextInputEditText; import android.support...
Swift
UTF-8
282
2.671875
3
[]
no_license
protocol MainInteractorOutput: class { func setWeak(presenter pres: MainPresenterInput) } class MainInteractor { weak var presenter: MainPresenterInput! } extension MainInteractor: MainInteractorOutput { func setWeak(presenter pres: MainPresenterInput) { presenter = pres } }
Markdown
UTF-8
794
4.1875
4
[ "MIT" ]
permissive
## Challenge 1 #### Write down a complete C program to print the following output: ``` I am Bangladeshi. I love my country. I am proud for my country. ``` ## Challenge 2 #### Write down a complete C program and create 4 variables: (1) an integer (2) a float (3) a double (4) a character. Now assign some values to each ...
JavaScript
UTF-8
2,970
2.6875
3
[]
no_license
//console.log("wczytano plik Ui.js") class Ui { constructor() { this.clicks() } //obsługa kliknięć w Ui clicks() { $("#albums").click(function (e) { var children = $(e.currentTarget).children() children.each(function(index, element){ if(elemen...
Python
UTF-8
734
2.53125
3
[]
no_license
from scipy.signal import lfilter, find_peaks import matplotlib.pyplot as plt import numpy as np def noise_filter(signal): n = 10 b = [1.0 / n] * n a = 1 return lfilter(b, a, signal) def compute_values(): y = np.array(self.y_points) t = np.array(self.t_points) y = self.noise_fi...
JavaScript
UTF-8
1,321
2.609375
3
[]
no_license
import { useEffect, useReducer, useState } from 'react'; import apiFetch from '@/utils/apiFetch'; const dataFetchReducer = (state, action) => { switch (action.type) { case 'FETCH_INIT': return { ...state, isLoading: true, isError: false }; case 'FETCH_SUCCESS': retu...
Java
UTF-8
3,967
2.390625
2
[]
no_license
package AffiliationResolver; import java.rmi.RemoteException; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Map; import org.apache.axis2.AxisFault; import gov.nih.nlm.ncbi.www.soap.eutils.EFetchPubmedServiceStub; import gov.nih.nlm.ncbi.www.soap.eutils.EUtilsServiceSt...
C++
UTF-8
723
3.234375
3
[]
no_license
#include <iostream> #include <vector> #include <algorithm> #include <map> int countElements(std::vector<int> &arr) { int ans = 0; for (auto i = arr.begin(); i != arr.end(); ++i) { for (auto j = arr.begin(); j != arr.end(); ++j) { if (*j == *i + 1) { a...
C#
UTF-8
420
3.609375
4
[]
no_license
private Person[] _people; public GroupOfPeople() { _people = new Person[0]; } public void AddPerson(Person newPerson) { Person[] _More= new Person[_people.Length +1]; _More[_people.Length] = newPerson; _people = _More; } public void DisplayAllPeople() ...
Java
UTF-8
533
1.992188
2
[]
no_license
package com.kh.greenfood.menu.vo; import java.sql.Date; import java.util.List; import lombok.Data; @Data public class SelectMenuVO { private long snum; // SNUM NUMBER(10,0) No 1 조회번호 private Date sdate; //SDATE TIMESTAMP(6) No 2 메뉴구성일 private String sid; //SID VARCHAR2(40 BYTE) No 3 구매자 아이디 priva...
Python
UTF-8
2,456
2.71875
3
[ "MIT" ]
permissive
#!/usr/bin/env python2 import json import sys import os from subprocess import Popen, PIPE, call import shutil VENDOR_PATH = './vendor/' LOCK_FILE_PATH = './composer.lock' def getData(path): if not os.path.isfile(path): print "ERROR: composer.lock not found" exit() with open('composer.lock')...
Python
UTF-8
3,246
3.40625
3
[]
no_license
#Updated: 5/26/2019 18:21 #import regex as re #re.DEFAULT_VERSION = re.VERSION1 from lxml import html from bs4 import BeautifulSoup from collections import defaultdict from nltk import word_tokenize import nltk #nltk.download('stopwords') from nltk.stem import PorterStemmer from nltk.stem.wordnet import WordNetLemmatiz...
Python
UTF-8
498
3.1875
3
[]
no_license
limit = int(input("Please enter limit number findout fibonnaci numbers : ")) list = [] f_numbers, increase = 0, 1 while f_numbers <= limit: list.append(f_numbers) print(list) f_numbers, increase = increase, f_numbers + increase limit = int(input("Please enter limit number findout fibonnaci numbe...
Markdown
UTF-8
8,753
2.828125
3
[ "MulanPSL-2.0", "LicenseRef-scancode-mulanpsl-2.0-en", "LicenseRef-scancode-unknown-license-reference" ]
permissive
--- --- --- title: 示威支持周恩来和邓小平——天安门广场:1976年4月5日 --- 中国的清明节(每年的扫墓日)是每年祭奠亡灵的日子。离1976年清明节4月5日还有好几周的时候,“四人帮”就预感到有人会利用这个时机上街游行悼念周恩来。他们的担心是有道理的。在北京,不仅干部和学生,很多一般群众也对1月份没有为周恩来举办适当的悼念活动感到气愤,他们的确打算在清明节表达对周恩来的崇敬。 清明之前的3月25日,“四人帮”控制的上海《文汇报》发表文章批判邓小平及其“后台”,称还有另一个“走资派”。人人都明白这是指周恩来。在这件事上,“四人帮”理解民情的能力极差,因为这篇试图抹黑周恩来的文章引起了反弹。当年当过红卫兵...
Markdown
UTF-8
2,430
2.625
3
[]
no_license
Forum Analytics With Hadoop ======================== ## Improving Forum Search: Inverted index examples using Hadoop Streaming and forum data. In our initial inverted index in lesson 4 of Intro to Hadoop and MapReduce we simply created a single word index based on the body of the forum data linking back to the node(s...
C++
UTF-8
1,280
2.734375
3
[]
no_license
// CCC '01 S2 - Spirals // dmoj.ca/problem/ccc01s2 // 2017-06-25 // AC in 0.02s #include <iostream> #include <vector> #include <algorithm> using namespace std; int vv[10][10]; vector<int> v; int main() { int x = 4, y = 4, a, b; cin >> a >> b; for (int i = a; i <= b; ++i) { vv[y][x] = i; int d = i - a; ...
Markdown
UTF-8
902
2.640625
3
[ "MIT" ]
permissive
# Phaser Starter ![Phaser avatar studying](./public/assets/img/study.png) Simple starter project to get a Phaser game environment up and running with ease. With Webpack, ES6 transpiling, page reloading and Github page publishing. ## Install - Get the files by either: - Forking this repository - Downloading a [zi...
Python
UTF-8
735
2.875
3
[]
no_license
"""Address filter""" from .filter import Filter from .zip_code import ZipCodeFilter import usaddress class AddressFilter(Filter): def __init__(self): self.zip_filter = ZipCodeFilter() def filter(self, column): """ Removes addresses and pares them down to their filtered zip codes. ...
C#
UTF-8
495
2.9375
3
[ "MIT" ]
permissive
namespace TexasHoldem.UI.Console { using System; public static class ConsoleHelper { public static void WriteOnConsole(int row, int col, string text, ConsoleColor foregroundColor = ConsoleColor.Gray, ConsoleColor backgroundColor = ConsoleColor.Black) { Console.ForegroundColor =...
C++
UTF-8
1,332
3.34375
3
[]
no_license
#include "Edge.h" #include <stdio.h> #include <iostream> using namespace std; Edge::Edge() { enabled = true; r = 1.0; costo = 0; } Edge::Edge(bool hab, double prob, double cost) { enabled = hab; r = prob; costo = cost; } Edge::Edge(const Edge &a) { enabled = a.enabled; r = a.r; costo = a.costo; } Edge &E...
Markdown
UTF-8
6,213
3.40625
3
[]
no_license
# Clojourney Repo where I'll document and share my advancements in learning - [Clojourney](#clojourney) - [Language concepts](#language-concepts) - [Lists](#lists) - [Vectors](#vectors) - [Additional resources](#additional-resources) - [Exercism exercises](#exercism-exercises) - [Two-fer](#two-f...
Python
UTF-8
1,540
3.421875
3
[]
no_license
# from __future__ import annotations from typing import TypeVar, Iterable, Sequence, Generic, List, Callable, Set, Deque, Dict, Any, Optional from typing_extensions import Protocol from heapq import heappush, heappop T = TypeVar('T') def linear_contains(iterable, key): for item in iterable: if item == k...
C++
UTF-8
454
3.203125
3
[]
no_license
#include <iostream> #include <vector> #include <list> #include <forward_list> using namespace std; void fun_vector(vector<int> &l) { auto iter = l.begin(); while(iter != l.end()) { if(*iter % 2) { iter = l.insert(iter, *iter++); iter ++; iter ++; } else { iter = l.erase(iter); } } } int main() {...
PHP
UTF-8
1,774
2.515625
3
[]
no_license
<?php namespace Drupal\task_job; use Drupal\checklist\Checklist; use Drupal\checklist\Plugin\ChecklistType\ChecklistTypeInterface; use Drupal\Component\Plugin\PluginManagerInterface; use Drupal\task\Entity\Task; use Drupal\task_job\Plugin\ChecklistType\Job; /** * A checklist object for configuring a job. * * This...
C++
UTF-8
1,197
3.21875
3
[]
no_license
// // Created by LuMengLi on 2020/5/6. // //给定一颗n个结点的二叉排序树(即BST),每个结点均存放一个整数,其结点格式为[lchild][data][rchild]. // //令half=(BST中的最大值+BST中的最小值)/2。 // //设计一个算法BinTree findNearMid(BinTree *root). // //完成(1)找出BST中最大和最小值以计算half的值; // //(2) 返回大于half且与half相差最小的结点。 #include <crtdbg.h> #include <math.h> struct BinNode{ int d...
C++
UTF-8
554
2.90625
3
[]
no_license
#include <iostream> #include <vector> #include <string> using namespace std; const int N = 8; vector<int> adj[N]; vector<bool> visited; void dfs(int u){ visited[u] = true; cout << u << ' '; for(auto v : adj[u]){ if(!visited[v]){ dfs(v); } } } int main(){ visited.assig...
Java
UHC
2,906
2.453125
2
[]
no_license
package Package; //////////////ó ȭ////////////// import javax.swing.*; import java.awt.event.*; import java.util.List; import java.awt.*; public class request extends JFrame { Container contentPane; static String requestId; request() { setTitle("޿û"); contentPane = getContentPane(); contentPane...
Python
UTF-8
2,909
2.6875
3
[ "MIT" ]
permissive
import discord from discord.ext import commands from signal import SIGKILL from config import SNEKBOX_URL from utils.global_utils import cleanup_code, upload_hastebin class EvalError(commands.CommandError): def __init__(self, status, message=None): self.status = status self.message = message or ...
Python
UTF-8
1,579
3.515625
4
[]
no_license
from random import choice import re dice_pattern = re.compile("(?P<numdice>\d*)(?P<d>d)(?P<die>\d*)(?P<op>\+|\-)(?P<bonus>\d*)") class Dice(object): SIDES = 2 def __init__(self, num_rolls=1, b=0): self._nr = num_rolls self._bonus = b self._rolls = [0 for x in range(num_rolls)] ...
Java
UTF-8
533
2.890625
3
[]
no_license
import java.util.*; class Solution { public int jump(int[] nums) { int[] dp = new int[nums.length]; Arrays.fill(dp, Integer.MAX_VALUE); dp[0] = 0; for (int pos = 0; pos < nums.length; pos++) { for (int jump = 1; jump <= nums[pos]; jump++) { if (pos + jum...
C#
UTF-8
1,569
3.078125
3
[ "MIT" ]
permissive
using System; using System.Collections.Generic; using System.Linq; using Newtonsoft.Json; using Newtonsoft.Json.Linq; namespace carwings.net { // Example: "timeRequired200":{"hourRequiredToFull":5,"minutesRequiredToFull":0}, public class TimeRequiredJsonConverter : JsonConverter { public override...
Markdown
UTF-8
7,388
2.875
3
[]
no_license
# Path Planning Project Udacity Self-Driving Car Engineer Nanodegree Program --- ## Overview Path planning is a critical, complex and principal module in a self-driving vehicle, since it covers a wide range of components in autonomous car ranging from the low level actuators, sensor, to the localization and prediction ...
Java
UTF-8
1,933
1.773438
2
[]
no_license
/* * CODENVY CONFIDENTIAL * __________________ * * [2012] - [2015] Codenvy, S.A. * All Rights Reserved. * * NOTICE: All information contained herein is, and remains * the property of Codenvy S.A. and its suppliers, * if any. The intellectual and technical concepts contained * herein are proprietary to Cod...
Java
UTF-8
1,814
4.03125
4
[]
no_license
package collection; import java.util.*; // ArrayList 예제1 // ArrayList 기본 메서드 실습 public class ArrayListEx1 { public static void main(String[] args) { ArrayList list1 = new ArrayList(10); list1.add(new Integer(5)); list1.add(new Integer(4)); list1.add(new Integer(2)); list1.add(new Integer(0)); list1.a...
Markdown
UTF-8
4,269
2.75
3
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
## Spark PR Review Board [![Build Status](https://travis-ci.org/databricks/spark-pr-dashboard.svg?branch=master)](https://travis-ci.org/databricks/spark-pr-dashboard) [![devDependency Status](https://david-dm.org/databricks/spark-pr-dashboard/dev-status.svg)](https://david-dm.org/databricks/spark-pr-dashboard#info=dev...
Python
UTF-8
2,767
2.765625
3
[ "MIT" ]
permissive
#!/usr/bin/env python # -*- coding: utf-8 -*- """ File img_utils.py created on 22:39 2017/9/11 @author: Yichi Xiao @version: 1.0 """ import numpy as np import cv2 import os def img_crop_to_array(image): ''' Divide an image into 8x8 small sprites, and then convert them into numpy arrays. Shape ...
C
UTF-8
2,503
2.609375
3
[]
no_license
/* ** Copyright (c) 2005, TUBITAK/UEKAE ** ** This program is free software; you can redistribute it and/or modify it ** under the terms of the GNU General Public License as published by the ** Free Software Foundation; either version 2 of the License, or (at your ** option) any later version. Please read the COPYING f...
Markdown
UTF-8
5,189
3.328125
3
[ "MIT" ]
permissive
# C++ Snake A simple snake game written in C++ and OpenGL. **Warning:** this readme file does assume that you have some experience with Visual Studio Code, g++ and OpenGL programming. ## Table of contents 1. [Introduction](#introduction) 2. [Prerequisites](#prerequisites) 1. [Visual Studio Code Extensions](#visua...
Shell
UTF-8
2,760
3.40625
3
[]
no_license
#!/usr/bin/env bash # Use single quotes instead of double quotes to make it work with special-character passwords PASSWORD='root' PROJECT=$1 IP=$2 # update / upgrade apt-get update DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade # install ph...
Python
UTF-8
1,227
2.875
3
[]
no_license
#商铺数据处理 import pandas data = pandas.read_csv('D://002-python-minig- weizhuanye//data.csv',encoding='utf-8') #解析数据,存成列表形式 dataD = data.to_dict(orient='records') #数据的清洗 for i in data.index: data.comment[i] = data.comment[i].split(' ')[0] for i in data.index: data.price[i] = data.price[i].sp...
Java
UTF-8
274
1.617188
2
[]
no_license
package org.amway.notification.engine.constants; public class NotificationConstant { public static final String FAILURE = "FAILURE"; public static final String SUCCESS = "SUCCESS"; public static final String GCM = "GCM"; public static final String APNS = "APNS"; }
Python
UTF-8
86
3.0625
3
[]
no_license
s = 'boy' print("I am happy %s",s) print("I am happy %s"%s) print("I am happy ${s}")
C++
UTF-8
379
2.75
3
[]
no_license
#ifndef HEAP_H #define HEAP_H #include <iostream> #include <stdlib.h> #include <limits.h> class MinMaxHeap { private: int heap[1500]; int size; public: MinMaxHeap(); void buildHeap(int i); int getMinChild(int index); bool contains(int val); bool insert(int newVal); bool remove(int val); void showHeap...
Python
UTF-8
1,238
2.671875
3
[]
no_license
import numpy as np import torch.nn as nn import torch.nn.functional as F from skimage.transform import resize ## Defining the neural network. class Net(nn.Module): def __init__(self): super(Net, self).__init__() self.conv1 = nn.Conv2d(1, 4, kernel_size = 3, stride = 1, padding = 1) ...
Java
UTF-8
2,844
2.828125
3
[]
no_license
package models; import java.awt.Dimension; import java.util.LinkedList; import drawer.DrawBootstap; import drawer.Outputapplet; import main.MainFrame; /** * begin 7.3.2012 14:40 end of this 7.3.2012 16:50 * * @author rfitzner * */ @SuppressWarnings("serial") public class Bootstap_Modified exte...
Python
UTF-8
1,613
2.59375
3
[ "MIT" ]
permissive
import data.fonts.text_master class GuiText: def __init__(self, text, font_size, font, position, max_line_length, centered, loader, text_master): print("gui text test") self.text_string = text self.font_size = font_size self.font = font self.position = position ...
Java
UTF-8
502
1.78125
2
[]
no_license
package cn.hhm.workbootstraptree.dao; import cn.hhm.workbootstraptree.entity.TPart; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.stereotype.Repository; import javax.transaction.Transactional; import java.util.List; /** ...
Python
UTF-8
126
2.953125
3
[]
no_license
N = int(input()) M = list(map(int, input().split())) max_number = max(M) min_number = min(M) print(max_number * min_number)
C++
UTF-8
2,731
2.75
3
[ "MIT" ]
permissive
/* * hmc5883l.cpp * * Created: 4/4/2015 2:18:31 AM * Author: Ian */ #include <avr/io.h> #include "hmc5883l.h" #include "twi.h" #include "init.h" #include "uart.h" static uint8_t mode = HMC5883L_MODE_SINGLE; static inline void imu_setGain(uint8_t gain) { // use this method to guarantee that bits 4-0 are set to...
PHP
UTF-8
846
4.21875
4
[]
no_license
<?php // Converts array into list n1, n2, ..., and n3 function humanizedList($array, $sort=false) { if ($sort) { asort($array); $position = count($array) - 1; $array[$position] = "and " . $array[$position]; $newArray = implode(", ", $array); return $newArray; } else { $position = count($arr...
JavaScript
UTF-8
1,185
2.53125
3
[ "MIT" ]
permissive
$(document).ready(() => { asyncAddAsset(); }); function asyncAddAsset() { $('#asset-create-btn').click(function(event) { event.preventDefault(); let newAssetData = { 'name': $('input[name=name]').val(), 'manufacturer': $('input[name=manufacturer]').val(), 'm...
PHP
UTF-8
135
2.875
3
[]
no_license
<?php $arr = array(1,2,3,4); foreach($arr as $key => &$value) $value = $value * 2; var_dump($arr); $value = 26; var_dump($arr); ?>
Python
UTF-8
291
2.875
3
[]
no_license
import re # r = re.compile(r'^1[3|4|5|6|7|8|9][0-9]{9}$') r = re.compile(r'^1[3-9][0-9]{9}$') print(r.match("122222222222222")) print(r.match("185aaaaaaaaa")) print(r.match("18599999999")) print(r.match("1a536303630")) print(r.match("12536303630")) print(r.match("185363036300"))
PHP
UTF-8
2,604
3.140625
3
[ "LicenseRef-scancode-warranty-disclaimer", "MIT" ]
permissive
<?php namespace MHDev\WidgetCore; /** * @class MH_Widget * @brief Main Widget class it will create instances and call the widgets * * This class cam behave differently based on the way the different method are called: * * Normal widget work flow (behavior if the called widget is a child of MH_WidgetBase): * 1....
C
UTF-8
399
3.09375
3
[]
no_license
#include<stdlib.h> #include<stdio.h> int main() { int j,t,max,min,temp,i,n,*arr; scanf("%d",&t); while(t--) { scanf("%d",&n); arr=(int*)malloc(sizeof(int)*n); max=-1; min=1000000001; for(i=0;i<n;i++) scanf("%d",&arr[i]); for(i=0;i<n;i++) { for(j=0;j<i;j++) { if(arr[i]-arr[j] > max) ...
Java
UTF-8
3,593
2.703125
3
[]
no_license
package com.survivorserver.Civ.command; import me.ryanhamshire.GriefPrevention.Claim; import me.ryanhamshire.GriefPrevention.GriefPrevention; import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import com.survivorserver.Civ.Civ; import com.survivorserver.Civ.Sett...
Markdown
UTF-8
8,783
2.546875
3
[]
no_license
# Watson Discovery 简介 了解 Watson Discovery 服务的基础知识 **标签:** Watson Discovery,云计算,人工智能,机器学习,深度学习,自然语言处理 [原文链接](https://developer.ibm.com/zh/articles/introduction-watson-discovery/) [Richard Hagarty](https://developer.ibm.com/zh/profiles/rich.hagarty) 发布: 2019-07-08 * * * **本文纳入 [Watson Discovery 学习路径](https://develo...
JavaScript
UTF-8
1,297
2.546875
3
[]
no_license
const MaxDistance = cc.v2(540, 960).mag() cc.Class({ extends: cc.Component, properties: { dotAmount: 10, minScale: .1, dotPrefab: cc.Prefab }, onLoad () { //根据映射关系(线性函数)得到计算scale的式子,提出固定部分 this._scaleFactor = MaxDistance / (this.minScale-1) this._dots =...
Java
UTF-8
6,283
3.171875
3
[]
no_license
package hu.ak_akademia.maze; import java.util.ArrayList; import java.util.Random; public class Maze { private MazeFrame frame; private Print print = new Print(); private char[][] maze; private Player player; private Weapon weapon; private ArrayList<Enemy> enemies = new ArrayList<Enemy>(); public ...