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
885
2.84375
3
[]
no_license
# rpgMapSim The purpose of this program is to build an rpg map for use with games such as dungeons and dragons, or offsets of D&D. Current status: the current version of this application creates a user defined number of rooms, then generates a maze around the rooms. Once the maze is created, it opens a single door a...
C++
UTF-8
1,296
2.75
3
[]
no_license
#include <iostream> #include <cstdio> #include <unordered_map> using namespace std; const int MAXN = 100005; int par[MAXN] , Rank[MAXN]; void init(){ for(int i = 1 ; i <= MAXN ; i++){ par[i] = i; Rank[i] = 1; } } int root(int i){ if(par[i] == i) return i; par[i] = root(par[i]); // pa...
Java
UTF-8
4,420
1.765625
2
[]
no_license
package com.ht.extra.pojo.insurance; import java.math.BigDecimal; import java.util.Date; public class ScanPay { private BigDecimal id; private String ipAddr; private String userId; private String patientName; private String authCode; private String operaterId; private String patientI...
Java
UTF-8
2,687
3.171875
3
[]
no_license
package model; public class Tort { private int szamlalo; private int nevezo; public Tort(int szamlalo, int nevezo) { this.szamlalo = szamlalo; if (nevezo != 0) { this.nevezo = nevezo; } else { this.nevezo = 1; System.err.println("Nevezőben 0 nem ...
JavaScript
UTF-8
18,470
2.546875
3
[]
no_license
////бургер меню//////// var navburlink = document.querySelector('.nav__burger-button'); var navadapt = document.querySelector('.burgerclick'); navburlink.addEventListener('click', toggleClass); var navadaptlink = document.querySelectorAll ("a.burgerclick__link"); for (var link of navadaptlink){ link.addEvent...
TypeScript
UTF-8
831
2.703125
3
[ "ISC" ]
permissive
export abstract class SnippetFactory { constructor(protected snippet: string) { } public createSnippetWithNoBlanksAround(): string { return this.snippet .replace(/%BLANK_BEFORE%\n/g, '') .replace(/%BLANK_AFTER%\n/g, ''); } public createSnippetWithBlanksAround(): st...
Python
UTF-8
3,591
2.859375
3
[]
no_license
# @Time : 2019-04-07 11:06:48 # @Author : lemon_xiuyu # @Email : 5942527@qq.com # @File : test_login.py import unittest from common.do_excel import DoExcel # 引入读写类 from common.request import Request # 引入请求类 from common import contants, logger # 引入常量 ,同时引入两个 # from ddt import ddt, data from libext.ddtnew import...
Java
UTF-8
2,438
2.65625
3
[]
no_license
package com.ollijepp.poastr.shared.socialService; import java.util.ArrayList; import java.util.List; import com.google.inject.Inject; import com.google.inject.Singleton; import com.ollijepp.poastr.client.DataAdapter; import com.ollijepp.poastr.client.crypto.ClipperzCrypto; import com.ollijepp.poastr.shared.s...
Java
UTF-8
7,467
2.15625
2
[]
no_license
/* */ package net.risenphoenix.commons.localization; /* */ /* */ import java.io.File; /* */ import java.util.HashMap; /* */ import java.util.Map; /* */ import java.util.Map.Entry; /* */ import java.util.logging.Level; /* */ import net.risenphoenix.commons.Plugin; /* */ impor...
Python
UTF-8
3,057
3.265625
3
[]
no_license
# Importing necessary packages import tensorflow as tf import numpy as np from lr_utils import load_dataset import matplotlib.pyplot as plt %matplotlib inline # Loading the training data train_set_x_orig, train_set_y_orig, test_set_x_orig, test_set_y_orig, classes = load_dataset() train_set_x_orig.shape train_set_y_o...
Markdown
UTF-8
172
2.515625
3
[]
no_license
# pangrams ruby pangrams challenge Simple challenge to create a function that takes a sentence and returns "pangrams" if sentence is a pangram or "not pangram" if not.
Python
UTF-8
473
3.953125
4
[]
no_license
""" Write a function that changes every letter to the next letter: * "a" becomes "b" * "b" becomes "c" * "d" becomes "e" * and so on ... ### Examples move("hello") ➞ "ifmmp" move("bye") ➞ "czf" move("welcome") ➞ "xfmdpnf" ### Notes There will be no z's in the tests. """ def move...
TypeScript
UTF-8
1,938
2.734375
3
[ "MIT" ]
permissive
import "introcs"; import { SVG, Group, Color, Rectangle } from "introcs/graphics"; import { Emoji } from "./Emoji"; const searchBar: HTMLInputElement = document.getElementById("searchBar") as HTMLInputElement; function main(): void { toggle(); // calls the emoji toggle function // pageSwitch(); fakeSearch...
JavaScript
UTF-8
4,508
2.640625
3
[]
no_license
// Runner prefab class Runner extends Phaser.Physics.Arcade.Sprite{ constructor(scene, x, y, texture, frame, pointValue, direction) { super(scene, x, y, texture, frame); this.direction = direction; // add object to the existing scene scene.add.existing(this); scene.physics.ad...
C#
UTF-8
652
2.6875
3
[ "LicenseRef-scancode-unknown-license-reference", "MIT" ]
permissive
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Treton.Core.Resources { public interface IResourceLoaders { void Add(uint type, ILoader loader); void Remove(uint type); ILoader Get(uint type); } public class ResourceLoaders : IRe...
C#
UTF-8
817
2.71875
3
[]
no_license
using System; using System.Diagnostics; namespace JenkinsNotifier { public static class Utilities { public static string Base64Encode(this string plainText) { var plainTextBytes = System.Text.Encoding.UTF8.GetBytes(plainText); return System.Convert.ToBase64String(plainTextBytes...
SQL
GB18030
7,368
3.28125
3
[]
no_license
--ZLHISִУ޸zlsol룬ipʵ[SERVICE_NAME] create database link ZLSOL_DBL connect to ZLSOL identified by ZLSOL_PASSWORD using '(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.60)(PORT = 1521)) (CONNECT_DATA = (SERVICE_NAME = orcl12) ) )'; --Ժ(޸IJID7748) insert into Sol_Inf_Puerpera@ZLSOL_DBL( ...
C
UTF-8
544
2.875
3
[]
no_license
#include <stdlib.h> #include <signal.h> #include <stdio.h> #include <unistd.h> void sig_handler(int signo) { printf("received SIGUSR1\n"); } int main() { if(signal(SIGUSR1, sig_handler) == SIG_ERR){ printf("cannot catch SIGUSR1\n"); } pid_t pid; pid = fork(); if(pid==0){ while(1); } else { ...
C++
UTF-8
1,645
3.203125
3
[]
no_license
#include "SudokuJudger.h" bool SudokuJudger::judgeColumn(int x, int y, int value, int sudoku[LENGTH][LENGTH]) { for (int i = 0; i < x; i++) { if (sudoku[i][y] == value) { return false; } } return true; } bool SudokuJudger::judgeSmallSudoku(int x, int y, int value, int sudoku[LENGTH][LENGTH]) { int startX =...
Python
UTF-8
756
2.53125
3
[]
no_license
#!/usr/bin/env python3 import os import argparse import boto3 from datasets import aws_utils def upload(bucket, files, force=False): s3 = boto3.client('s3') aws_utils.upload(s3, bucket, files, force=force) if __name__ == "__main__": # Arg parsing parser = argparse.ArgumentParser(description="Uploads f...
Go
UTF-8
3,049
2.640625
3
[ "MIT" ]
permissive
package main import ( "bufio" "fmt" "go/build" "io" "os" "path" "path/filepath" "golang.org/x/tools/cover" ) func main() { if len(os.Args) != 3 { fmt.Fprintf(os.Stderr, "Usage: %s <profile> <file>\n", os.Args[0]) os.Exit(1) } profiles, err := cover.ParseProfiles(os.Args[1]) if err != nil { fmt.Fpri...
Java
UTF-8
3,353
1.648438
2
[ "Apache-2.0" ]
permissive
/* * JBoss, Home of Professional Open Source * Copyright 2011 Red Hat Inc. and/or its affiliates and other contributors * as indicated by the @authors tag. All rights reserved. * See the copyright.txt in the distribution for a * full listing of individual contributors. * * Licensed under the Apache License, Vers...
Markdown
UTF-8
1,174
3.390625
3
[]
no_license
ERROR: type should be string, got "https://katriencolson.github.io/learning-front-end/.\n\nExercise\n\nWe are going to make a calculator! The basic setup you can find in this HTML file. This calculator needs to have some basic functionality like any other calculator:\n\n Enter a number by clicking buttons 0, 1, 2, 3, ....\n Choose a basic operation +, -, *, /, % (modulo).\n Display the result of the calculation =.\n Clear any entries C.\n\nAdditionally, the buttons need to have a hover effect! But because we are learning events and not CSS, we are not going to use button:hover. Instead, we are going to use the class .hovering. We are going to add this class to and remove it from the buttons through the use of events!\n\nLastly, you need to make the calculator accept keyboard input by means of key events!\n\nHint: eval() isn't always evil!\n\nGood luck!\nRestrictions\n\nYou are not allowed add/remove/change any CSS or HTML untill the calculator is completely functional.\nGoals\n\n Understand how to select HTML elements in the DOM.\n Understand how to modify HTML elements through the DOM.\n Understand how to write a basic JS function.\n Understand how to use event listeners and event handlers.\n"
C#
UTF-8
1,291
2.734375
3
[]
no_license
using System; using System.Collections.Generic; using System.Data; using System.Data.SqlClient; using System.Linq; using System.Text; using System.Threading.Tasks; using LouisvilleSuperSubaru.Data.Interfaces; using LouisvilleSuperSubaru.Models.Tables; namespace LouisvilleSuperSubaru.Data.ADO { public class Vehicl...
Markdown
UTF-8
2,749
2.515625
3
[]
no_license
01/28/19 ## Authors: Balk, Helge and Sovegjarto, Bendik S. and Tuser, Michal and Frouzova, Jaroslava and Muska, Milan and Drastík, Vladislav and Baran, Roman and Kubecka, Jan ## Title: Surface-induced errors in target strength and position estimates during horizontal acoustic surveys. ## Keywords: acoustics, beam, surf...
Markdown
UTF-8
6,777
2.609375
3
[]
no_license
## C Bit Fields ```c type-specifier declarator(opt) : constant-expression ``` * The type-specifier for the `declarator` must be `unsigned int`, `signed int`, or `int`, and the `constant-expression` must be a nonnegative integer value. * If the value is zero, the declaration has no `declarator`. * Arrays of bit fi...
C
ISO-8859-9
5,246
2.984375
3
[]
no_license
#include <stdio.h> #include <ctype.h> #include <stdlib.h> char *morsChars[36][2]={ {"A",".-"}, {"B","-..."}, {"C","-.-."}, {"D","-.."}, {"E","."}, {"F","..-."}, {"G","--."}, {"H","...."}, {"I",".."}, {"J",".---"}, {"...
C#
UTF-8
4,634
2.59375
3
[]
no_license
namespace BusinessManagement.Services { using System; using System.Net; using System.Threading.Tasks; using ApiClient; using HydraWebUi.Services.Model; using Interfaces; using Model; using Model.DTO; using Model.StatusCodes; using Newtonsoft.Json; public class BlogTagServi...
Java
UTF-8
663
2.390625
2
[ "Apache-2.0" ]
permissive
package com.intellij.gitlab.util.result; import com.intellij.openapi.util.text.StringUtil; import org.jetbrains.annotations.Nullable; public class EmptyResult implements Result { private String response; private EmptyResult(@Nullable String response) { this.response = response; } public st...
PHP
UTF-8
1,916
2.890625
3
[]
no_license
<?php include_once(dirname(__FILE__) .'/../db/db.php'); class EmploymentDetails { // Employee Details public $code; public $job_title; public $job_category; public $employment_status; public $operating_unit; public $business_unit; public $supervisor; } class EducationBackground { ...
Python
UTF-8
2,071
3.4375
3
[]
no_license
import multiprocessing import os import time # 跳舞任务 def dance(): # 获取当前进程的编号 print("sing:", os.getpid()) # 获取当前进程 print("sing:", multiprocessing.current_process()) # 获取父进程的编号 print(f"【{multiprocessing.current_process().name}】的父进程编号:", os.getppid()) for i in range(5): print("dance.....
Ruby
UTF-8
158
3.3125
3
[ "MIT" ]
permissive
#!/usr/bin/env ruby def greet(x) print "Hello #{x}" end if __FILE__ == $0 then s = STDIN.gets while !s.nil? greet(s) s = STDIN.gets end end
Java
UTF-8
647
2.9375
3
[]
no_license
package com.thoughtworks.tdd; import java.util.Comparator; public class SuperSmartParkingBoy extends Paker implements Parkable{ public SuperSmartParkingBoy(ParkingLot... parkingLot) { super(parkingLot); } @Override public ParkingTicket parkCar(Car car) { if (getParkingLots().stream()...
C++
UTF-8
2,599
2.828125
3
[]
no_license
// // Created by Enjoeyland on 2018-05-03. // #include "Controller.h" char ControllerHandler::handleInputPin(int *pinData) { int pinUpData = pinData[0]; int pinDownData = pinData[1]; int pinLeftData = pinData[2]; int pinRightData = pinData[3]; if (pinUpData == 1){ if (pinLeftData == 0 && pinRightData == 0) ...
Markdown
UTF-8
489
2.765625
3
[]
no_license
#### - ACID 事务的原则 事务型数据库的4个特点 - A (原子性)事务作为一个整体,要么一起死,要么一起生 - C (一致性)事务确保数据库的状态从一个一致状态转变为另一个状态 - I (隔离性)多个事务同时执行,但是我们互相执行,你走你的阳关道,我走我的独木桥 - D (持久性)已提交的事务对于数据库的修改是持久性的,不能只有3秒钟,是男人就坚持下来
Java
UTF-8
10,749
2.484375
2
[]
no_license
package com.yetistep.delivr.util; import org.apache.log4j.Logger; import javax.imageio.IIOImage; import javax.imageio.ImageIO; import javax.imageio.ImageWriteParam; import javax.imageio.ImageWriter; import javax.imageio.stream.FileImageOutputStream; import java.awt.*; import java.awt.image.BufferedImage; import java....
JavaScript
UTF-8
1,336
2.796875
3
[]
no_license
(function () { var euler = EulerFactory.getInstance(); euler.addFunction(function (...args) { // var _largeFibonacci = euler.constructor.utils.largeFibonacci; var i = 2; var length = 0; var j = 0; for (i; i<args[0]; i++) { var usedRemainders = []; ...
Go
UTF-8
775
2.6875
3
[]
no_license
package decoders import ( "github.com/jcw/flow" ) func init() { flow.Registry["Node-outdoorClimate"] = func() flow.Circuitry { return &OutdoorClimate{} } } // Decoder for the "OutdoorClimate" sketch. Registers as "Node-outdoorClimate". type OutdoorClimate struct { flow.Gadget In flow.Input Out flow.Output } /...
C#
UTF-8
4,597
2.890625
3
[]
no_license
using Patterns.ChainOfResponsibility; using Patterns.Decorator; using Patterns.Facade; using Patterns.FactoryPattern.VehicleFactory; using Patterns.FamilyTax; using Patterns.FamilyTax.Calculator; using Patterns.FamilyTax.Entity; using Patterns.FamilyTax.Hub; using Patterns.Proxy; using Patterns.Strategy; using System;...
Python
UTF-8
257
3.15625
3
[]
no_license
import re def openFile(name): a = [] b = [] file = open(name, 'r') strings = file.read() for string in strings.split('\n'): x, y = (re.split('\s+', string)) a.append(float(x)) b.append(float(y)) return a, b
C++
UTF-8
11,166
3.21875
3
[]
no_license
/* * Skeleton code for project 3 in EE205 2018 Fall KAIST * Created by Wan Ju Kang. */ #include "rb_tree.h" #include <iostream> #include <string> #include "linked_list.h" using namespace std; /******************************************************/ /******************** CLASS BASICS ********************/ /**********...
Shell
UTF-8
3,723
4.03125
4
[]
no_license
#!/bin/bash ########### # Uploads a single app in the 'products' folder to TestFairy. ########### # default values for optional parameters TESTER_GROUPS="" AUTO_UPDATE="on" MAX_DURATION="10m" VIDEO="off" COMMENT="" VAMS="off" NOTIFY="off" OPTIONS="" usage() { echo "Usage: upload-to-testfairy.sh -a <App Name> [ -t <T...
Markdown
UTF-8
629
2.515625
3
[]
no_license
Assignment 2: Augmented Reality Movie Player See results/movie_t1 for final results. The movie is overlayed onto a book, and stays on top of the book even as the camera moves around and the book changes orientation. This is done using the BRIEF feature detector to get point pairs and find the position of the book. ...
C++
UTF-8
6,956
2.9375
3
[]
no_license
//----------------------------------------------------------------------- // Pthreads matrix multiply // This creates a stupid amount of threads to inefficiently // perform matrix multiplication. The point of this is to // create a workload with a large number of threads competing over // a shared resource //---...
JavaScript
UTF-8
831
2.65625
3
[]
no_license
const Engine = Matter.Engine; const World = Matter.World; const Bodies = Matter.Bodies; const Body = Matter.Body; var wall1,wall2,wall3,ground,paper; function preload() { } function setup() { createCanvas(800, 740); engine = Engine.create(); world = engine.world; //Create the Bodies Here. wall1 = new wal...
Java
UTF-8
592
1.890625
2
[]
no_license
package com.example.hotelin_android.modul.preview_booking; import com.example.hotelin_android.base.BaseFragmentHolderActivity; public class PreviewBookingActivity extends BaseFragmentHolderActivity { @Override protected void initializeFragment() { initializeView(); String check_in = getIntent(...
Markdown
UTF-8
1,362
3
3
[]
no_license
# hello-dropwizard Thanks for giving the opportunity to perform this exercise. # Introduction Considering this as a dev environment, I have made the setup automated and deployment the API in local totally stress free. I have used the docker-compose to collaborate the Container for the API app and Nginx for handling ...
C++
UTF-8
554
2.703125
3
[ "MIT" ]
permissive
#include <cpplib/stdinc.hpp> bool check(int a, int b, int c){ return a+b>c and a+c>b and b+c>a; } int32_t main(){ desync(); int t; cin >> t; while(t--){ int n; cin >> n; vii arr(n); for(int i=0; i<n; ++i){ cin >> arr[i].ff; arr[i].ss = i+1; ...
Python
UTF-8
481
2.765625
3
[]
no_license
import os for name in ['training', 'testing']: with open('mnist_dataset_{}.csv'.format(name), 'w') as output_file: print('=== creating {} dataset ==='.format(name)) output_file.write('image_path,label\n') for i in range(10): path = 'mnist_png/{}/{}'.format(name, i) fo...
Java
UTF-8
1,004
2.109375
2
[]
no_license
package com.ajs.speech.Activities; public class meechInit { private String mUid; private String title; private String content; private String uniqId; public meechInit() { } // ^ Firebase needs meechInit() here ^ public meechInit(String mUid, String title, String content, String uniq...
Markdown
UTF-8
9,586
2.875
3
[ "MulanPSL-2.0", "LicenseRef-scancode-mulanpsl-2.0-en", "LicenseRef-scancode-unknown-license-reference" ]
permissive
--- --- --- title: 第五章 乐莫乐兮心相知 --- 琴言衣带微招,就宛如一片紫云落了下来,片尘不起。 她向吴越王盈盈一礼,道:“王爷取笑了,琴言哪里有这么大的胆子。不过琴言猜王爷也没有这么大的胆子……” 她抬头一笑,看了吴越王一眼,道:“若是琴言这样的怀心肠做了皇帝的嫔妃啊,就怕第一天就忍不住撺掇着皇帝杀了王爷,第二天就让你的老皇帝死在我的手上哩,那多不好呢?我这个人就喜欢看着大家都欢欢喜喜的,才不想谁不开心呢。”她言语之中略带了点吴侬之音,姣姣软软,说不出的妩媚好听。 吴越王淡淡笑道:“只要琴言姑娘答应了,我保证这些事情一概不会发生!” 琴言道:“噢,那琴言就更是不敢去了。嫁了老皇帝不弄死他我不开...
Java
UTF-8
385
1.96875
2
[]
no_license
package com.example.demo.repository; import com.example.demo.entity.Coin; import org.springframework.data.jpa.repository.JpaRepository; import java.util.List; public interface CoinRepository extends JpaRepository<Coin, Long> { List<Coin> findAllByMarketIdEquals(long id); List<Coin> findAllByNameEquals(Strin...
Python
UTF-8
1,233
3.5
4
[]
no_license
def print_first_line(textfile: str): my_file = open(textfile, mode='r') print(my_file.readline()) my_file.close() def print_fifs_line(textfile: str): my_file = open(textfile, mode='r') for _ in range(4): my_file.readline() print(my_file.readline()) my_file.close() def print_five_...
JavaScript
UTF-8
1,687
3.4375
3
[]
no_license
let movieList = []; let movieInput = document.querySelector('input[type="text"]'); let ul = document.querySelector("ul"); function createElement(tag, props = {}, [...children]) { let elm = document.createElement(tag); console.log(Array.isArray(children)); children.forEach((c) => { if (typeof c === "string") { ...
Java
UTF-8
463
2.171875
2
[]
no_license
package com.xhs.mlecg; public class GlobalConfig { private static GlobalConfig instance = null; private String url = ""; private GlobalConfig() { } public static GlobalConfig getInstance() { if (instance == null) { instance = new GlobalConfig(); } return instan...
Java
UTF-8
3,762
2.234375
2
[]
no_license
package pageObjects; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; /** * The page object for the Accordian Widget page Implemented locating through xpath * only when no other means applied. * * @author jPayne */ public class Accordion extends BasePage { /** * The main ac...
Java
UTF-8
308
1.8125
2
[]
no_license
package org.gradle.test.performancenull_468; import static org.junit.Assert.*; public class Testnull_46713 { private final Productionnull_46713 production = new Productionnull_46713("value"); @org.junit.Test public void test() { assertEquals(production.getProperty(), "value"); } }
PHP
UTF-8
1,987
2.78125
3
[ "MIT" ]
permissive
<?php /** * Slack API - api method implementation. * * @author Hiroki Yagyu. * @link https://github.com/HirokiYagyu/Slack * @package Slack.Controller.Component * @since SlackPlugin v1.0.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ A...
PHP
UTF-8
360
2.578125
3
[]
no_license
<?php $filename = 'admin/playlist'; $playlist = array(); if (file_exists($filename)) { $file = fopen($filename, "r"); while (!feof($file)) { $line = trim(fgets($file)); if (empty($line)) continue; $playlist[] = explode('===',$line); }; fclose($file);...
Markdown
UTF-8
1,388
2.875
3
[ "MIT" ]
permissive
--- tags: programming layout: post title: "Give scripting languages their due" --- <a href="http://www.infoworld.com/article/03/02/06/06stratdev_1.html?s=tc">Shipping the Prototype</a> - Udell with another great column on why glue -- and more importantly, agile glue -- is so important when everything is moving licke...
Java
UTF-8
35,915
1.804688
2
[ "Apache-2.0" ]
permissive
/* * Copyright 2015, The Querydsl Team (http://www.querydsl.com/team) * * 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 ...
C
UTF-8
538
3.046875
3
[]
no_license
#include <omp.h> #include <stdio.h> void main(int argc, char *argv[]) { int plus, minus; int a = 2; int b = 4; #pragma omp parallel num_threads(3) { #pragma omp sections { #pragma omp section { plus = a + b; printf...
JavaScript
UTF-8
160
2.9375
3
[]
no_license
let _ = require('lodash'); // array element length let a = [1, '2', 3, '4']; let sum = _(a).map((el)=>{return parseFloat(el)}).sum(a); console.log(sum); // 10
Markdown
UTF-8
3,009
3.484375
3
[ "MIT" ]
permissive
参考 - Algorithms [Robert Sedgewick Kevin Wayne] 2-1-2 - https://algs4.cs.princeton.edu/21elementary/Selection.java.html - [912. 排序数组](https://leetcode-cn.com/problems/sort-an-array/) # SelectionSort ## 算法描述 - 首先,找到数组中最小的那个元素, - 其次,将它和数组的第一个元素交换位置(如果第一个元素就是最小元素那么它就和自己交换) 。 - 再次,在剩下的元素中找到最小的元素 ,将它与数组的第二个元素交换位置 。 ...
TypeScript
UTF-8
2,704
2.671875
3
[]
no_license
import THREE = require('three') import * as Model from './model' import * as Light from './light' import * as Interact from './interact' import * as R from 'ramda' const modelCount = 500 const lightCount = 10 export interface IThreeObjects { readonly scene : THREE.Scene readonly camera : THR...
PHP
UTF-8
851
2.5625
3
[ "MIT" ]
permissive
<?php use Illuminate\Support\Facades\Schema; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class CreateTeklifsTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('teklifs', funct...
Markdown
UTF-8
3,280
2.71875
3
[ "MIT" ]
permissive
# TreeD [![TreeD on PyPI](https://img.shields.io/pypi/v/treed.svg)](https://pypi.python.org/pypi/treed) ### Visual representation of the branch-and-cut tree of SCIP using spatial dissimilarities of LP solutions -- [Interactive Example](http://www.zib.de/miltenberger/treed-showcase.html) --- ![Example](res/treed-exa...
Markdown
UTF-8
2,468
2.703125
3
[]
no_license
--- layout: post title: "Baby Songs" tagline: songs to jam to while pregnant category: tags: - style: | body { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; } --- Paula and I are expecting a baby girl to arrive sometime this month! Here's a list of jams we've had fun rocking out to throughout ...
PHP
UTF-8
4,194
2.640625
3
[]
no_license
<?php require_once 'Includes/connection.php'; include 'header.php'; if (!isset($_SESSION['username']) || empty($_SESSION['username'])) { header("location: login.php"); exit; } $msg=""; if (!empty($_GET['msg'])) { $msg = $_GET['msg']; } if ($_SERVER['REQUEST_METHOD'] =='POST') { if (isset($_POS...
C#
UTF-8
1,329
2.96875
3
[]
no_license
public class Room { public bool IsAvailable {get; set;} public RoomType RoomType {get; set;} public int RoomNo {get; set;} public int Floor {get; set;} public string RoomName {get; set;} } public enum RoomType { Single, Double, ...
Markdown
UTF-8
1,096
2.703125
3
[ "BSD-3-Clause" ]
permissive
# Simple Memory Cards Trainer written in Elm Goal of the project is to provide a simple cards trainer with several question types like multiple choice, free choice, memory like combination or free text. - Practice the elm programming language: user interactivity, animations, server communication, JavaScript interop - ...
Markdown
UTF-8
5,043
3.15625
3
[]
no_license
--- title: "Puppet with a Agent-Master architecture" date: 2022-07-13T11:21:15+01:00 draft: false categories: ["Infrastructure"] tags: ["Puppet", "Configuration management"] --- There are many resources out there which—rightly—focus on teaching Puppet using simple architectures, e.g. a single node, masterless setup. H...
Python
UTF-8
966
2.765625
3
[]
no_license
from abc import ABC, abstractmethod import z3 class Sort(ABC): @abstractmethod def to_z3(self) -> z3.SortRef: pass @abstractmethod def to_c(self) -> str: pass class _TypeEq: def __eq__(self, other): return type(self) == type(other) def __repr__(self) -> str: ...
Java
UTF-8
3,510
2.59375
3
[]
no_license
package com.tufypace.yaedabot.utils; import android.content.Context; import android.content.SharedPreferences; public class SharedPreferencesDefaultProvider implements SharedPreferencesProvider { public final String PREFS = "yandex_prefs"; public final int PREFS_MODE = 0; public Context mContext; pub...
Python
UTF-8
3,134
3.140625
3
[]
no_license
#!/usr/bin/env python3 import pandas as pd from sklearn import datasets from sklearn.preprocessing import scale import seaborn as sns import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split import numpy as np from sklearn.neighbors import KNeighborsClassifier iris = datasets.load_iris() ...
Java
UTF-8
877
2.28125
2
[]
no_license
package com.lzl.netty.chapter10fileserver.httpxml.codec; import io.netty.channel.ChannelHandlerContext; import io.netty.handler.codec.http.DefaultFullHttpResponse; import io.netty.handler.codec.http.HttpResponse; import java.util.List; /** * @author lizanle * @Date 2019/2/27 14:30 */ public class HttpXmlResponseD...
Python
UTF-8
558
3.203125
3
[]
no_license
from Domain.getter import getApart def delAllSpendings(apartNumber, spendingsList): ''' This function deletes all the spendings for a given apartment :param apartNumber: - int - the apartment number of the wanted spending :param spendingsList: - list - the spendings list :return: - ''...
Java
UTF-8
911
3.46875
3
[]
no_license
import java.util.HashSet; import java.util.Set; public class SherlockAndValidString { public static void main(String[] args) { System.out.println(isValid("aabbccddeefghi")); } static String isValid(String s) { s = s.toLowerCase(); int[] count = new int[26]; for (int i = 0; ...
Java
UTF-8
2,142
2.53125
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 DAO; import MODEL.Departamento; import MODEL.PublicacaoArea; import java.sql.PreparedStatement; import java.sql.ResultSet; imp...
Java
UTF-8
451
2.390625
2
[]
no_license
package com.akivaliaho; import com.akivaliaho.config.annotations.Interest; import org.springframework.stereotype.Component; /** * Created by akivv on 1.5.2017. */ @Component public class SuperCalculator { @Interest(receives = CalculateSuperHardSumEvent.class) public CalculateSuperHardSumResultEvent calculat...
Java
UTF-8
367
2.234375
2
[]
no_license
package ejercicio5; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JOptionPane; public class App { private Frame ventana; App() { ventana = new Frame(); ventana.setLocationRelativeTo(null); ventana.setVisible(true); } public static void ...
JavaScript
UTF-8
5,157
3.59375
4
[]
no_license
const fs = require('fs'); let userlist = []; const user = function(name, age, eyeColor, friends = [], index = 0) { return { index: index, age: age, eyeColor: eyeColor, name: name, friends: friends } } // Load json file const loadUsers = function() { fs.readFile("./users.json", function(error, data) { ...
Python
UTF-8
498
3.578125
4
[]
no_license
def minimumBribes(q): res = 0 while True: for i, (x, y) in enumerate(zip(q, q[1:]), 1): if (x - y) > 2: return "Too chaotic" if x > y: res += 1 q[i], q[i-1] = q[i-1], q[i] break else: return res...
Java
UTF-8
1,391
2.53125
3
[]
no_license
package pl.limitless.security; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.validation.Errors; import org.springframework.validation.ValidationUtils; import org.springframework.validation.Validator; import pl.limitless.model....
C++
UTF-8
970
2.609375
3
[]
no_license
#ifndef UCT_h #define UCT_h #include <utility> #include <ctime> #include <memory> #include "Config.hpp" #include "Point.h" class Board; class TreeNode; class UCT { public: static double defaultPolicy(TreeNode *nowNode); static TreeNode *treePolicy(TreeNode *nowNode); static Point* UCTSearch(const int* boardSta...
Python
UTF-8
5,357
2.515625
3
[]
no_license
#!/usr/bin/env python3 # Copyright (c) 2019, Cameron Hochberg # All rights reserved. # # Author: Cameron Hochberg # Date: 07/2019 # Homepage: https://github.com/Susanou # Email: cam.hochberg@gmail.com # import sys, os import matplotlib.pyplot as plt import numpy as np import joblib from sklearn.feature_extraction....
Python
UTF-8
1,756
2.515625
3
[ "Apache-2.0" ]
permissive
import os import pytest from itertools import chain from src.Graph import Graph from src.CFGrammar import CFGrammar from src.RFA import RFA from src.Utils import read_graph, parse_pairs import src.cfpq as cfpq DATA_PATH = os.path.join(os.getcwd(), 'tests/data/cfpq') grammars_name = ["grammar_1_parentheses.txt", "gram...
Markdown
UTF-8
3,984
2.578125
3
[ "MIT" ]
permissive
## Github-action 깃헙액션을 사용한 경험에 대해 작성해보고자 한다. 일단 `aws amplify` 로 기존에 프론트를 배포하고있었다. amplify CLI를 통해서 수동배포를 하고있었는데 이 부분을 깃헙액션을 통해 CI/CD 를 구축해보고자 한다. [amplify-cli-action](https://github.com/marketplace/actions/amplify-cli-action) 이라는 깃헙 액션 워크플로우 템플릿을 base로 yml을 작성했다. 깃헙액션 탭에 들어가면 기본적으로 많이쓰이는 템플릿을 제공하는데 그외에도 [github-...
Java
UTF-8
2,968
2.5625
3
[]
no_license
package com.example.homework3cats; import androidx.room.Entity; import androidx.room.Ignore; import com.google.gson.annotations.SerializedName; import java.io.Serializable; import java.util.ArrayList; //model for cats @Entity public class Cat implements Serializable { //array public ArrayList<Cat> cats; ...
C++
UTF-8
1,166
2.65625
3
[ "MIT" ]
permissive
class Solution { public: int minJumps(vector<int>& arr) { const int N = arr.size(); const int INF = 1e9; unordered_map<int, vector<int>> posOf; for(int i = 0; i < N; ++i){ posOf[arr[i]].push_back(i); } vector<int> dist(N, INF);...
Python
UTF-8
945
2.984375
3
[]
no_license
import numpy as np import sys def counting_sheep(N): init_set = set() desti_set = set(['0','1','2','3','4','5','6','7','8','9' ]) #print desti_set #desti_set.remove('1') #print desti_set if N == 0 : return 'INSOMNIA' i = 0; while len(desti_set) != 0 : i=i+1 ...
Python
UTF-8
365
3.421875
3
[]
no_license
# Loads a CSV file into a list def load_csv(filename): dataset = [] # Values in a data point are separated by a delimiter (comma, space, tab, etc.) delimiter = ',' file = open(filename, 'r') for line in file: if not line: continue line = line.split(delimiter) data...
Java
UTF-8
769
2.203125
2
[]
no_license
package com.bosch.wrd.export.pdf; import java.io.IOException; import java.io.InputStream; import com.bosch.wrd.dto.ProjectReviewDto; import com.bosch.wrd.dto.StearingCommiteeDto; import com.itextpdf.text.DocumentException; public class ExportPdfImpl implements ExportPdf { @Override public InputStream exportProjec...
C#
UTF-8
2,433
2.53125
3
[ "CC-BY-4.0", "GPL-2.0-only", "MIT" ]
permissive
/* KeePass Password Safe - The Open-Source Password Manager Copyright (C) 2003-2022 Dominik Reichl <dominik.reichl@t-online.de> 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 versi...
Java
GB18030
2,579
2.421875
2
[]
no_license
package org.lance.demo; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.List; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.EditText; import android.widget.ListVie...
Java
UTF-8
1,468
2
2
[]
no_license
package com.icloud.model.signup; import java.util.Date; /** * 报名记录 * @author leiyi * */ public class SignUpRecord { private String id; private String nick; private String headerImg; private String phone; private String email; private String name; private String signUpConfigId; private Date createTime; ...
Shell
UTF-8
177
2.734375
3
[]
no_license
#!/bin/bash DOCKERFILE="Dockerfile" if [[ "$(uname -m)" == "arm"* ]]; then DOCKERFILE="Dockerfile.arm" fi docker build \ -t object-detection-server \ -f ../$DOCKERFILE ..
Java
UTF-8
901
3.125
3
[]
no_license
/** * Created by Murat on 20.12.2016. */ public class Tupel { private int houseNo; private String part; private String componentName; public Tupel(String componentName, int houseNo, String part) { this.componentName = componentName; this.houseNo = houseNo; this.part = part...
TypeScript
UTF-8
5,012
2.515625
3
[]
no_license
/// <reference path="../.d.ts" /> import * as applicationSettingsModule from "application-settings"; import {Constants} from "../constants"; import {Notifications} from "../utilities/notifications"; import {StatusCodes} from "../utilities/statusCodes"; import * as http from "http"; class Authentication { private ...
Java
UTF-8
766
2.71875
3
[]
no_license
package com.mikeivan.apps.scatternotes; /** * Created by Mivan on 9/19/2016. * * This class is to be used with an adapter class for viewing movies * in a scrollview */ public class MovieEntry { // Only a subset of the movie row is used for display/data for intents // _id of movie // title of movie ...