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
Shell
UTF-8
684
3.203125
3
[ "MIT" ]
permissive
#!/bin/bash -l rvm use 2.5.8 rvm --force gemset delete cfn_model rvm gemset use cfn_model --create gem uninstall cfn-model -x gem build cfn-model.gemspec gem install cfn-model-0.0.0.gem --no-ri --no-rdoc mkdir aws_sample_templates || true pushd aws_sample_templates wget https://s3-eu-west-1.amazonaws.com/cloudformat...
JavaScript
UTF-8
7,892
2.59375
3
[]
no_license
var width = window.innerWidth; var height = window.innerHeight; var wm = new WeakMap(); var context; var analyser; class MusicManager { constructor(foxes,rabbits) { this.MEDIA_ELEMENT_NODES = new WeakMap(); this.foxes = foxes; this.rabbits = rabbits; this.audio = null; this.conte...
Markdown
UTF-8
1,359
2.5625
3
[]
no_license
<a href="https://truyentiki.com/nu-than-toi-cua-cuong-te.33785/" title="Nữ Thần Tới Cửa Cuồng Tế"><h1>Nữ Thần Tới Cửa Cuồng Tế</h1></a><div style="display:table"><img align="right" style="float: left; padding: 10px;" src="https://truyentiki.com/a/img/str/src/33785.jpg" alt="Nữ Thần Tới Cửa Cuồng Tế">Ông trở về nhà như ...
Java
UTF-8
1,468
3.078125
3
[]
no_license
package org.wcy123.rxjava1; import org.junit.Test; import rx.Observable; import rx.Observer; import rx.observers.Observers; public class JustTest { @Test public void main1() throws Exception { final Observable<String> observable = Observable.just("hello world"); final Observer<Object> observe...
Python
UTF-8
1,961
3.890625
4
[]
no_license
""" The n-queens puzzle is the problem of placing n queens on an n x n chessboard such that no two queens attack each other. Given an integer n, return all distinct solutions to the n-queens puzzle. Each solution contains a distinct board configuration of the n-queens' placement, where 'Q' and '.' both indicate a que...
PHP
UTF-8
901
2.890625
3
[]
no_license
<?php class Csoport { private $azonosito; private $nev; private $admin_felhasznalo; /** * @return mixed */ public function getAzonosito() { return $this->azonosito; } /** * @param mixed $azonosito */ public function setAzonosito($azonosito) { ...
C
UTF-8
500
2.609375
3
[]
no_license
#pragma once #include <stdio.h> #include <uthash.h> /* Removes every element from the hashtable and calls free(3) on it * ty: Element type of the table * hashtable: The table */ #define CLEAR_AND_DELETE(ty, hashtable)\ do {\ ty *cur, *tmp;\ HASH_ITER(hh, hashtable, cur, tmp) { \ HASH_DEL(hashtable,...
Python
UTF-8
407
4.71875
5
[]
no_license
#An example of using a for loops students = ["Alice", "Dan", "Suzie"] for student in students: print(student)#prints out each student is the list x = "Hello" for char in x:#prints out every char in what is stored in x print(char) y = list(range(1,11)) print(y) for i in y:#prints out 1-10 print(i) for i ...
JavaScript
UTF-8
1,305
2.671875
3
[]
no_license
import React, { Component } from 'react'; class ToyForm extends Component { state = { name: "", image: "" } handleChange = (e) => { let t = e.target this.setState({ [t.name]: t.value }) } handleSubmit = (e) => { const { appSubmitHandler } = this.props e.preventDefaul...
PHP
UTF-8
5,171
2.609375
3
[]
no_license
<?php /** * Fichier source de la classe CohortepdfsShell. * * PHP 5.3 * * @package app.Console.Command * @license CeCiLL V2 (http://www.cecill.info/licences/Licence_CeCILL_V2-fr.html) */ App::uses( 'XShell', 'Console/Command' ); App::uses( 'Component', 'Controller' ); App::uses( 'GedoooComponent', 'Ge...
C++
UTF-8
4,703
2.5625
3
[ "MIT" ]
permissive
#pragma once #include "PCH.h" namespace SlimShader { enum class OperandType { /// <summary> /// Temporary Register File /// </summary> Temp = 0, /// <summary> /// General Input Register File /// </summary> Input = 1, /// <summary> /// General Output Register File /// </summary> Output = 2,...
Java
UTF-8
1,993
3.5625
4
[]
no_license
package sample; import java.util.ArrayList; public class Snake { ArrayList<tetrominoes> cordinates = new ArrayList<>(); public Snake(){ cordinates.add(new tetrominoes(0,1)); cordinates.add(new tetrominoes(0,2)); cordinates.add(new tetrominoes(0,3)); cordinates.add(new t...
Java
UTF-8
442
2.9375
3
[]
no_license
package predconssupp; import java.util.Arrays; import java.util.List; import java.util.function.Consumer; public class ConsumerDemo { public static void main(String[] args) { // Consumer<Integer> con =(integer) -> System.out.println("Printing:"+ integer); // con.accept(10); List<Integer> l...
Ruby
UTF-8
2,345
2.53125
3
[]
no_license
# This file should contain all the record creation needed to seed the database with its default values. # The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup). # # Examples: # # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) # Ch...
Rust
UTF-8
315
3
3
[]
no_license
pub mod camera; /// The current game state that the player is experiencing. #[derive(Copy, Clone)] pub enum ViewState { Spatial, System, } impl Default for ViewState { fn default() -> Self { ViewState::Spatial } } #[derive(Default)] pub struct GameState { pub view_state: ViewState, }
C#
UTF-8
1,257
2.546875
3
[]
no_license
using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace Clinic { public partial class AppointmentsPanel : UserControl, IAppointmentsPanelView ...
Python
UTF-8
2,209
3.46875
3
[]
no_license
__author__ = 'zl' from functools import reduce import math """ python 高阶函数 Higher-order function """ def f_map1(): """ map() 函数 每一项单独取出来处理作用在函数上 :return: """ # 将一个list 每项 x2 ls = [2, 4, 5, 1, 8] def x2(i): return i*2 # r = map(x2, ls) r = map(lambda x:x*2, ls) print(...
C++
UTF-8
3,971
3.21875
3
[ "MIT" ]
permissive
//////////////////////////////////////////////////////////////////////////////// // // Udacity self-driving car course : unscented Kalman filter project. // // Author : Charlie Wartnaby, Applus IDIADA // Email : charlie.wartnaby@idiada.com // ///////////////////////////////////////////////////////////...
PHP
UTF-8
8,875
3.421875
3
[]
no_license
<?php namespace Common\Tool; /** * Simple FTP client class. * * Contains methods to: * - create connection (ftp, ssl-ftp) * - close connection * - get connection * - login * - upload file from string * - upload file from path * - get the current directory name * - change to the parent directory * ...
Python
UTF-8
82,908
2.5625
3
[ "MIT" ]
permissive
''' Extensions to Matplotlib, including 3D plotting and plot customization. Highlights: - :func:`sc.plot3d() <plot3d>`: easy way to render 3D plots - :func:`sc.boxoff() <boxoff>`: turn off top and right parts of the axes box - :func:`sc.commaticks() <commaticks>`: convert labels from "10000" and "1e6" to ...
C#
UTF-8
2,056
3.125
3
[]
no_license
using System; using System.Collections.Generic; namespace GildedRose.Inventory.Items.Abstract { public class Item : IEquatable<Item> { public string Name { get; set; } public int SellIn { get; set; } public int Quality { get; set; } protected int _qualityDegradeRate; p...
Python
UTF-8
7,481
2.71875
3
[]
no_license
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from __future__ import division from pylab import * import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import LinearSegmentedColormap import matplotlib as mpl import scipy.linalg as LA from matplotlib.animation import FuncAnimation import csv import...
TypeScript
UTF-8
277
2.5625
3
[]
no_license
import bcrypt from "bcrypt" export class UserUtils{ static async hashPassword(password:string){ return await bcrypt.hash(password, 10); } static async isPasswordMatch(password:string, hash:string){ return bcrypt.compare(password, hash); } }
C#
UTF-8
3,561
3.375
3
[ "Apache-2.0" ]
permissive
using System; namespace DataFilters.Grammar.Syntax { /// <summary> /// A <see cref="FilterExpression"/> implementation that can holds a datetime value /// </summary> public sealed class DateTimeExpression : FilterExpression, IEquatable<DateTimeExpression>, IBoundaryExpression { /// <summar...
Java
UTF-8
981
2.390625
2
[ "BSD-3-Clause" ]
permissive
// Copyright (c) 2014 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. package org.cef.callback; import java.util.Vector; /** * Callback interface for asynchronous continuation of file dialog request...
Java
UTF-8
286
2.203125
2
[]
no_license
package br.com.sistemaescolar.observer; import br.com.sistemaescolar.model.Disciplina; public interface SubjectDisciplina { public void addObserver(ObserverDisciplina o); public void removeObserver(ObserverDisciplina o); public void notifyObservers(Disciplina disciplina); }
Java
UTF-8
262
1.664063
2
[]
no_license
package com.toutiao.proxyserver.d; public interface a { void a(String str, String str2, String str3); void b(String str, String str2, String str3); void c(String str, String str2, String str3); void d(String str, String str2, String str3); }
Java
ISO-8859-1
793
3.8125
4
[]
no_license
package org.formation.fonctionnelle; import java.util.Scanner; public class GuessNumber { public static void main(String[] args) { System.out.println("Le but du jeu est de trouver un nombre entre 0 et 1000"); int nbMystre = (int) (Math.random() * 1001); // System.out.println("nbMystre : " + nbMystre)...
C++
UTF-8
847
2.984375
3
[]
no_license
class Solution { unordered_set<string> memo; int ans; int size; public: int maxUniqueSplit(string s) { size=s.size(); ans=0; memo.clear(); dfs(s,0); return ans; } void dfs(string &s,int start) { //剪枝:假设后面最优情况,每个字母都可以唯一拆分,还是没ans大,也就没必要回溯了 ...
C
UTF-8
14,207
2.71875
3
[]
no_license
#include<stdio.h> #include<string.h> #include<stdlib.h> #include<sys/types.h> #include<sys/socket.h> #include<netinet/in.h> #include <netdb.h> #include <errno.h> #include <unistd.h> #include <time.h> typedef unsigned int dns_rr_ttl; typedef unsigned short dns_rr_type; typedef unsigned short dns_rr_class; typedef unsig...
C++
UTF-8
3,378
2.734375
3
[]
no_license
#include "lissajous.h" #include "ui_lissajous.h" #include <math.h> Lissajous::Lissajous(QWidget *parent) : QMainWindow(parent), ui(new Ui::Lissajous), chart(), axisX(), axisY(), splineSeries(), scatterSeries(), points(), timer(this), amplitudeA(1), frequencyA(1), phaseA(0), ...
Python
UTF-8
920
2.53125
3
[]
no_license
from html.entities import codepoint2name from urllib.request import urlopen as uReq from bs4 import BeautifulSoup as soup hackathonLinks = [line.strip() + '/submissions?page=' for line in open('hackathons.txt', 'r')] print(hackathonLinks) submissionLinks = set() for link in hackathonLinks: pageNum = 1 while True: ...
Java
UTF-8
4,070
2.453125
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. */ import java.io.IOException; import java.io.Serializable; import java.sql.Connection; import java.sql.DriverManager; impo...
C#
UTF-8
1,542
2.75
3
[ "MIT" ]
permissive
using System; using Xamarin.Forms; namespace XamKit { public class TouchEffect : RoutingEffect { public event TouchActionEventHandler TouchAction; public TouchEffect() : base("XamKit.TouchEffect") { } public void OnTouchAction(Element element, TouchActionEventArgs arg...
Java
UTF-8
2,127
2.515625
3
[ "Apache-2.0" ]
permissive
/* * Copyright (C) 2015 Actor LLC. <https://actor.im> */ package im.actor.runtime.js.threading; import im.actor.runtime.actors.ActorTime; import im.actor.runtime.actors.dispatch.AbstractDispatchQueue; import im.actor.runtime.actors.dispatch.AbstractDispatcher; import im.actor.runtime.actors.dispatch.Dispatch; impor...
PHP
UTF-8
2,324
2.53125
3
[ "MIT" ]
permissive
<?php namespace AppBundle\Entity; use Doctrine\ORM\Mapping as ORM; /** * Class Score * @ORM\Entity(repositoryClass="AppBundle\Repository\ScoreRepository") * @ORM\Table(name="score") */ class Score { /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer", name="id") */ private...
C
UTF-8
3,113
3.765625
4
[]
no_license
#include <stdio.h> #include <stdlib.h> typedef struct _dllNode { int key; struct _dllNode* left; struct _dllNode* right; } DLLNode; typedef DLLNode* DoublyLinkedList; DoublyLinkedList addFront(DoublyLinkedList dll, int key) { if(dll == NULL) { dll = malloc(sizeof(DLLNode)); dll->key = key; dll->left = dll...
Java
UTF-8
826
2.203125
2
[]
no_license
package com.platacad.business; import java.util.List; import javax.annotation.Resource; import org.springframework.data.domain.Sort; import org.springframework.data.domain.Sort.Direction; import org.springframework.stereotype.Controller; import com.platacad.model.entities.TrabajoEncargado; import com.platacad.model...
Markdown
UTF-8
1,704
3.015625
3
[]
no_license
# planning-poker Planning poker web app. ## Features - multiple, independent rooms can vote in parallel - real-time voting (via SSE -- no websockets required) - basic interface with no clutter or cruft - automatic room teardown when no users present ## Screenshots ![room list](/images/room-list.png) ![room view](/...
Java
UTF-8
3,344
2.953125
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 sserver; import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io....
Go
UTF-8
4,631
2.96875
3
[ "Apache-2.0" ]
permissive
/************************************************************************************ **Author:  Axe Tang; Email: axetang@163.com **Package: net **Element: net.Resolver **Type: struct ------------------------------------------------------------------------------------ **Definition: type Resolver struct { //...
C#
UTF-8
3,179
2.734375
3
[ "MIT" ]
permissive
using System; using System.IO; namespace ParallelStacks.Runtime { public static class ConsoleApp { public static void Run(string name, string version, string[] args) { if (args.Length == 0) { ShowHelp(name, version, "Missing dump file path or process ID....
Java
UTF-8
1,313
2.53125
3
[]
no_license
package net.highwayfrogs.editor.file.map.entity.data.retro; import lombok.Getter; import lombok.Setter; import net.highwayfrogs.editor.file.map.entity.data.MatrixData; import net.highwayfrogs.editor.file.reader.DataReader; import net.highwayfrogs.editor.file.writer.DataWriter; import net.highwayfrogs.editor.gui.GUIEdi...
PHP
UTF-8
1,024
3.890625
4
[]
no_license
<?php class Movie { private $name = null; private $description = "une description"; private $duration = 120; public function __construct($name = "", $description= "", $duration = "") { $this->name = $name; $this->description = $description; $this->duration = $durat...
JavaScript
UTF-8
418
3.921875
4
[]
no_license
//Given 2 arrays and an index //Copy each element of 1st array into 2nd array in order //Begin inserting at index n of 2nd array // The input arrays should remain unchanged function frankenSplice(arr1, arr2, n) { var arr3 = arr2.slice(); //copy original arr2 so don't change it arr3.splice(n,0,...arr1); //sp...
Java
UTF-8
8,280
1.796875
2
[ "Apache-2.0" ]
permissive
/* * Copyright 2018 Phil Shadlyn * * 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 applicable law or agreed to ...
PHP
UTF-8
4,457
2.640625
3
[]
no_license
<?php class Widget_Static_Text extends Widget_Tag { public function getCategory() { return 'Static'; } public function getName() { return 'Text'; } public function getContext() { return ''; } /** * * @return array */ ...
Swift
UTF-8
888
3.734375
4
[]
no_license
// // PriorityQueue.swift // Otus_algo // // Created by Alexander Kraev on 22.02.2021. // import Foundation protocol PriorityQueueProtocol { associatedtype Item func size() -> Int ///поместить элемент в очередь mutating func enqueue(priority: Int, item: Item) ///выбрать элемент и...
Java
UTF-8
10,491
1.945313
2
[ "Apache-2.0" ]
permissive
package com.anjlab.eclipse.tapestry5.internal.visitors; import org.apache.commons.lang3.StringUtils; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.jdt.core.IAnnotation; import org.eclipse.jdt.core.IType; import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.core.dom.ASTVisitor; ...
Java
UTF-8
3,732
2.953125
3
[]
no_license
package org.rainbow.service.services; import java.util.List; import org.rainbow.criteria.Predicate; import org.rainbow.criteria.SearchOptions; /** * Interface representing the service layer. It focuses on tasks, such as * coordinating business logic, demarcating transactions, applying security * restric...
Java
UTF-8
278
1.921875
2
[]
no_license
package com.le.rpc.enumeration; import lombok.AllArgsConstructor; import lombok.Getter; /** * @Author happy_le * @date 2021/2/20 下午12:00 */ @AllArgsConstructor @Getter public enum PackageType { REQUEST_PACK(0), RESPONSE_PACK(1); private final int code; }
Java
UTF-8
699
1.960938
2
[]
no_license
package ksbysample.webapp.email.test; import org.junit.rules.ExternalResource; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.setup.MockMvcBuilders; import o...
Python
UTF-8
651
2.859375
3
[]
no_license
''' Created on Mar 19, 2019 @author: Gabriel Torrandella ''' import pytest import xmlschema from xmlschema.etree import ParseError class TestXML(object): def test_Invalid_Schema(self): with pytest.raises(ParseError) as excinfo: xmlschema.XMLSchema("formacion_invalido.xsd") pri...
Java
UTF-8
864
2.25
2
[]
no_license
package org.darkquest.gs.phandler.ls; import org.darkquest.gs.connection.LSPacket; import org.darkquest.gs.connection.Packet; import org.darkquest.gs.model.Player; import org.darkquest.gs.phandler.PacketHandler; import org.darkquest.gs.util.Logger; import org.darkquest.gs.world.World; import org.jboss.netty.channel.Ch...
PHP
UTF-8
889
2.65625
3
[ "MIT" ]
permissive
<?php use Illuminate\Database\Seeder; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Facades\DB; use App\Models\Review; use App\Models\Rating; class ReviewSeeder extends Seeder { /** * Run the admin seeder. * * @return void */ public function run() { // Create an instance of Faker $...
PHP
UTF-8
626
2.609375
3
[ "MIT" ]
permissive
<?php namespace Pishran\LaravelPersianString; trait HasPersianString { public static function bootHasPersianString() { $ps = app('PersianString'); static::saving(function ($model) use ($ps) { foreach ($model->getPersianStrings() as $persianString) { if (is_string($...
Java
UTF-8
904
4.15625
4
[ "Apache-2.0" ]
permissive
package atUniProMaven.array; import java.util.Scanner; /** * 1. Input an integer array and output it to the console */ public class Task1 { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); // 1. Input the length of a new array: System.out.print("Input...
Python
UTF-8
407
2.984375
3
[]
no_license
from model.Neighbourhoods.NeighbourhoodBase import NeighbourhoodBase class HexagonalRight(NeighbourhoodBase): def _set_neighbours(self): self._append_neighbour(-1, 0) self._append_neighbour(-1, 1) self._append_neighbour(0, -1) self._append_neighbour(0, 0) self._append_neig...
Markdown
UTF-8
4,113
2.828125
3
[]
no_license
--- title: 使用Nginx进行反向代理用于解决前端跨域问题 date: 2017-09-16 23:24:15 tags: server categories: 服务器 description: 解决跨域问题 --- #使用Nginx进行反向代理用于解决前端跨域问题 最近写完了静态,准备向后端拿API直接拿数据做渲染测试,但是却因为跨域问题,造成了浏览器无法获取后端获取的数据 具体报错如下: XMLHttpRequest cannot load http://www.example.com No 'Access-Control-Allow-Origin' header is present on the req...
Python
UTF-8
416
2.84375
3
[]
no_license
import matplotlib.pyplot as plt import pandas as pd data = pd.read_csv('Scatter_plot.csv') view = data['view_count'] likes = data['likes'] ratio = data['ratio'] plt.style.use("dark_background") plt.scatter(view,likes,edgecolors='black',cmap='winter',c=ratio) plt.xscale('log') plt.yscale("log") plt.title("Youtube Trend...
Java
UTF-8
27,685
1.578125
2
[]
no_license
package transporte.controller.gestion; import java.io.Serializable; import java.sql.Time; import java.sql.Timestamp; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.List; imp...
SQL
UTF-8
164
2.5625
3
[ "CC0-1.0" ]
permissive
-- !Ups create table tasks ( id serial not null, name varchar(100) not null, description varchar(100), PRIMARY KEY (id) ); -- !Downs DROP TABLE IF EXISTS tasks
Python
UTF-8
638
3.078125
3
[]
no_license
''' Created on Apr 14, 2012 @author: namnx ''' import sys def solve(line): vals = line.split() n = int(vals[0]) s = int(vals[1]) p = int(vals[2]) re = 0 for val in vals[3:]: val = int(val) if p==1: if val>=1: re += 1 elif val >= 3*p-2: re += 1 elif v...
C#
UTF-8
2,778
2.671875
3
[ "MIT" ]
permissive
using System; using System.Linq; using Manatee.Json.Parsing; using Manatee.Json.Path.ArrayParameters; using Manatee.Json.Path.Operators; using Manatee.Json.Path.Parsing; namespace Manatee.Json.Path.Expressions.Parsing { internal class PathExpressionParser : IJsonPathExpressionParser { public bool Handl...
SQL
UTF-8
921
3.921875
4
[]
no_license
DROP TABLE IF EXISTS handle CASCADE; CREATE TABLE IF NOT EXISTS handle ( handle_id integer PRIMARY KEY, handle_name varchar ); DROP TABLE IF EXISTS tweet CASCADE; CREATE TABLE IF NOT EXISTS tweet ( handle_id integer references handle(handle_id), timeTweeted timestamp NOT NULL, PRIMARY KEY(timeTweeted, handle_i...
Python
UTF-8
12,580
3.453125
3
[]
no_license
import numpy as np NULL = 0 class bsearch(object): ''' simple binary search tree, with public functions of search, insert and traversal ''' def __init__ (self, value) : self.value = value self.left = self.right = NULL def search(self, value) : if self.value==va...
C
UTF-8
597
3.921875
4
[]
no_license
#include <stdlib.h> #include "lists.h" /** * delete_nodeint_at_index - delete node at index * @head: head node * @index: where to delete * Return: 1 (succes) -1 (fail) */ int delete_nodeint_at_index(listint_t **head, unsigned int index) { listint_t *current, *previous; if (head == NULL) return (-1); for (cu...
Python
UTF-8
644
4.125
4
[]
no_license
#!/usr/bin/env python # encoding: utf-8 #简单选择排序的第i趟是从数组中选择第i小的元素,并将元素放在第i位上 def select_sort(data_array,n) : for i in range(n-1) : low_index = i #记录data_array[i...n-1]中最小元素的下标 for j in range(i+1,n) : if data_array[j] <data_array[low_index] : low_index = j swap...
Java
UTF-8
406
2.8125
3
[]
no_license
package maratonajava.abstrato; public class Manager extends Employe{ public Manager() { } public Manager(String name, String clt, double salary) { super(name, clt, salary); } @Override public double calculateSalary() { this.setSalary(this.getSalary() + (this.getSal...
PHP
UTF-8
1,178
2.609375
3
[]
no_license
<!-- classe responsavel por conectar com o bando de dados e gravar erros em arquivo txt --> <?php class DB{ private static $conn; static function getConn(){ if(is_null(self::$conn)){ self::$conn = new PDO('mysql:host=localhost;dbname=afaid','root',''); self::$conn->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_...
C++
UTF-8
4,986
3.0625
3
[ "MIT" ]
permissive
#ifndef SYSMODULE_HPP #define SYSMODULE_HPP #include <atomic> #include <chrono> #include <functional> #include <mutex> #include <queue> #include "Types.hpp" #include <vector> // The sysmodule class communicates with the sysmodule via IPC calls. // All values are cached, allowing for fast access and no race conditions...
C++
GB18030
7,967
2.890625
3
[]
no_license
#include "fight.h" FIGHT::FIGHT() { } FIGHT::FIGHT(POKEMON *F1, POKEMON *F2) { realA = F1; realB = F2; A = *realA; B = *realB; } FIGHT::FIGHT(const FIGHT & theFight) { realA = theFight.realA; realB = theFight.realB; A = theFight.A; B = theFight.B; } void FIGHT::A_VS_B() { //srand((unsigned)time(NULL)); //...
PHP
UTF-8
2,177
2.71875
3
[]
no_license
<?php namespace customer\frontend\models; use Yii; use customer\models\sms\MobileCode; use customer\models\sms\EmailCode; /** * 验证码登录方式 * * @author zhangyang <zhangyang@cadoyi.com> */ class CaptchaLoginForm extends CaptchaForm { /** * @var int 发送的验证码 */ public $code; /** * @inhe...
C++
UTF-8
13,031
2.625
3
[ "LLVM-exception", "Apache-2.0", "LicenseRef-scancode-generic-cla", "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-other-permissive", "BSL-1.0", "LicenseRef-scancode-mit-old-style" ]
permissive
// Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // test <atomic> C++11 header with multiple threads #define TEST_NAME "<atomic>, part 1" #undef NDEBUG #include "tdefs.h" #include <assert.h> #include <atomic> #include <limits> #include <memory> #include <t...
Markdown
UTF-8
1,609
2.59375
3
[]
no_license
--- title: tailwindをAnagularにインストールして使う description: null tags: tailwind updatedAt: 2021-09-21 published: true --- いつもどおり Angular のプロジェクトを作る ```shell > npx -p @angular/cli ng new handson-angular-tailwind ...
Python
UTF-8
862
4.0625
4
[]
no_license
##Lab 4 ##Nathan Wisla ##1375068 ##AUCSC111 ##October 13, 2016 ##Lab 5: screwing around with a .txt file ##Given a text file, perform operations on the file. ##3. Find the number of occurrences of a number in the entire file 'howMany(inF, num)' ##inF is the open input file def howMany(inF,num): '''F...
Java
UTF-8
371
1.804688
2
[]
no_license
package com.chinags.auth.dao; import com.chinags.auth.entity.Article; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; public interface ArticleDao extends JpaRepository<Article, String>, JpaSpecificationExecutor<Article> { Arti...
Java
UTF-8
2,873
2.640625
3
[]
no_license
package pers.tuershen.nbtedit.compoundlibrary.nms.io; import pers.tuershen.nbtedit.compoundlibrary.nms.code.Base64; import pers.tuershen.nbtedit.compoundlibrary.nms.minecraft.nbt.TagBase; import java.io.*; public class SerializableStream { private static final Base64.Encoder encoder = Base64.getEncoder(); ...
Java
UTF-8
2,448
2.53125
3
[]
no_license
package com.isa.restaurant.domain.DTO; import com.isa.restaurant.domain.*; import com.isa.restaurant.ulitity.Utilities; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.*; impo...
Python
UTF-8
1,978
2.578125
3
[ "BSD-3-Clause" ]
permissive
# -*- coding: utf-8 -*- __docformat__='restructuredtext' """The application's Globals object""" from pylons import config import glob, os from os.path import dirname, exists, join, abspath class Globals(object): """Globals acts as a container for objects available throughout the life of the application """...
Markdown
UTF-8
1,308
2.8125
3
[]
no_license
#### Dockerizing Magento 2 with Docker-Compose In this project, we are using: > Web Server: Apache2 > Database Server: Mysql-server-5.7 > PHP version: PHP-7.1 > Magento version: Magento-CE-2.3.4 To begin with, please install docker and docker-compose. Then follow the following steps: 1). Download Magento-CE-2....
Markdown
UTF-8
2,250
2.8125
3
[ "MIT" ]
permissive
--- layout: post title: "Seattle Chocolates Espresso Truffles" excerpt: "If its hot and humid enough, even the staunchest coffee drinker will look for alternative ways to enjoy coffee. This weekend some friends provided such an outlet for my coffee cravings - Espresso Truffles." modified: categories: reviews tag...
Java
UTF-8
739
2.046875
2
[]
no_license
package struts; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import javax.servlet.ServletContext; import org.apache.struts.action.*; public final class CalcurationAction extends Action { public ActionForward execute( ActionMapp...
PHP
UTF-8
2,474
2.640625
3
[]
no_license
<?php namespace frontend\models; use Yii; /** * This is the model class for table "conferences". * * @property int $conf_id * @property string $conf_name * @property string $conf_year * @property string $conf_venue * @property string $conf_domain * @property string $conf_scope * @property string $conf_start...
Python
UTF-8
2,144
2.71875
3
[ "Apache-2.0", "BSD-3-Clause", "MIT", "LicenseRef-scancode-public-domain", "BSD-2-Clause" ]
permissive
""" How to use: Step 1 - Edit this file variables accordingly: host = 'HOSTNAME_OR_IP' user = 'SSH_USER_NAME' password = 'SSH_USER_PASSWORD' Step 2 - Go to another terminal and execute the test (for ANY code modification, please restart this step) docker exec -it netapi_app python ./manage.py shell ...
Java
UTF-8
1,669
2.34375
2
[]
no_license
package top.flobby.boot.quickstart.controller.dto; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; /** * @author :Flobby * @version :1.0 * @date :2021/3/4 * @descri...
Java
UTF-8
4,145
2.375
2
[ "Apache-2.0" ]
permissive
package org.ubg.org.ubg.graph; import com.arangodb.ArangoCursor; import com.arangodb.ArangoDBException; import com.arangodb.ArangoGraph; import com.arangodb.entity.EdgeEntity; import com.arangodb.entity.VertexEntity; import com.arangodb.velocypack.exception.VPackParserException; import org.ubg.builder.connection.Conne...
Python
UTF-8
5,816
2.84375
3
[]
no_license
# -*- coding: utf-8 -*- # @Time : 2021/8/1 17:54 # @Author : Tty # @Email : 1843222968@qq.com # @File : hand_pysheds.py import warnings import numpy as np import matplotlib.pyplot as plt import matplotlib.colors as colors from calculate_acc_thresh import get_threshold_automatically from array_to_raster import array2Ra...
Swift
UTF-8
2,035
2.75
3
[]
no_license
// // CommitStatus.swift // OctoKit // // Created by Matthew on 01/02/2017. // Copyright © 2017 Matthew. All rights reserved. // import Foundation import ObjectMapper /// A status belonging to a commit. public class CommitStatus: Object { // MARK: - Instance Properties /// The date at which the ...
JavaScript
UTF-8
2,784
2.515625
3
[]
no_license
define(['$','util','../base'],function(require) { var $=require('$'); var util=require('util'); var sl=require('../base'); var slice=Array.prototype.slice; var Tip=function(text) { this._tip=$('<div class="tip" style="display:none">'+(text||'')+'</div>').appendTo(document.body); }; ...
C++
UTF-8
624
2.90625
3
[]
no_license
#include <iostream> #include <cmath> using namespace std; bool is_prime(long long p) { if (p < 2) return false; if (p == 2) return true; if (p % 2 == 0) return false; for (long long d = 3; d * d <= p; d += 2) { if (p % d == 0) return false; } return true; } int main() { long long n...
Java
UTF-8
2,125
2.328125
2
[]
no_license
package com.metropia.requests; import java.io.IOException; import java.net.URLEncoder; import java.util.HashMap; import java.util.Map; import org.json.JSONException; import android.content.Context; import com.metropia.models.User; import com.metropia.utils.HTTP.Method; import com.metropia.utils.datetime.RecurringTi...
Python
UTF-8
3,175
3.09375
3
[]
no_license
import sys, os sys.path.append(os.path.relpath('../../')) from src.datasets import * from pathIO import * import timeit, time from functools import partial class BenchmarkMethodInterface: """An interface for benchmarking and testing of various searching methods Set whatever you want in __init__, bu...
JavaScript
UTF-8
1,376
2.90625
3
[ "MIT" ]
permissive
/* jshint latedef:false */ var win = window; var doc = document; var domNs = 'get-image-url'; var dom = { body : doc.getElementsByTagName('body')[0], head : doc.getElementsByTagName('head')[0], style: doc.querySelector('.' + domNs + '-style') }; function cleanup () { dom.head.removeChild(dom.style); dom.body.rem...
PHP
UTF-8
4,012
2.734375
3
[]
no_license
<?php /** * This file is part of the DpnXmlSitemapBundle package. * * (c) Björn Fromme <mail@bjo3rn.com> * * For the full copyright and license information, please view the Resources/meta/LICENSE * file that was distributed with this source code. */ namespace Dpn\XmlSitemapBundle\Sitemap; use Symfony\Componen...
Java
UTF-8
868
3.390625
3
[ "MIT" ]
permissive
package prob046.permutations; import java.util.*; /** * Created by yanya04 on 7/23/2017. * Modified by yanya04 on 5/2/2018. * Modified by yanya04 on 5/14/2018. */ public class Solution { public List<List<Integer>> permute(int[] nums) { List<List<Integer>> res = new ArrayList<>(); if(nums == nu...
Markdown
UTF-8
4,392
2.578125
3
[]
no_license
<!-- START doctoc generated TOC please keep comment here to allow auto update --> <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> **Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)* - [Base release off latest release tag](#base-release-off-latest-release-tag) - [B...
JavaScript
UTF-8
4,347
2.515625
3
[]
no_license
import React from 'react'; import {observable, action} from "mobx"; import QueueApi from "../api/QueueApi"; class QueueStore { @observable queues = []; @observable isLoading = false; @observable queue = {}; @observable messages = {}; @observable currentPage = 1; @observable lastPage = 1; ...
Python
UTF-8
4,263
2.671875
3
[ "MIT" ]
permissive
# -*- coding: utf-8 -*- # --- # jupyter: # jupytext: # text_representation: # extension: .py # format_name: light # format_version: '1.5' # jupytext_version: 1.10.2 # kernelspec: # display_name: Python 3 # language: python # name: python3 # --- # + default_dir = './' import...
C++
UTF-8
1,246
2.859375
3
[ "Apache-2.0" ]
permissive
// // Created by Lai on 2020/12/1. // #ifndef OPENGLDEMO_IMAGEINFO_H #define OPENGLDEMO_IMAGEINFO_H #include <cstdlib> class ImageInfo { public: int width, height; unsigned char *pixels; //std::string brushId; ImageInfo() : width(0), height(0), pixels(nullptr)/*,brushId(nullptr)*/ { } Imag...