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
PHP
UTF-8
1,927
2.5625
3
[ "MIT" ]
permissive
<?php namespace AppBundle\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Request; use AppBundle\Entity\Repo; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\R...
JavaScript
UTF-8
5,431
2.671875
3
[]
no_license
/* * GameObject class. All displayed items use this. */ // Some trixie hacky setup of enums var AnimationState = { 'list': ['IDLE', 'WALKING', 'SHOT', 'PODDING'] }; for (var as in AnimationState.list) { AnimationState[AnimationState.list[as]] = 0x1 << as; // This one needs to go back and forth ...
Java
UTF-8
550
1.570313
2
[ "CDDL-1.0", "BSD-3-Clause", "LGPL-2.1-or-later", "MIT-0", "LicenseRef-scancode-warranty-disclaimer", "SAX-PD", "Apache-2.0", "BSD-2-Clause", "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-mx4j" ]
permissive
package org.javalite.activeweb; import app.services.RedirectorModule; import com.google.inject.Guice; import org.javalite.activejdbc.DBException; import org.junit.Before; import org.junit.Test; /** * @author Igor Polevoy: 3/5/12 11:19 AM */ public class Issue88Spec extends AppIntegrationSpec { @Before publ...
Markdown
UTF-8
8,870
2.53125
3
[]
no_license
--- description: "Easiest Way to Prepare Award-winning Spicy chorizo &amp;amp; longaniza shrimp soup" title: "Easiest Way to Prepare Award-winning Spicy chorizo &amp;amp; longaniza shrimp soup" slug: 1032-easiest-way-to-prepare-award-winning-spicy-chorizo-and-amp-longaniza-shrimp-soup date: 2020-11-19T01:24:55.964Z ima...
Ruby
UTF-8
976
2.828125
3
[]
no_license
require_relative './character_flyweight_factory' require_relative './font_flyweight_factory' require 'singleton' class CharacterAndFontFlyweightFactory include Singleton attr_accessor :font_and_characters attr_reader :character_flyweight_factory, :font_flyweight_factory def initialize @font_and_character...
Ruby
UTF-8
2,138
3.421875
3
[]
no_license
require './lib/pieces/knight.rb' require './lib/board.rb' RSpec.describe Knight do context "when the Knight is the only piece" do describe "#possible_moves" do it "returns a list of all possible moves for a Knight at the border" do board = double("Board") square = double("Square") a...
Python
UTF-8
3,241
3.15625
3
[]
no_license
import pygame from threading import Thread from time import clock from core.bullet import Bullet from core.player import Player from color.chord import Note class Game: def __init__(self, width=500, height=500): pygame.init() self.window = pygame.display.set_mode((width, height)) self.graph...
C
UTF-8
420
2.515625
3
[]
no_license
#include <stdio.h> #include <stdlib.h> #include <time.h> char data[12][12]; void swap (int n) { srand(time(NULL)); do { int times=88; int i,j,i1,j1; char t; while (times--) { i=rand()%n+1; j=rand()%n+1; i1=rand()%n+1; j1=rand()%n+1; t=data[i...
Java
UTF-8
1,285
2.703125
3
[]
no_license
package cn.maycope.util; /** * @Author Maycope * @Date 2020/8/21 * @Version 1.0 */ public enum ResultCode { SUCCESS(2000,"成功"), FAIL(5001,"失败"), RESULE_DATA_NONE(5002, "数据未找到"), ID_IS_ERROR(5003,"id有误"), ARTICLE_IS_ERROR(5004,"文章不存在"), NAME_OR_TITLED_D(5005,"文章名称或内容不存在"), ARTICLE_IS_TRU...
C++
UTF-8
11,450
3.25
3
[]
no_license
#include "test.hpp" void test_set(){ std::set<std::string> m; ft::set<std::string> ft_m; std::cout << "*Check empty (empty)*\n"; if (m.empty() == ft_m.empty()) std::cout << GREEN << "OK" << RESET << std::endl; else { std::cout << RED << "KO" << std::endl; std::cout << m.empty() << "!=" << ft_m.empty() << ...
JavaScript
UTF-8
671
2.578125
3
[]
no_license
import React, { createContext } from 'react'; const Context = createContext({ city: 'Kharkiv', updateCity: () => {}, coord: [], updateCoord: () => {}, }); export class UserProvider extends React.Component { updateCity = newCity => { this.setState({ city: newCity }); }; updateCoord = newCoord => { ...
Markdown
UTF-8
2,272
3.21875
3
[]
no_license
--- title: vue路由的实现原理 date: '4/1/2019 11:15:15 AM ' tag: ['js', 'vue-router', 'vue'] meta: - name: description content: null - name: keywords content: null --- ## vue路由的实现原理 > 在vue中路由主要有 hash与History interface两种方式实现前端路由,单页路由的特点就是采用前端路由系统,通过改变URL,在不重新请求页面的情况下,更新页面视图。目前在浏览器环境中这一功能的实现主要有两种方式 ### has...
C++
UTF-8
927
3.0625
3
[]
no_license
#pragma once #include<vector> #include<array> #include<sstream> #include<glm/glm.hpp> class Mesh { typedef std::array<int, 3> face; std::vector<glm::vec3> vtxs_; std::vector<face> faces_; std::vector<glm::vec4> planes_; std::vector<glm::vec3> vtx_normals_; void compute_planes(); void compute_vtx_normals(); ...
Java
UTF-8
290
1.617188
2
[]
no_license
package tam.rentalcars.repository.mongo; import org.springframework.data.mongodb.repository.MongoRepository; import org.springframework.stereotype.Repository; import tam.rentalcars.model.Color; @Repository public interface ColorRepositoryMongo extends MongoRepository<Color, String> { }
PHP
UTF-8
1,406
3.328125
3
[]
no_license
<!DOCTYPE html> <html> <body> <!-- using POST --> <?php $nameErr = $phoneErr= $commentErr = ""; $name = $phone = $comment = ""; if ($_SERVER["REQUEST_METHOD"] == "POST") { if (empty($_POST["name"])) { $nameErr = "Name is required"; } else { $name = test_input($_POST["name"]); if (!preg_match("/^[a-zA-Z ]*...
C#
UTF-8
12,866
3.171875
3
[ "Apache-2.0" ]
permissive
using Neko.Utility.Core.IO.Logging; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System; namespace Neko.Utility.Core.Data { /// <summary> /// 字符串帮助类 /// <para>可以对字符串进行一些快速操作</para> /// </summary> public sealed class StringUtil { /// <summary> /// 判断一个对象是否为空 ...
Python
UTF-8
6,063
2.828125
3
[]
no_license
from produtos.classes.Produtos import Pepsi from produtos.classes.Produtos import CocaCola from produtos.classes.Produtos import Dolly from produtos.classes.Produtos import GuaranaAntartica from produtos.classes.Caracteristicas import Caracteristicas from produtos.classes.Caracteristicas import Tamanho600ml from produt...
Java
UTF-8
3,133
2.59375
3
[]
no_license
package mum.edu.util; import java.nio.file.FileSystems; import java.nio.file.Files; import java.nio.file.Path; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Arrays; import java.util.Date; import java.util.List; import javax.persistence.EntityManager; import javax.persistence.Ent...
Markdown
UTF-8
11,294
3.359375
3
[]
no_license
--- title: TypeScript date: 2022-04-01 11:56:13 categories: - Fullstack tags: - Typescript --- ## Why TypeScript ### Types Types are applied to: - variables - function parameters - function returns - object values. ### JavaScript is Weakly-Typed. This means that types are assigned by the interpreter based on th...
Rust
UTF-8
9,800
2.984375
3
[ "MIT", "Apache-2.0" ]
permissive
use std::{ fmt::{self, Debug, Formatter}, pin::Pin, rc::Rc, }; use futures_lite::{Future, Stream, StreamExt}; use crate::{ channels::channel_mesh::{FullMesh, Senders}, task::JoinHandle, GlommioError, ResourceType, Result, }; /// Alias for return type of `Handler` pub type HandlerResult = Pin<...
Python
UTF-8
708
3.453125
3
[]
no_license
import turtle from turtle import Turtle , Screen import random turtle.colormode(255) color_list = [(239, 236, 238), (238, 237, 236), (237, 237, 241), (26, 108, 164), (194, 38, 81), (237, 161, 50), (234, 215, 86), (226, 237, 229)] tom = Turtle() color = random.choice(color_list) number_of_dots = 100 tom.penup() tom.set...
Markdown
UTF-8
2,692
3.203125
3
[ "MIT" ]
permissive
# Inscribe Note Taker ![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg) <br> With the Inscribe Note Taker, users are able to save, retrieve, and delete persistent notes at their convenience. This is made possible by Node.js, Express, and server-side functionality. <a href="https://inscribe-notes.h...
Python
UTF-8
1,717
3.921875
4
[ "BSD-3-Clause" ]
permissive
""" Filename: ecdf.py Authors: Thomas Sargent, John Stachurski Implements the empirical cumulative distribution function given an array of observations. """ import numpy as np import matplotlib.pyplot as plt class ECDF(object): """ One-dimensional empirical distribution function given a vector of obse...
Shell
UTF-8
106
2.546875
3
[]
no_license
#!/bin/bash echo -n "Enter a Password: " read -s pass_value echo "" echo "Password Entered: $pass_value"
C
UTF-8
883
2.84375
3
[ "CC0-1.0" ]
permissive
#ifndef __DEBUGUTIL_H__ #define __DEBUGUTIL_H__ #include "CDebugLogger.h" /* Christopher De Pasquale Created: 20th of April, 2018 Last Edit: 24th of April, 2018 Usage: DbgAssert(pPtr != NULL); DbgAssertMsg(pPtr != NULL, "The pointer is null!!!"); */ #ifdef NDEBUG #define DbgAssertMsg(ign...
Java
UTF-8
1,376
2.21875
2
[]
no_license
package report; import dbmodel.SourceChapterSummary; public class SourceChapterReport extends SourceChapterSummary { private Integer problemDoneCount; private Integer problemWrongCount; private Integer problemBlankCount; public SourceChapterReport(SourceChapterSummary sourceChapterSummary) { ...
JavaScript
UTF-8
342
3.5625
4
[]
no_license
/** * @param {string} S * @return {string} */ var reorganizeString = function(S) { const arr = S.split('') console.log('arr: ', arr); let item = 0; }; /* 示例 1: 输入: S = "aab" 输出: "aba" 示例 2: 输入: S = "aaab" 输出: "" */ var S = "aab" var S = "aaab" var val = reorganizeString(S); console.log('val: ', val);
Markdown
UTF-8
8,307
2.734375
3
[]
no_license
--- title: "GPU passthrough - my switch to Linux" excerpt_separator: "<!--more-->" categories: - Blog tags: - Other - Linux --- A few weeks ago I decided to ditch my Windows workstation and move to Linux. While Microsoft is (in my opinion) going in the right direction (WSL 2, Terminal, Package Manager) they are ...
Go
UTF-8
2,716
2.515625
3
[]
no_license
package main import ( "b2/backend" "b2/components/analysis" "b2/components/changes" "b2/components/exrecords" "b2/components/managed/accounts" "b2/components/managed/assets" "b2/components/managed/classifications" "b2/components/managed/docexmappings" "b2/components/managed/documents" "b2/components/managed/...
Markdown
UTF-8
550
2.640625
3
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
--- permalink: / title: "About Me" excerpt: "About me" author_profile: true redirect_from: - /about/ - /about.html --- My name is Zonghao Huang. I am currently a Ph.D. student at [Department of Computer Science, Duke University](https://www.cs.duke.edu/), where I am fortunately advised by Prof. [Michael Reiter](h...
C#
UTF-8
3,023
2.828125
3
[]
no_license
using System; using System.IO; using System.Xml; using System.Xml.Serialization; namespace BJCBCPOS.Services.Helpers { public static class XmlHelper { /// <summary> /// Deserialize XML File the object T /// </summary> /// <param name="xmlFile">Full Path and file name</par...
Swift
UTF-8
10,681
2.671875
3
[]
no_license
// // FirstViewController.swift // IoT_Respirator // // Created by Alexander Luisi on 29/05/2019. // Copyright © 2019 Alexander Luisi. All rights reserved. // import UIKit import NotificationCenter import Charts import CoreLocation struct GlobalArrays { static var globalData: [ReadingPacket] = [] static v...
Python
UTF-8
267
2.984375
3
[]
no_license
def main(steps = 3, iterations = 2017): l = [0] pos = 0 for i in range(0, iterations): pos = (pos + steps) % len(l) l.insert(pos + 1, i + 1) pos += 1 print(l[l.index(2017) + 1]) if __name__ == '__main__': main(steps = 303)
JavaScript
UTF-8
402
3.359375
3
[]
no_license
//given an array of prices, return maximum profit from a single transaction var maxProfit = function(prices) { let buy, sell; let maxProfit = 0; for(let i = 0; i < prices.length; i++){ buy = prices[i]; for(let j = i + 1; j < prices.length; j++){ sell = prices[j]; maxP...
Shell
UTF-8
470
2.640625
3
[]
no_license
#!/bin/bash notify-send 'Backup script' 'Start backing up /home' --icon=dialog-information rsync -e "ssh" --progress --ignore-errors --delete-after --exclude-from=/home/nop-90/scripts/rsync-exclude.txt -rav /home/nop-90/{.*,*} rsync@node:/external2/home if [ $? -eq 0 ]; then notify-send 'Backup script' 'Backup fini...
JavaScript
UTF-8
2,645
3.109375
3
[]
no_license
import { useState, Component } from "react"; import ExerciseArrayExtended from './ExerciseArrayExtended' const mainContainerStyle = { display: 'flex', flexDirection: 'column', alignItems: 'center', marginTop: 250 } const tableContainerStyle = { flexDirection: 'row', display: 'flex', justi...
Markdown
UTF-8
390
2.625
3
[]
no_license
# Image Similarity Computation Based on Euclidean Distance # Introduction Using the color moments of the images which are extracted, we can calculate the similarity between the images by Euclidean distance. 通过提取图像的颜色矩,利用欧式距离求解图像间的相似度。 # Environment Windows 10 Matlab 2016 # Demo https://youtu...
Python
UTF-8
300
2.859375
3
[]
no_license
from scanner import scanner from solver import sudoku scan = scanner( "/home/zoh/Programming_Data/Projects/Sudoku_Solver/Pics/Train_data/4.jpg") scan.getDigits() grid = scan.grid slv = sudoku(grid) ifSolved = slv.solve() if ifSolved == True: slv.show() else: print("Couldn't Solve")
Java
UTF-8
3,254
2.5
2
[]
no_license
package com.ez.framework.core.pojo; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.lang.reflect.Method; import org.apache.commons.lang.builder.EqualsBuilder; import org.ap...
Python
UTF-8
1,294
3.921875
4
[]
no_license
import gc class Node: def __init__(self, data): self.data = data self.next = None self.prev = None class DoublyLinkedList: def __init__(self): self.head = None def push(self, new_data): new_node = Node(new_data) new_node.next = self.head if self.hea...
C#
UTF-8
1,174
3.09375
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace LearnCSharp { class OverrideExample { public static void CallMe() { //nothing to call or display as of now } class MyConceptBase { //public virtual in...
Java
UTF-8
549
2.34375
2
[]
no_license
package com.anthill.to_sql.type; public class TypeArg { private String name; private String dataType; public String getName() { return name; } public void setName(String name) { name = (name != null) ? name.trim() : null; this.name = (name != null && name.length() == 0) ? null : name; } public String ...
Java
UTF-8
238
2.671875
3
[]
no_license
package com.cn.thread.runnable; public class RunnableImpl1 implements Runnable { @Override public void run() { for (int i = 0; i < 1000; i++) { System.out.println("RunnableImpl1 : " + i ); } } }
JavaScript
UTF-8
2,362
2.765625
3
[]
no_license
// Row of a single course, used in course-table import React, {useState} from 'react' import {Link} from "react-router-dom"; const CourseRow = ( { course, title, lastModified, owner, updateCourse, deleteCourse }) => { const day = new Date(); const option...
Markdown
UTF-8
2,216
3.328125
3
[ "MIT", "CC-BY-3.0" ]
permissive
<a name="FontDescriptor"></a> ## FontDescriptor An object that contains information on a system font. **Kind**: global class * [FontDescriptor](#FontDescriptor) * [new FontDescriptor(family, size, weight, italic, stretch)](#new_FontDescriptor_new) * [.getFamily()](#FontDescriptor+getFamily) ⇒ <code>string<...
Java
UTF-8
1,665
2.359375
2
[]
no_license
package model.dto; public class UserIllnessDto { private Integer idU; private String cnp; private String bloodGroup; private String nameUser; //private Integer idI; private String nameIllness; private String description; public UserIllnessDto(Integer idU, String cnp, String bloo...
Java
UTF-8
3,590
2.828125
3
[]
no_license
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package apptransi; import java.util.ArrayList; /** * * @author pcsiecon */ public class Transi { private ArrayList<Alumno> alumnos; public Transi() { alumnos = new ArrayList<Alumno>(); } /...
Python
UTF-8
2,307
3.171875
3
[]
no_license
import sys import traceback class Screen(): '''屏幕类用来管理绘制屏幕图像''' def __init__(self, setting, pygame): '''初始化''' self.pygame = pygame if setting.fullScreenDisplay: # pygame.HWSURFACE #硬件加速,#仅全屏模式 # pygame.DOUBLEBUF #双缓冲 # pygame.FULLSCREEN #全屏显示 ...
Java
UTF-8
2,788
2.96875
3
[]
no_license
package com.niuan.common.ezyer.util.thread; /** * BackgroundTask是在后台运行的任务,该任务会根据executorId的不同被安排在不同线程, * 相同executorId的任务会运行在相同的线程,并且根据execute调用方法的先后顺序而进行排队,先调用的会先执行 * * @author carlosliu * */ public abstract class BackgroundTask<PARAMS, PROGRESS, RESULT> { private boolean mIsCanceled; public static final int ...
Java
UTF-8
748
3.84375
4
[]
no_license
package com.test.mvnmyExample; import java.util.Random; public class IntRand { /** * Initialises array & sums numbers uses static methods The array consists * of randomly generated ints */ public static int[] popArray(int size) { // initialising array int[] myArray = new int[size]; // creating the ran...
Java
UTF-8
2,929
2.171875
2
[]
no_license
package com.cg.fds.service; import java.util.Optional; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.function.Executable; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.Mockito; i...
Shell
UTF-8
644
3.0625
3
[]
no_license
#!/bin/bash cd "$(dirname "$0")" # Start up Google Compute Engine instances cd terraform terraform apply # Create ansible hosts file cat <<EOS >../ansible/hosts [master] $(terraform output -json instance_ips | jq '.[0]' | tr -d '"') [slave] $(terraform output -json instance_ips | jq -r '.[1:] | join("\n")' | tr -d ...
JavaScript
UTF-8
757
3.09375
3
[]
no_license
function validateFirstName(data){ var ans = ""; if(data.trim() == ""){ ans = "This is required!"; } return ans; } function validateLastName(data){ var ans = ""; if(data.trim() == ""){ ans = "This is required!"; } return ans; } function validateMobileNumber(data){ var ans = ""; if(isNaN(data)){...
Markdown
UTF-8
1,293
3.421875
3
[]
no_license
# Weather These are examples from the [Exploring Data tutorial](https://vega.github.io/vega-lite/tutorials/getting_started.html). --- Let’s use a tick mark to show the distribution of precipitation. <div id='tick'></div> To better see the distribution of precipitation data, we can create a histogram. <div id='his...
C++
UTF-8
13,614
2.546875
3
[]
no_license
#pragma once // This has 2 classes // A) MonoGeometry // B) StereoGeometry //opencv #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/calib3d.hpp> #include <opencv2/imgproc/imgproc.hpp> #include <iostream> #include <string> #include "camodocal/camera_models/Camera.h" #include...
C#
UTF-8
1,172
3.5625
4
[]
no_license
using System; namespace ClientApplicationFactoryDesignPattern { class Program { static void Main(string[] args) { //Console.WriteLine("Hello World!"); CardFactory factory = null; Console.WriteLine("Enter the card type you would like to visit: "); ...
PHP
UTF-8
489
3.515625
4
[]
no_license
<?php class Deck { protected $cards = array(), $index; protected $available_suits = array( 'hearts', 'spades', 'clubs', 'diamonds' ); public function __construct() { foreach ($this->available_suits as $suit) { for ($i = 1; $i <= 13; $i++) { $this->cards[] = new Card($i, $suit); } } $thi...
Java
UTF-8
4,268
2.484375
2
[]
no_license
package me.IcanR.CombatGui; import java.util.ArrayList; import java.util.List; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler...
Java
UTF-8
667
2.15625
2
[ "MIT" ]
permissive
package com.zjx.readlife.ireader.ui.adapter; import android.content.Context; import com.zjx.readlife.ireader.model.bean.CommentBean; import com.zjx.readlife.ireader.ui.adapter.view.CommentHolder; import com.zjx.readlife.ireader.ui.base.adapter.IViewHolder; import com.zjx.readlife.ireader.widget.adapter.WholeAdapter; ...
Python
UTF-8
406
2.625
3
[ "MIT" ]
permissive
def display_table(t): display(Markdown( '<div class="datatable">' + tabulate(t, headers='keys') + "\n\n</div>" )) def table_ds(ds, fdr, le_prop=0.0, nes=0.0): df = ds.to_dataframe() df.reset_index(level=0, inplace=True) df = df.loc[(df['fdr'] < fdr) & (df['le_...
Rust
UTF-8
2,058
2.96875
3
[]
no_license
use async_std::net::{TcpListener, TcpStream}; use async_std::stream::StreamExt; use async_std::task; use std::env; use std::io::{ErrorKind, Result}; mod noise; fn main() { let count = env::args().count(); if count < 3 { usage(); } let mode = env::args().nth(1).unwrap(); let port = env::arg...
C#
UTF-8
6,188
2.515625
3
[]
no_license
using System; using System.Linq; using System.Collections.Generic; using Frontend2; using Frontend2.Hardware; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace VendingMachineTester { [TestClass] public class GoodWeirdOrdering { /// <summary> /// UT01-GO /// Checking val...
C#
UTF-8
1,926
2.59375
3
[]
no_license
/* * Created by SharpDevelop. * User: Eucliwood * Date: 12-Oct-17 * Time: 23:51 * * To change this template use Tools | Options | Coding | Edit Standard Headers. */ using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Windows.Forms; using System.Text; ...
TypeScript
UTF-8
1,107
2.5625
3
[]
no_license
import { Body, Controller, Post, ValidationPipe, Headers, Get, } from '@nestjs/common'; import { AuthCredentialsDto } from './dto/auth-credentials.dto'; import { AuthService } from './auth.service'; import { UserEntity } from './user.entity'; @Controller() export class AuthController { /** * * @par...
TypeScript
UTF-8
1,037
3.3125
3
[]
no_license
export interface TypedSchema<T> { type: T getSchema(): JSONSchema } export type JSONSchema = object export type UnwrapTypedSchema<Schema> = Schema extends TypedSchema< infer InnerType > ? InnerType : never export type TypeOf<Schema extends TypedSchema<any>> = Schema['type'] export interface BaseSchemaDefi...
C#
UTF-8
550
2.828125
3
[]
no_license
using System.Collections; using System.Collections.Generic; using UnityEngine; /// <summary> /// Update the in game text to display the speed of the train. /// </summary> public class DisplaySpeed : DisplayText { /// <summary> /// As long as the game isn't over (meaning not gamestate 6). /// Show the cu...
TypeScript
UTF-8
1,556
2.5625
3
[ "MIT" ]
permissive
import { Injectable } from '@angular/core'; import { Http, Headers, RequestOptions, Response } from '@angular/http'; import { User } from '../_models/index'; @Injectable() export class UserService { constructor(private http: Http) { } /** * Get all User */ getAll() { return this.http.g...
Java
UTF-8
10,175
3.046875
3
[]
no_license
package com.ivangorbachev; import java.util.*; import static java.lang.Math.*; public class ConvexPolygonGame { class Point { long x, y; Point(long x, long y) { this.x = x; this.y = y; } @Override public String toString() { return "Po...
PHP
UTF-8
572
2.515625
3
[]
no_license
<?php require("parser.php"); $parser = new Parser(); function getMenu(){ global $parser; echo $parser->getMenu(); } function stickies(){ global $parser; return $parser->getStickies(); } function getWelcomeTitle(){ global $parser; ech...
Java
UTF-8
1,963
2.1875
2
[ "Apache-2.0" ]
permissive
package org.apache.ofbiz.webapp.website; import lombok.experimental.FieldNameConstants; import java.io.Serializable; import lombok.Getter; import lombok.Setter; import java.sql.Timestamp; import org.apache.ofbiz.entity.GenericValue; import java.util.List; import java.util.ArrayList; /** * Web Page */ @FieldNameCons...
Java
UTF-8
15,893
3.078125
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 javaapplication5; /** * * @author SUJITHA */ /* * To change this template, choose Tools | Templates * and open the templa...
JavaScript
UTF-8
1,081
3.328125
3
[]
no_license
console.log("Weight-Converter Using Javascript 🚀") let kilogram = document.querySelector("#Kilogram"); let converter = document.querySelector("#Convert"); let card = document.querySelector("#card"); // console.log(kilogram,converter) converter.addEventListener("click",function(){ kg_value = kilogram.value; ...
Java
UTF-8
250
2.921875
3
[]
no_license
public class PostOrder { public static void postOrder(TreeNode<Integer> root) { if(root==null) { return ; } for(int i=0;i<root.children.size();i++) { postOrder(root.children.get(i)); } System.out.print(root.data+" "); } }
C++
UTF-8
1,007
3.09375
3
[]
no_license
#include <queue> #include "solution.h" using namespace std; vector<int> Solution::findOrder(int numCourses, vector<vector<int>>& prerequisites) { vector<int> res; vector<int> indegree(numCourses,0); vector<vector<int>> adjacency(numCourses); for (auto item : prerequisites) { indegree[item...
Java
UTF-8
2,329
1.9375
2
[]
no_license
package com.allens.allenstools.activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.TextView; import androidx.annotation.Nullable; import com.allens.allenstools.R; import com.allens.lib_base.base.BaseActivity; import com.example.lib_login_facebook.FaceBoo...
Python
UTF-8
2,759
2.78125
3
[]
no_license
import os import shutil from .sv_handler import SVHandler from .xlsx_handler import XlsxHandler def sv_dir_to_xlsx(dir_path,newpath,file_extenstion='.csv'): """ A function to convert a directory of sv files to a directory of xlsx files. :param dir_path: The path for where to directory is located :type dir_path: str...
Python
UTF-8
277
3.171875
3
[]
no_license
import memes print("Hello Hack Quarantine!") def main(): print("This is the next step of the workshop!") print(memes.get_random()) print(memes.get_meme()) print("This is the last step of the workshop!") print(memes.cats()) print(memes.dogs()) print(memes.fish()) main()
Markdown
UTF-8
3,217
2.609375
3
[]
no_license
--- layout: commandcall category: CommandCall title: "QUERY_NON_MOVABLE_MODEL_INCOMING_INTERREFS" tags: 1.3 1.5 --- QUERY_NON_MOVABLE_MODEL_INCOMING_INTERREFS returns a list of non movable incoming interrefs from one model to another model. # Syntax: ```adoscript {% raw %} QueryNonMovableIncomingInterrefs : QUERY_...
Python
UTF-8
545
3.78125
4
[]
no_license
numbers = [3, 1, 4, 1, 5, 9, 2] # numbers[0] = 3 # numbers[-1] = 9 # numbers[3] = 1 # numbers[:-1] = 3 1 4 1 5 # numbers[3:4] = 4 # 5 in numbers = [4] # 7 in numbers = [6] # "3" in numbers = [0] # numbers + [6, 5, 3] = 3 1 4 1 5 9 2 6 5 3 print(numbers[0]) print(numbers[-1]) print(numbers[3]) print(numbers[:-1]) prin...
Java
UTF-8
1,114
3.5
4
[]
no_license
//Scan all primitive data types import java.util.ArrayList; /** * Created by: Michias Shiferaw * Created on: Sept 2016 * Stack of items class. */ public class MrCoxallStackpp<S> { private static final ArrayList<Integer> stackey = new ArrayList<Integer>(); /** * Created by: Michias Shiferaw * Created...
Java
UTF-8
544
1.890625
2
[]
no_license
package com.sri.straylight.client.util; import com.sri.straylight.fmuWrapper.voManaged.ScalarValueCollection; import com.sri.straylight.fmuWrapper.voNative.ConfigStruct; import com.sri.straylight.fmuWrapper.voNative.SimStateNative; /** * The Interface IFmuConnect. */ public abstract class FmuConnectionAbstract {...
SQL
UTF-8
15,557
2.8125
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 3.2.0.1 -- http://www.phpmyadmin.net -- -- Servidor: localhost -- Tiempo de generación: 16-05-2010 a las 14:10:32 -- Versión del servidor: 5.1.36 -- Versión de PHP: 5.3.0 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101...
JavaScript
UTF-8
1,879
3
3
[]
no_license
/** * Main rendering function for GET request */ function doGet() { return HtmlService.createHtmlOutputFromFile('calc.html') .addMetaTag('viewport', 'width=device-width, initial-scale=1') .setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL); } var MAX_REWARD = 50 * 1e6; /** * Calculate the rew...
Python
UTF-8
15,898
2.796875
3
[ "MIT" ]
permissive
import numpy as np from abc import ABCMeta, abstractmethod from ezclimate.damage_simulation import DamageSimulation from ezclimate.forcing import Forcing class Damage(object, metaclass=ABCMeta): """Abstract damage class for the EZ-Climate model. Parameters ---------- tree : `TreeModel` object provides the tree ...
Java
UTF-8
4,350
2.4375
2
[]
no_license
package com.crossover.trial.properties; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.Comparator; import java.util.List; import java.util.Map.Entry; import java.util.Properties; import java.util.concurrent.Callable; import java.util.concurrent.ExecutionExceptio...
Java
UTF-8
9,659
1.929688
2
[]
no_license
package com.example.pang.spacedelivery.Customer; import android.annotation.SuppressLint; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; import android.support.v7.app.AppCompatActivi...
Java
UTF-8
2,328
2.375
2
[]
no_license
package com.redis.service; import com.redis.model.Programmer; import com.redis.repository.ProgrammerRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; import java.util.Map; import java.util.Set; @Service public class Progra...
JavaScript
UTF-8
562
2.53125
3
[]
no_license
var url = "week-15"; function updateUrl () { var text = url; $("#url").val(text); var urlInput = $("#url"); } function getUrl () { return $("#url").val().trim(); } $(function () { $("#url").keyup(function(event){ url = getUrl(); if(url.charAt(0) == "-") url = url.substring(1); ...
C++
UTF-8
1,694
3.375
3
[]
no_license
#include <iostream> #include <string> #include <vector> class Publisher ; class Subscriber { std::vector<Publisher*> subscribed_to ; public: void subscribeTo(Publisher*); virtual void getPublication(const Publisher*) = 0 ; }; class Person : public Subscriber { std::string name ; publ...
Python
UTF-8
1,893
2.6875
3
[]
no_license
import cv2 import numpy as np def set_point_to_displace(height_queue, points_to_displace_queue): cap = cv2.VideoCapture(0) while True: cam_constant = 557 if height_queue.empty(): print("empty queue") pass else: cam_height = height_queue.get() ...
Java
UTF-8
508
2.984375
3
[]
no_license
package seo.dale.practice.java.util.queue; import org.junit.Test; import java.util.PriorityQueue; import java.util.Queue; public class PriorityQueueTest { private Queue<String> queue; @Test public void test() { queue = new PriorityQueue<>(3); queue.add("A"); queue.add("B"); ...
C++
UTF-8
1,292
3.859375
4
[]
no_license
#include<iostream> #include<cstring> using namespace std; struct stringy { char * str; int ct; }; //prototypes for set(), show(), and show() go here void set(stringy &string, char str[]) // I don't use a pointer here because the string isn't passed as a pointer-to-character. { int i = 0; while(str[i] != '\0') ...
Python
UTF-8
3,494
2.6875
3
[ "MIT" ]
permissive
from environments.blackjack import BlackJack import pandas as pd import rl_learning as rl def learn_Q_function(all_observed_decision_states, reward, model): """ Episodic learning (mostly for lookup table method) - helper method """ if model.model_class == 'lookup_table': model.fit(all_observed_...
PHP
UTF-8
2,551
2.828125
3
[]
no_license
<?php namespace RoarProj\controllers\middlewares; use Silex\Application; use Symfony\Component\HttpFoundation\ParameterBag; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Validator\ConstraintViolationListInterface; use RoarProj\exceptions\ValidationException; class RequestValidator { const ...
Markdown
UTF-8
16,792
3.03125
3
[ "MIT" ]
permissive
--- title: '파이썬을 이용한 클린 코드를 위한 테스트 주도 개발 - 3장 단위 테스트를 이용한 간단한 홈페이지 테스트' date: 2019-12-23 12:00:00 category: 'tdd' --- ## Intro 본격적인 To-Do 웹 에플리케이션 개발을 위해 단위 테스트를 만들어본다. ## 첫 Django 애플리케이션과 첫 단위 테스트(예제 : [03-01](https://github.com/PilhwanKim/books/blob/master/test_driven_development_with_python/ch03/03-01)) - Django...
C
UTF-8
1,575
3.84375
4
[]
no_license
#include<stdio.h> #include<stdlib.h> struct Stack { int size; int top ; int *Starr ; }; struct Queue{ struct Stack s1 ; struct Stack s2 ; }; struct Stack* create (int size){ // struct Stack* st ; struct Stack* st=(struct Stack*)malloc(sizeof(struct Stack)); st->top=-1 ; st->size=size ; ...
PHP
UTF-8
1,268
2.9375
3
[]
no_license
<?php function convert_to_impGallon($value, $from_unit) { switch($from_unit) { case 'bucket': return $value * 4; break; case 'butt': return $value * 108; break; case 'firkin': return $value * 9; break; case 'hogshead': return $value * 5...
Java
UTF-8
813
3.203125
3
[]
no_license
import java.io.PrintWriter; import java.net.*; import java.util.concurrent.*; import java.util.*; public class HelperClient extends Thread { Socket sock; PrintWriter out; Scanner in; int id; public HelperClient (int id, Socket s ) { this.id = id; sock = s ; } public void run () { ...
Swift
UTF-8
2,709
3.15625
3
[]
no_license
// // ViewController.swift // DBPractice // // Created by 김다정 on 2020/07/22. // Copyright © 2020 김다정. All rights reserved. // import UIKit class ViewController: UIViewController { @IBAction func getData(_ sender: Any) { self.textFieldTitle.text = UserDefaults.standard.object(forKey: "title") as? Strin...
Java
UTF-8
5,769
2.53125
3
[]
no_license
package edu.school.api; import edu.school.entities.Action; import edu.school.entities.ActionTarget; import edu.school.entities.Activity; import edu.school.entities.ActivityTarget; import edu.school.entities.ActivityType; import edu.school.entities.Group; import edu.school.entities.GroupMember; import edu.school.entiti...