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
1,297
2.921875
3
[]
no_license
// Written by Wouter Ensink #include <catch2/catch_all.hpp> #include <console_synth/sequencer/time_signature.h> TEST_CASE ("time signature", "basic setup") { auto ts = TimeSignature { 4, 4, 4 }; REQUIRE (ts.getNumerator() == 4); REQUIRE (ts.getDenominator() == 4); REQUIRE (ts.getTicksPerQuarterNote(...
Python
UTF-8
161
4.21875
4
[]
no_license
#This is a string to integer type casting string = input("Enter a string to get converted into a integer:") print("The input after typed cast is :"+int(string))
JavaScript
UTF-8
1,268
2.640625
3
[]
no_license
// Displays the Kaminsky plot of the bytemap function DotPlotPanel(parent) { Globals.superConstructor(this, VisualPanel, [parent]); this.name="DotPlot"; this.size.width = 512; this.size.height = 512; // create buffer this.imageBuffer = BinVis.IMG_BUFFER_512; this.contrastValue = 170;...
Markdown
UTF-8
4,114
3.171875
3
[]
no_license
--- layout : post title : React is a framework date: 2016-11-16T08:45:12.000Z categories: javascript node js react redux comments: true --- One of the more common phrases you hear anytime you talk about ReactJs is : >React is not a framework, its a library or >React is just the "V" in "MVC" This would have made se...
Markdown
UTF-8
2,258
3.234375
3
[ "MIT" ]
permissive
## Deploying Faktory to Render.com [Render](https://render.com) is a SaaS which makes it really easy to deploy custom Docker-based services around the world with a few clicks. [Faktory](/contribsys/faktory/wiki) is a persistent background job system for any programming language. Let's get a Faktory instance running fo...
JavaScript
UTF-8
372
2.734375
3
[]
no_license
// Do nothing. Might be useful to see how other bots perform without interruption. o_O (function() { var bot = {name: 'doNothing', icon:'bot', cb: function() { return [] }}; setTimeout(function registerArmy() { window.registerArmy({ name: bot.name, icon: bot.icon, ...
Python
UTF-8
1,850
2.65625
3
[ "MIT" ]
permissive
#!/usr/bin/env python3 import gym from griddly import GymWrapper, gd from griddly.RenderTools import VideoRecorder import matplotlib.pyplot as plt def test_griddly(): env = gym.make('GDY-Labyrinth-v0') env.reset() for s in range(10): obs, reward, done, info = env.step(env.action_space.sample()) ...
PHP
UTF-8
929
2.625
3
[]
no_license
<?php namespace Ekapusta\DoctrineCustomTypesBundle\ORM\Query\AST\Functions\Postgresql; use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; abstract class TwoArgsStringFunctionNode extends PostgresFunctionNode { public $arg1; public $arg2; public static function...
JavaScript
UTF-8
1,334
4.125
4
[]
no_license
//template string var x=5; console.log(`the value of a is =${x}`); //class class ArithmaticOperators { constructor(a,b,name) { this.input1=a; this.input2=b; this.operation = name; } getSum() { return `the sum is ${this.input1 + this.input2}`; } getSub() { ret...
Markdown
UTF-8
3,422
3.21875
3
[]
no_license
``` exports.handler = async event => { if (!event.user || !event.user.info) { return { statusCode: 400, body: JSON.stringify({ message: "Missing input" }) }; } const user = { name: event.user.info.name, email: event.user.info.email, password: e...
Markdown
UTF-8
5,163
2.65625
3
[]
no_license
--- description: "Simple Way to Make Perfect Stir Fry Veggies" title: "Simple Way to Make Perfect Stir Fry Veggies" slug: 1580-simple-way-to-make-perfect-stir-fry-veggies date: 2020-08-30T10:01:01.591Z image: https://img-global.cpcdn.com/recipes/00c9c967d040184e/751x532cq70/stir-fry-veggies-recipe-main-photo.jpg thumbn...
Ruby
UTF-8
2,299
3.34375
3
[]
no_license
require './lib/enigma' require './lib/key_generator' require 'Date' require 'minitest/autorun' require 'minitest/pride' class EnigmaTest < Minitest::Test def test_total_shift # binding.pry e = Enigma.new key = 41521 a = 49 b = 18 c = 54 d = 25 expected = [a, b, c, d] output = e.to...
JavaScript
UTF-8
831
2.96875
3
[]
no_license
import { hasRoute } from "../4.1 - Route Between Nodes"; import { buildBinaryTree } from "../../Data Structures/BinaryTree"; import { range } from "lodash"; test("Route Between Nodes", () => { const tree = buildBinaryTree(range(10)); const startNode = tree.left; const endNode = tree.left.left.right; const othe...
Python
UTF-8
2,231
3.578125
4
[]
no_license
#Importing libraries import numpy as np import pandas as pd import matplotlib.pyplot as plt #Importing dataset with pandas dataset = pd.read_csv('Mall_Customers.csv') X= dataset.iloc[:,[3,4]].values #using the elbow method to find exact number of clusters from sklearn.cluster import KMeans #so as t...
C++
UTF-8
505
2.734375
3
[]
no_license
#include <iostream> #include <string> using namespace std; int G[6][6]; int main () { int m, a, b; cin >> m; while (m--) { cin >> a >> b; G[a][b] = G[b][a] = 1; } int ts = 0; for (int x=1; x<=5; ++x) for (int y=1; y<=5; ++y) for (int z=1; z<=5; ++z) { if (x==y || x==z |...
Python
UTF-8
623
2.6875
3
[]
no_license
import json from flask import Response from .codes import WEBCodes class AbstractHTTPResult: def __init__( self, data: dict, msg: str, http_code: int = 200, status: int = WEBCodes.OK ): self.http_code = http_code self.data = data self.msg = msg self.status =...
Python
UTF-8
10,945
2.546875
3
[]
no_license
# ---------------------------------------------------------------------- # --- rxtx.py --- # ---------------------------------------------------------------------- # --- High level static functions to deal with RX, TX and also --- # --- generation and execut...
PHP
UTF-8
1,043
2.59375
3
[]
no_license
<?php session_start(); if (!isset( $_SESSION['count'])){ $_SESSION['count'] = 1; } else { $_SESSION['count']++; } $id = $_SESSION['count']; if(isset($_POST['bookbus'])){ $passenger = $_POST['passengername']; $dest = $_POST['dest']; $bus = $_POST['bus'...
TypeScript
UTF-8
440
2.875
3
[]
no_license
const carMakers = ['ford', 'toyota', 'chevy']; const carMakersEmpty: string[] = []; const carsByMake = [['f150'], ['90'], ['camaro']]; const carsByMakeEmpty: string[][] = []; const make = carsByMake.pop(); const makers = carMakers.map((car: string): { [car: string]: string } => ({ [car]: car, })); interface Makers...
Markdown
UTF-8
3,184
3.859375
4
[ "Apache-2.0" ]
permissive
--- layout: post title: LeetCode 0119 题解 description: "杨辉三角 II" keywords: test category: LeetCode tags: [solving LeetCode] --- ### 题目描述 [杨辉三角 II](https://leetcode-cn.com/problems/pascals-triangle-ii/) ### 思路 根据第118题的思路,构造杨辉三角的集合,并返回最后一行。 ### 题解 ```java class Solution { public List<Integer> getR...
PHP
UTF-8
704
2.765625
3
[ "MIT" ]
permissive
<?php namespace Noldors\CommerceMLParser\Events; use Noldors\Collections\Collection; use Symfony\Component\EventDispatcher\Event; class CategoryEvent extends Event { /** * Categories collection. * * @var \Noldors\Collections\Collection */ protected $categories; /** * CategoryEve...
Java
UTF-8
1,375
2.109375
2
[]
no_license
package com.accolite.ims.ims.modles; import java.sql.Date; import java.util.List; import lombok.Getter; import lombok.Setter; import lombok.ToString; @Getter @Setter @ToString public class jobOpenings { private long requirementId; private String requirementDetails; private Date startDate; private Date endDate; ...
Python
UTF-8
2,751
3.125
3
[]
no_license
''' This file defines our database model. ''' from flask_sqlalchemy import SQLAlchemy from dataclasses import dataclass from sqlalchemy.orm import backref db = SQLAlchemy() @dataclass class TestSuite(db.Model): ''' Defines a test suite. A test suite is a collection of test cases. ''' __tablename__...
Markdown
UTF-8
3,557
2.859375
3
[]
no_license
+-- {: .rightHandSide} +-- {: .toc .clickDown tabindex="0"} ### Context #### Philosophy +-- {: .hide} [[!include philosophy - contents]] =-- =-- =-- This page collects material related to * [[Georg Hegel]], _Lectures on the Philosophy of Religion_ published posthumously, starting 1832 ([...
Go
UTF-8
1,845
2.6875
3
[]
no_license
package main import ( "fmt" "io/ioutil" "os" "github.com/adrg/xdg" "gopkg.in/yaml.v2" ) type NodeConfiguration struct { Master string `yaml:"master"` Slaves []string `yaml:"slaves"` } func localConfigPath() (string, error) { return xdg.ConfigFile("FORmicidae Tracker/leto.yml") } var defaultNodeConfigurat...
Swift
UTF-8
6,592
2.828125
3
[]
no_license
// // ViewController.swift // Baby Beat // // Created by may985 on 7/5/17. // Copyright © 2017 may985. All rights reserved. // import UIKit class ViewController: UIViewController { @IBOutlet weak var view1: UIView! @IBOutlet weak var uiscrollview: UIScrollView! override func viewDidLoad() { ...
JavaScript
UTF-8
7,998
4
4
[]
no_license
/*eslint-env browser */ //STEP 1 /* var movies = ["Star Wars", "Monsters", "Happy Feet", "Ice Age", "War Games"]; window.console.log(movies[1]); */ //STEP 2: CONSTRUCTOR /* var movies = new Array(5); var movies = new Array("Star Wars", "Monsters","Happy Feet", "Ice Age","War Games"); window.console.log(movies[0]); *...
Markdown
UTF-8
1,317
3.09375
3
[]
no_license
# PG和PGP ## 定义 ```text PG = Placement Group PGP = Placement Group for Placement purpose pg_num = number of placement groups mapped to an OSD When pg_num is increased for any pool, every PG of this pool splits into half, but they all remain mapped to their parent OSD. Until this time, Ceph does not start rebalancing. No...
PHP
UTF-8
5,616
2.59375
3
[]
no_license
<?php // Grab vars $inp1 = $_POST['37AX-L']; $inp2 = $_POST['42XR-j']; $inp3 = $_POST['93ZZ-A']; $state = $_POST['State']; //prices correspond to part above respectively. $price1 = '12.45'; $price2 = '15.34'; $price3 = '28.99'; //calculate hte number of items $numItems = $inp1 + $inp2 + $inp3; $subPrice1 = $price1 *...
Java
UTF-8
2,889
2.578125
3
[]
no_license
package Modelo; import java.io.BufferedReader; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.util.ArrayList; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import negocio.Centro; import negocio.Cliente; import negocio.ConjuntoDeLugares; import negocio...
Go
UTF-8
2,265
3.203125
3
[ "MIT", "Apache-2.0", "LicenseRef-scancode-unknown-license-reference", "GPL-2.0-only" ]
permissive
package template import ( "fmt" "os" "path" "path/filepath" "strings" log "github.com/sirupsen/logrus" ) var NodeName = os.Getenv("NODENAME") // fileInfo describes a configuration file and is returned by fileStat. type fileInfo struct { Uid uint32 Gid uint32 Mode os.FileMode Md5 string } func expandKe...
Java
UTF-8
1,316
2.25
2
[]
no_license
package com.example.foregroundservice; import androidx.appcompat.app.AppCompatActivity; import androidx.core.content.ContextCompat; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Button; public class MainActivity extends AppCompatActivity { Button mBtnSt...
C#
UTF-8
3,386
2.71875
3
[ "MIT" ]
permissive
// Copyright © Clinton Ingram and Contributors. Licensed under the MIT License. using System; using System.Diagnostics; using System.Buffers.Binary; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; namespace PhotoSauce.MagicScaler; internal unsafe ref struct SpanBufferReader { private r...
C++
UTF-8
446
2.53125
3
[]
no_license
#include "Dice.h" using namespace AxiomLib; using namespace AxiomLib::MultiMarking; Dice::Dice() { } double Dice::compute(const std::vector<bool> &v1, const std::vector<bool> &v2) { int p1 = 0, p2 = 0, pI = 0; for(int i = 0; i < (int)v1.size(); ++i) { if(v1[i]) { ++p1; } if(v2[i]) { ...
Markdown
UTF-8
3,819
2.84375
3
[]
no_license
### Podcast Response - Week 4 To [Virginia Eubanks, AUTOMATING INEQUALITY](https://www.writersvoice.net/tag/virginia-eubanks/) with Virginia Eubanks and Francesca Rheannon (2019). * ##### *How do technical tools promise to "fair out" the remaining discrimination that exist in social/welfare systems? In how far can the...
Java
UTF-8
1,629
3.9375
4
[]
no_license
package ca.svarb.whelper; /** * A Grid stores a set of Cells in a square arrangement. * All Cells by default contain blank string (""). * Cells can be accessed by [col,row] values (0 indexed) * or iterated through. */ public class Grid extends AbstractGridGameBoard { /** * Makes a grid with default size of 5...
Markdown
UTF-8
1,176
3.484375
3
[]
no_license
# 입출력 ### Java의 입출력 - 압력 : Scanner / 출력 : System.out ```java Scanner sc = new Scanner(System.in); ``` - 더 빠른 방법 : BufferedReader 사용 ```java BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); ``` - 출력이 많은 경우 StringBuilder를 사용해서 한 문자열로 만들어 출력을 한 번만 사용하거나, BufferedWrite...
Java
UTF-8
1,385
1.890625
2
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package org.jetbrains.kotlin.idea.test; import com.intellij.codeInsight.JavaCodeInsightTestCase; import com.intellij.openapi.Disposable; import com.intellij.op...
Java
UTF-8
1,207
2.21875
2
[]
no_license
package sacred.alliance.magic.debug.action; import java.util.List; import com.game.draco.GameContext; import com.game.draco.app.rank.RankInitResult; import com.game.draco.debug.message.request.C10057_RankInitReqMessage; import com.game.draco.debug.message.response.C10057_RankInitRespMessage; import sacred.alliance.m...
Java
UTF-8
2,525
2.859375
3
[]
no_license
package pt.tecnico.mydrive.domain; import pt.tecnico.mydrive.exception.FileDoesNotExistException; import pt.tecnico.mydrive.exception.UserIsNotInSessionException; import java.util.ArrayList; import java.util.List; public class Directory extends Directory_Base { public Directory() { super(); } public Direc...
Java
UTF-8
7,721
2.03125
2
[]
no_license
package com.Deadline.leon.deadline; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.util.Log; import android.view.View; import android.content.Intent; import android.widget.Button; import com....
Java
UTF-8
1,446
2.5625
3
[ "MIT" ]
permissive
package com.prunatic.infrastructure.persistence.user; import com.prunatic.domain.user.User; import com.prunatic.infrastructure.persistence.user.InMemoryUserRepository; import org.junit.Before; import org.junit.Test; import static org.junit.Assert.*; public class InMemoryUserRepositoryTest { InMemoryUserReposito...
C++
UTF-8
1,324
2.578125
3
[]
no_license
#include <bits/stdc++.h> using namespace std; #define maxn 1048579 char sv[maxn + 2]; int N, B; vector<int> P; void Primetable() { int i, j; for (i = 2; i * i < maxn;) { for (j = i + i; j <= maxn; j += i) { sv[j] = 1; } for (++i; sv[i]; i++) ; } P.push_back(2); for (i = 3; i < maxn; i += 2) if...
Markdown
UTF-8
2,927
2.765625
3
[]
no_license
# Article L452-2 Dans le cas mentionné à l'article précédent, la victime ou ses ayants droit reçoivent une majoration des indemnités qui leur sont dues en vertu du présent livre. Lorsqu'une indemnité en capital a été attribuée à la victime, le montant de la majoration ne peut dépasser le montant de ladite indemnité....
C++
UTF-8
892
2.578125
3
[]
no_license
#ifndef PLAYER_H #define PLAYER_H #include "Tile.h" #include "string" #include "Bag.h" class Player { Tile* own_tiles[no_of_tiles_for_player]{ nullptr }; int points = 0; std::wstring name; bool empty_tiles = true; float scale_x = 1; float scale_y = 1; public: struct EX_exchange_lack_of_tiles {}; Player...
PHP
UTF-8
6,280
2.6875
3
[]
no_license
<?php $url = isset($_GET["url"]) ? $_GET["url"] : null; $ispwaStudio = false; // Normal case $parseUrl = parse_url($url); if (!$ispwaStudio) { if (isset($parseUrl['path'])) { if ($parseUrl['path'] !== '/') { // if url is: https://abc.com/xyz/def/... -> check at: https://abc.com/ $is...
Python
UTF-8
3,761
2.71875
3
[]
no_license
from RssData import DataBase from MeanFilter import MeanFilterClass if __name__ == '__main__': room = 'class' # 概率字典 probability = {} # 指纹库字典 finger_data = {} # 点所有的count和字典 ap_count_data = {} # 实时采集数据权重 all_online_count = 0 data_bayes = DataBase() online_filter = MeanFilte...
Java
UTF-8
2,314
2.640625
3
[]
no_license
package lk.ac.mrt.cse.dbs.simpleexpensemanager.control; import android.content.Context; import android.database.sqlite.SQLiteDatabase; import lk.ac.mrt.cse.dbs.simpleexpensemanager.control.exception.ExpenseManagerException; import lk.ac.mrt.cse.dbs.simpleexpensemanager.data.AccountDAO; import lk.ac.mrt.cse.dbs.simple...
Java
UTF-8
9,972
2.34375
2
[]
no_license
package optics.raytrace.research.skewLensImaging; import java.awt.event.ActionEvent; import javax.swing.JCheckBox; import math.*; import optics.raytrace.sceneObjects.CylinderMantle; import optics.raytrace.sceneObjects.LensSurface; import optics.raytrace.sceneObjects.RayTrajectoryCone; import optics.raytrace.sceneObj...
Java
UTF-8
7,693
3.234375
3
[]
no_license
package prototype.core; import java.util.Random; import java.util.Scanner; import main.Game; import misc.Tools; import prototype.being.Alloy; import prototype.being.Ray; import prototype.being.Bug; import prototype.items.ConcreteBasicItem; import prototype.items.Inventory; import prototype.items.BugHammer; import pro...
C++
UTF-8
1,451
2.96875
3
[]
no_license
#include "Wall.h" Wall::Wall(point v1, point v2) { vertexes.first = v1; vertexes.second = v2; hp = 100; width = 5; lenght = sqrt(pow(v2.x - v1.x, 2) + pow(v2.y - v1.y, 2)); line[0] = sf::Vertex(sf::Vector2f(v1.x, v1.y)); line[1] = sf::Vertex(sf::Vector2f(v2.x, v2.y)); rectangle.setSize...
Markdown
UTF-8
2,229
3.203125
3
[ "Elastic-2.0" ]
permissive
--- title: Screenshot --- At any point during or after program execution, you can take a screenshot of what appears on its virtual terminal. favoritecolor.py: ```python import sys answer = input("favorite color:") sys.stdout.write(answer.upper()) sys.stdout.flush() ``` With code: ```python from icommandli...
C#
UTF-8
9,034
3.03125
3
[]
no_license
using DAL.Mapping; using DAL.Models; using System; using System.Collections.Generic; using System.Data; using System.Data.SqlClient; using System.Reflection; namespace DAL { public class UserDAO { //Error logging private static ErrorLogger logger = new ErrorLogger(); //Mapper ...
C#
UTF-8
574
3.25
3
[]
no_license
private DateTime[] GetDatesOfSundays(DateTime DatMonth) { List<DateTime> lst = new List<DateTime>(); int iDayOffset = DatMonth.Day - 1; DatMonth = DatMonth.AddDays(System.Convert.ToDouble(-DatMonth.Day + 1)); DateTime DatMonth2 = DatMonth.AddMonths(1).AddDays(System.Convert.To...
Java
UTF-8
2,216
2.171875
2
[]
no_license
package com.luteh.kampusonlinenonakademik.ui.activities.dashboard; import android.content.Context; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase; import com.luteh.kampusonlinenonakademik.common.AccountHelper; import com.luteh.kampusonlinenonakademik.common...
C++
UTF-8
3,216
2.671875
3
[]
no_license
/* The file observationTest.cpp is part of the Harmony software. Harmony is a software that provides tools for the detection of wildlife in series of images. Copyright 2014-2016 WIPSEA SARL, contact@wipsea.com Author(s) : Romain Dambreville Creation date : 2015/03/26 Tous droits réservés - All rights reserved Lib...
Markdown
UTF-8
1,203
2.6875
3
[]
no_license
--- title: About author: Lynn Rainville layout: page date: 2007-02-03 menu: main --- This blog was created by [Dr. Lynn Rainville](http://www.lynnrainville.org/) to share information about Albemarle County History (including the City of Charlottesville, Virginia). Human history in the area begins 1000s of years ago wit...
TypeScript
UTF-8
4,385
2.609375
3
[]
no_license
import { PREFIX_TABLOCK } from '../shared/utils'; import { setLocalItems, getAllLocalItems, setLocalItem, removeLocalItems, } from '../shared/storageUtils'; const isChrome = BROWSER === 'chrome'; interface TablockCache { tabId: number; windowId: number; index: number; title: string; url?: string; } ...
Java
UTF-8
381
2.421875
2
[ "Zlib" ]
permissive
package com.ktxsoftware.kore; public class KoreTouchEvent { public int index; public int x; public int y; public int action; public static int ACTION_DOWN = 0; public static int ACTION_MOVE = 1; public static int ACTION_UP = 2; public KoreTouchEvent(int index, int x, int y, int action) { this.index = ind...
PHP
UTF-8
470
2.703125
3
[ "MIT" ]
permissive
<?php namespace App\Http\Library; class Text { private $help_command; private $false_command; public function getHelpCommand() { $this->help_command = json_decode(file_get_contents(url('message/help.json')), true); return $this->help_command; } public function getFalseCommand...
PHP
UTF-8
2,917
2.734375
3
[]
no_license
<?php if(isset($_POST['submit'])){ $dbHost = "localhost"; //Location Of Database usually its localhost $dbUser = "myworld"; //Database User Name $dbPass = "eituv7"; //Database Password $dbDatabase = "myworld_paper_ballot"; //Database Name $db = mysql_co...
Python
UTF-8
879
2.90625
3
[]
no_license
import sys readline = sys.stdin.readline MOD = 10 ** 9 + 7 INF = float('INF') sys.setrecursionlimit(10 ** 5) def main(): def query(x): print(x) ret = input() if ret == "Vacant": sys.exit() return ret n = int(readline()) l = 0 r = n - 1 op = {"Male": ...
JavaScript
UTF-8
2,797
3.453125
3
[]
no_license
/* Player ( un simplu div ), iar daca apasam arrow down, sa il miscam in jos */ class Player { constructor(gameContainer) { this.div = Player.display(); this.move(); this.gameContainer = gameContainer; } // logica de miscare move() { console.log('miscare', this) ...
Python
UTF-8
11,733
2.75
3
[ "MIT" ]
permissive
#!/usr/bin/env python3 # Prints color cube for XTerm import re SYSTEM_TEMPLATE = "\x1B[{fgbg};5;{color}m-{color:02X}-\x1B[0m" CUBE_TEMPLATE = "\x1B[{fgbg};5;{color}m{color:02X}\x1B[0m" RAMP_TEMPLATE = CUBE_TEMPLATE PALETTE_SYSTEM = { 0x0: [0x00, 0x00, 0x00], 0x1: [0x80, 0x00, 0x00], 0x2: [0x00, 0x80, 0x0...
Java
UTF-8
300
2.6875
3
[]
no_license
package com.simon.javase.interfacedemo.teacher_sporter; public class BasketTeacher extends Teacher { @Override public void teach() { System.out.println("篮球教练教学!"); } @Override public void eat() { System.out.println("篮球教练吃饭"); } }
Java
UTF-8
3,394
3.203125
3
[]
no_license
import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; public class App { public static void main(String[] args) throws Exception { String pattern = "abab"; String str = "redbluered...
Python
UTF-8
550
3.40625
3
[]
no_license
# 프로그래머스 큰 수 만들기 def solution(number, k): ans = [number[0]] for i in range(1, len(number)): if ans[-1] > number[i]: ans.append(number[i]) else: while True: if k != 0 and len(ans) != 0 and number[i] > ans[-1]: ans.pop(-1) ...
Ruby
UTF-8
1,790
2.78125
3
[]
no_license
require 'sinatra' require 'sinatra/reloader' require 'sqlite3' require 'pry' # show the add character form get '/characters/add' do erb :character_add end # add character to database post '/characters/add' do query = "INSERT INTO characters (first_name, last_name, age, gender, occupation, aliases, image) VALUES (...
Markdown
UTF-8
1,966
2.8125
3
[]
no_license
--- layout: interior-post title: Learn Experience categories: experience-information-architecture categoryheader: no tags: - Information Architecture --- <p>On the Learn side of the site, we are proposing a dramatic departure from our past. Not because it’s novel, but because we think it’s right for our audien...
Ruby
UTF-8
312
3.140625
3
[]
no_license
class Guest attr_accessor :name, :money, :fav_song def initialize(name, money, fav_song) @name = name @money = money @fav_song = fav_song end def charge(amount) return @money -= amount end def customer_can_afford_drink(drinks_hash, drink) return @money <= drinks_hash[drink][:info].price end end
Java
UTF-8
5,034
2.265625
2
[]
no_license
package frc.robot; import edu.wpi.first.wpilibj.Joystick; import edu.wpi.first.wpilibj2.command.button.JoystickButton; import frc.robot.commands.climber.ClimberCommand; import frc.robot.commands.climber.TurnOffClimberCommand; import frc.robot.commands.compressor.StartCompressorCommand; import frc.robot.commands.compre...
Java
UTF-8
1,557
2.71875
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 Layout; import java.awt.Component; import java.awt.Dimension; import java.awt.TextField; import java.security.cert.PKIXReason;...
Python
UTF-8
236
3.140625
3
[]
no_license
# cook your dish here from math import floor t = int(input()) for _ in range(t): n = int(input()) r,z = 1,0 remain = 1 while(remain != 0): remain = floor(n/(5**r)) z += remain r += 1 print(z)
Python
UTF-8
1,208
3.515625
4
[ "MIT" ]
permissive
import time import math import operator import sys start = time.time() # Returns the n factorial (n!) for the given argument. # This is the same as the number of permutations for a list # with n members. def factorial(n): if n == 1 or n == 0: return 1 return reduce(operator.mul, xrange(2,...
Shell
UTF-8
2,026
3.640625
4
[ "MIT" ]
permissive
#!/bin/bash [[ ${CONFIG} ]] && CONFIG=$(printf "%q\n" "$(realpath "${CONFIG}")") export PATH="${PATH}:/usr/lib/java-ebuilder/bin" export EROOT=$(dirname /etc) if [[ $# -gt 0 ]]; then if [[ "$1" == "-h" || "$1" == "--help" ]]; then echo This is a helper to automagically generate ebuild for echo Mav...
Markdown
UTF-8
26,692
2.5625
3
[]
no_license
# Basic Template Structure & Working [![License](https://img.shields.io/github/license/cicirello/pyaction)](https://github.com/cicirello/pyaction/blob/master/LICENSE) [![GitHub release (latest by date)](https://img.shields.io/github/v/release/cicirello/pyaction?logo=github)](https://github.com/cicirello/pyaction/rele...
C++
UTF-8
3,996
2.734375
3
[]
no_license
#include "CommandResponder.hpp" #include <sstream> #include <algorithm> namespace sbash64::finances { CommandResponder::CommandResponder(Model &model, View &view) : model{model}, view{view} {} static auto integer(const std::string &s) -> int { return std::stoi(s); } static auto cents(const std::string &s) -> int...
Rust
UTF-8
885
2.71875
3
[ "MIT" ]
permissive
use futures_util::Stream; use std::{ io::{BufReader, Read}, pin::Pin, task::{Context, Poll}, }; const BUF_CAP: usize = 8 * 1024; pub struct ReaderStream<R>(BufReader<R>); impl<R: std::io::Read> ReaderStream<R> { pub fn new(r: R) -> Self { Self(BufReader::with_capacity(BUF_CAP, r)) } } im...
C#
UTF-8
1,257
2.515625
3
[]
no_license
using Microsoft.Extensions.Options; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Webdictaat.Core; using Webdictaat.Core.Helper; using Microsoft.AspNetCore.Http; using System.IO; namespace Webdictaat.Api.Models { public interface IImageRepository { ...
Markdown
UTF-8
3,547
2.71875
3
[]
no_license
--- layout: page title: Visual Factory hero: assets/heroes/unsplash-LvOGj1X2jHE.jpg logo: assets/products/vf-h1.svg slides: ['assets/photo/visual_factory/20140404_124210.jpg', 'assets/photo/visual_factory/20160705_135303.jpg','assets/photo/visual_factory/VF-new-material-handling-cropped.png'] --- ## Streamline...
Java
UTF-8
2,059
2.296875
2
[ "Apache-2.0" ]
permissive
package io.choerodon.iam.api.validator; import java.util.List; import org.springframework.stereotype.Component; import io.choerodon.core.exception.CommonException; import io.choerodon.core.oauth.CustomUserDetails; import io.choerodon.iam.api.dto.MemberRoleDTO; import io.choerodon.iam.infra.dataobject.MemberRoleDO; i...
C
UTF-8
3,526
3.515625
4
[ "MIT" ]
permissive
/** coo color.c Purpose : Provide definitions of the various color classes and their methods @author Kuntal Majumder ( zee at hellozee dot me ) **/ #include "color.h" /** * @brief new_rgb_color creates a new RGB color object returns it * @param red * @param green * @param blue * @return */ c_rgb new_rg...
Python
UTF-8
3,288
2.609375
3
[ "MIT" ]
permissive
import numpy as np import argparse import json import os import xlrd import pandas as pd import numpy as np from sklearn.cluster import KMeans import ssl ssl._create_default_https_context = ssl._create_unverified_context ap = argparse.ArgumentParser() ap.add_argument("-s", "--selectedFeatures", help="Selected feature...
PHP
UTF-8
567
2.890625
3
[]
no_license
<?php //connect to the database require 'databaseConnect.php'; //receive beach zone variable from javascript if(isset($_POST['beachZone'])){ $sql = "SELECT no, name, address,longitude, latitude from info WHERE zone = '{$_POST['beachZone']}' "; $result = mysqli_query($dbc, $sql); $locationInf...
Python
UTF-8
1,398
2.828125
3
[]
no_license
from keras.models import Model from keras.layers import Input, LSTM, Dense # Define an input sequence and process it. encoder_inputs = Input(shape=(None, num_encoder_tokens)) encoder = LSTM(latent_dim, return_state=True) encoder_outputs, state_h, state_c = encoder(encoder_inputs) # We discard `encoder_outputs` and onl...
Java
UTF-8
1,332
2.28125
2
[]
no_license
package com.worknomads.worknomads.dao.impl; import com.worknomads.worknomads.dao.Contracts2Repository; import com.worknomads.worknomads.dao.RetrieveContractsDAO; import com.worknomads.worknomads.models.SmartContract; import io.micrometer.core.instrument.util.StringUtils; import org.springframework.beans.factory.annota...
Java
UTF-8
134
1.757813
2
[]
no_license
public class InsertionSortTests extends SortTests { @Override protected Sort createSort() { return new InsertionSort(); } }
Java
UTF-8
1,180
2.234375
2
[]
no_license
package com.codec; import io.netty.bootstrap.ServerBootstrap; import io.netty.channel.ChannelInitializer; import io.netty.channel.EventLoopGroup; import io.netty.channel.nio.NioEventLoopGroup; import io.netty.channel.socket.SocketChannel; import io.netty.channel.socket.nio.NioServerSocketChannel; import java.net.Inet...
Java
UTF-8
5,537
1.921875
2
[]
no_license
package com.example.administrator.expressuserclient.view.activity; import android.content.Intent; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.View; ...
Java
UTF-8
1,112
2.546875
3
[]
no_license
package core.gui.listeners; import core.Main; import core.gui.JFrameManager; import core.gui.panels.FirstPanel; import core.gui.panels.SecondPanel; import javax.swing.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class ChangeFirstScreenActionListener implements ActionListener { ...
C
UTF-8
2,372
2.703125
3
[]
no_license
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* list.c :+: :+: :+: ...
Java
UTF-8
1,637
2.265625
2
[]
no_license
package com.le.core.config.shiro; import com.le.system.entity.SysUser; import org.apache.shiro.SecurityUtils; import org.apache.shiro.session.Session; import org.apache.shiro.subject.Subject; import org.apache.shiro.web.mgt.DefaultWebSecurityManager; /** * @ClassName ShiroUtil * @Author lz * @Description Shiro工具类 ...
Java
UTF-8
435
2.4375
2
[]
no_license
import javax.swing.UIManager; public class MainDriver { /** * @param args */ public static void main(String[] args) { System.out.println("Game of Life"); try { //UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel" ); UIManager.setLookAndFeel("javax.swing.plaf.metal.Met...
Python
UTF-8
745
3.234375
3
[]
no_license
#!/usr/bin/python # -*- coding: UTF-8 -*- import matplotlib.pyplot as plt import numpy as np from io import BytesIO import pprint # 生成画布 fig=plt.figure() #生成子图,将画布分割成1行1列,图像画在从左到右从上到下的第1块 ax1=fig.add_subplot(111) #设置子图横坐标范围 ax1.set_xlim(0, 5) #设置子图纵坐标范围 ax1.set_ylim(0, 5) ax1.plot([1,2,3,4]) ax1.set_title("sample1") ...
C++
UTF-8
2,217
2.796875
3
[]
no_license
#include <Render/Camera.h> namespace Commons { namespace Render { CameraPtr Camera::MakePerspectiveCamera(float fovy, float aspect, float far, float near) { CameraPtr result = CameraPtr(new Camera()); result->setPerspective(fovy, aspect, far, near); return result; } CameraPtr Camera::MakeOrthoCamer...
Markdown
UTF-8
1,663
2.5625
3
[ "MIT" ]
permissive
# Fitness-Workout-App ## Project Title; Fitness-Workout-App. ## Description of App; The design and function of the APP is to allow the user to track their exercises throughout their time at the gym or home. Any workout can be created with a simple buttton and exercises for both resistence and cardio can be added. If...
Markdown
UTF-8
1,594
3.6875
4
[]
no_license
# [820. Short Encoding of Words](https://leetcode.com/problems/short-encoding-of-words) [中文文档](/leetcode/0800-0899/0820.Short%20Encoding%20of%20Words/README.md) ## Description <p>Given a list of <code>words</code>, we may encode it by writing a reference string <code>s</code> and a list of indexes <code>a</code>.</p...
Rust
UTF-8
2,420
3.15625
3
[]
no_license
use std::collections::VecDeque; fn print_matrix(matrix: [[&str; 5]; 5]) { for x in &matrix { let mut display_row = " ".to_owned(); for y in x { display_row.push_str(y.to_string().as_ref()); display_row.push(' '); } println!("{}", display_row); } } fn dep...
JavaScript
UTF-8
1,789
3.5
4
[]
no_license
$(document).ready(function() { var wins = 0; var losses = 0; var targetNumber = Math.floor(Math.random() * 120) + 19; var crystals = $("#crystals"); var counter = 0; var numberOptions = [Math.floor(Math.random()* 12) + 1, Math.floor(Math.random()* 12) + 1, Math.floor(Math.random()* 12) + 1, Math...
C++
GB18030
2,171
2.875
3
[]
no_license
#pragma once #include <string> #include <vector> #include <map> #include <set> using namespace std; // struct Server { string type; //ͺ int cpu_num; //CPU int mem_num; //ڴС double mech_cost; //Ӳɱ double day_cost; //ÿܺijɱ }; struct ServersAll { int type_num = 0; // map<string, Server> servers; //cpuСķtype ...