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,185
2.578125
3
[ "MIT" ]
permissive
using System; using HotChocolate.Types.Helpers; namespace HotChocolate.Types.Descriptors { internal class EnumTypeNameDependencyDescriptor : IEnumTypeNameDependencyDescriptor { private readonly IEnumTypeDescriptor _descriptor; private readonly Func<INamedType, NameString> _createName; ...
Markdown
UTF-8
3,138
3.890625
4
[ "MIT" ]
permissive
#### C++ Arrays and Vectors --- # Vectors are Array++ A **[[C++ Include vector|vector]]** is an ordered list of items of a given data type. Each item in a vector is called an **element**. ```cpp #include <vector> // vector<dataType> identifier(numElements); vector<int> myVector(5); // an integer vector with 5 ele...
Markdown
UTF-8
1,386
2.953125
3
[ "Apache-2.0" ]
permissive
## nginx缓存 ```shell # 设置缓存保存的目录 #levels ⽬录分级 #keys_zone 设置共享内存以及占用的空间大小,开启的keys空间名字:空间⼤⼩(1m可以存放8000个key) # max_size 设置缓存大小,⽬录最⼤⼤⼩(超过时,不常⽤的将被删除) # inactive 超过此时间,没有被访问的缓存将清理 # use_temp_path 设置临时目录。 off关闭临时目录 proxy_cache_path /usr/local/nginx/upstearm_cache levels=1:2 #⽬录分级 keys_zone=mycache:5m max_size=1G ina...
JavaScript
UTF-8
1,961
2.640625
3
[ "MIT" ]
permissive
import React from 'react' const updaters = new Set() let time = Date.now(), hash = 10, delta = 0.017 requestAnimationFrame(function loop() { let newTime = Date.now() delta = (newTime - time) / 1000 time = newTime hash = (hash + 1) % 1024 updaters.forEach((updater) => updater(hash)) requestAnimationF...
Java
UTF-8
1,689
2.421875
2
[]
no_license
package com.instagram_sample; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.Snackbar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import andr...
TypeScript
UTF-8
890
2.609375
3
[]
no_license
const { ApolloServer, gql } = require("apollo-server"); const books = [ { title: "Harry Potter and the Chamber of Secrets", author: "J.K. Rowling" }, { title: "Jurassic Park", author: "Michael Crichton" } ]; const resolvers = { Query: { books: () => books }, Mutation: { addBook: ...
JavaScript
UTF-8
182
2.5625
3
[]
no_license
export const getRandomNumber = (min, max) => Math.round(Math.random() * (max - min) + min); export const getRandomArrayItem = (array) => array[getRandomNumber(0, array.length - 1)];
Java
UTF-8
616
2.4375
2
[]
no_license
package rd.utils; import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class AppUtil { public static String getStatus(String source) { List<String> newQualifier = new ArrayList<String>(Arrays.asList("name card", "advertisement")); List<String> preQualifiedQualifier = new ArrayList<S...
Markdown
UTF-8
75,414
3.46875
3
[]
no_license
# 0401. Sample Surveys in the Real World In this chapter you will: Discover that sampling errors occur in even the best samples. Learn that nonsampling errors may occur. See how question wording may impact survey responses. Understand that the results that are reported from samples are typically not from a simple ...
Java
UTF-8
2,427
3.234375
3
[]
no_license
package it.alex.lab9.operation; import java.util.Stack; public class Multiplication extends AbstractOperation { public final String getOperationSymbol() { String symbol = "*"; return symbol; } public String getName() { return "Multiplication"; } public String operate(Str...
Markdown
UTF-8
1,450
3.21875
3
[]
no_license
# Pype Pipe files to python. ## Tutorial Pype has mainly two modes of operations: command line and interactive (`-i`). It's mode of operation is very simple you need to pipe the output of the file you need to manipulate to pype's input: ``` cat myfile.txt | pype ``` You will then be apply to apply transformations...
Java
UTF-8
2,926
2.765625
3
[ "MIT" ]
permissive
/** * Somos a equipe "Agente junto e a gente separado", formados pelos integrantes Alex Sandro Zarpelon e Bruna Gabriela Disner */ package br.uffs.cc.jarena; import javax.net.ssl.TrustManagerFactorySpi; public class AgenteJuntoEAGenteSeparado extends Agente { int contador; int time = 20; int tempo = 0;...
C#
UTF-8
1,052
3.109375
3
[]
no_license
using System; using System.Collections.Generic; using System.Text; namespace ORM.Models { public class Order_Delivery_Method { private decimal _price; public int Id { get; set; } public string MethodName { get; set; } public decimal Price { get { re...
C#
UTF-8
494
2.8125
3
[]
no_license
<#@ import namespace="System.IO" #> <#@ template debug="false" hostspecific="true" language="C#" #> <# string path = this.Host.ResolvePath(@"PocoClass.cs"); var PocoLines= File.ReadLines(path).ToArray(); List<string> usingStatements = new List<string>(); foreach (var line in pocoLines) ...
PHP
UTF-8
4,055
2.859375
3
[]
no_license
<?php require_once $_SERVER["DOCUMENT_ROOT"]."/_code/includes/_config.php"; require_once $_SERVER["DOCUMENT_ROOT"]."/_code/includes/_conexion.php"; require_once $_SERVER["DOCUMENT_ROOT"]."/_code/modelos/Clase.php"; class ClaseMatriz { private $matriz = array(); public function set_matriz($matriz) { ...
Python
UTF-8
811
3.359375
3
[]
no_license
""" Generate stats.txt in which each location is used as the key in the created dictionary. The content of each item in the dictionary is a count number, which counts the frequency of each location author: Haitao Wang date: 3/8/2018 """ import json import os path = os.path.dirname(os.path.realpath(__file__)) data = ...
TypeScript
UTF-8
294
2.875
3
[ "MIT" ]
permissive
export class PhoneModel { phone: string; code: string; number: string; length: number; constructor(code: string, number: string) { this.code = code; this.number = number; this.phone = code + number; this.length = this.phone.length; } }
Java
UTF-8
540
1.984375
2
[]
no_license
package com.example.secondtravelapp.Models; import androidx.lifecycle.LiveData; import java.util.List; public interface IHistoryDataSource { public List<Travel> getTravels() throws Exception; public Travel getTravel(String id) throws Exception; public void addTravel(Travel p) throws Exception; public...
SQL
UTF-8
137
2.671875
3
[]
no_license
-- Query the difference between the maximum and minimum populations in CITY. select max(population) - min(population) as diff from city;
Java
UTF-8
2,781
1.945313
2
[]
no_license
package com.marcarndt.morsemonkey.telegram.alerts.command; import com.marcarndt.morsemonkey.services.ConfigureService; import com.marcarndt.morsemonkey.services.HttpChecker; import com.marcarndt.morsemonkey.services.StateService; import com.marcarndt.morsemonkey.services.StateService.State; import com.marcarndt.morsem...
Java
UTF-8
2,307
2.1875
2
[]
no_license
package com.practice.work.films.dtos; import io.swagger.annotations.ApiModelProperty; import lombok.*; import org.springframework.data.annotation.CreatedDate; import org.springframework.data.annotation.Id; import org.springframework.format.annotation.DateTimeFormat; import javax.validation.constraints.*; import java....
Java
UTF-8
472
2.40625
2
[]
no_license
package demosim1; /** * A sample application used as a starting point for implementing a timed petri net simulator. * SSATR / IASIC & ICAF / Master / An 1 / 2017 * @author evo */ public class Main { /** * @param args the command line arguments */ public static void main(String[] args) throws E...
Shell
UTF-8
323
3.78125
4
[]
no_license
#! /bin/bash/ -x read -p "Enter any number : " num; if [ $num -ge 1 ] then check=0; for (( i=2;i<$num;i++ )) do if [ $(( num%i )) -eq 0 ] then check=1; fi done if [ $check -eq 1 ] then echo "$num is not a Prime number "; else echo "$num is a Prime number "; fi ...
Python
UTF-8
511
3.5
4
[]
no_license
def pangrams(s): alphabets = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'] alpha = '' for i in s: if i.isalpha() and i.lower() not in alpha: if s.count(i) <= 0: return 'not pangram' alpha += i....
Java
UTF-8
2,999
2.1875
2
[]
no_license
package com.springboot.mvc.login.service; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.any; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Optional; import org.junit.Before; import org.jun...
Shell
UTF-8
1,310
3.546875
4
[]
no_license
#!/bin/sh if ! INSTALL_DIR="$(dirname $(dirname $(realpath "${0}")))" then echo "Cannot locate installation dir relative to ${0}" exit -2 fi SIGNER_DIR="${INSTALL_DIR}/authorities/${1}" if [ ! -d ${SIGNER_DIR} ] then echo "${SIGNER_DIR} does not exist as a directory" exit -3 fi SIGNED_DIR="$...
Rust
UTF-8
4,056
3.71875
4
[]
no_license
// macro pub fn first() { // “宏”(macro)是 Rust 的一个重要特性。 // Rust 的“宏”(macro 是一种编译器扩展,它的调用方式为 some_macro!(…)。 // 宏调用与普通函数调用的区别可以一眼区分开来,凡是宏调用后面都跟着一个感叹号。 // 宏也可以通过 some_macro![…]和 some_macro!{…}两种语法调用,只要括号能正确匹配即可 // 与 C/C++ 中的宏的区别 // 首先,Rust 的宏在调用的时候跟函数有明显的语法区别; // 其次,宏的内部实现和外部调用者处于不同名字空间,它的访问范围...
Java
UTF-8
1,961
2.09375
2
[ "Apache-2.0" ]
permissive
package nl.futureedge.simple.jta.store.jdbc.sql; import org.junit.Assert; import org.junit.Test; public class JdbcSqlTemplateTest { @Test public void testHsqldb() { final JdbcSqlTemplate result = JdbcSqlTemplate.determineSqlTemplate("jdbc:hsqldb:hsql:localhost/jta"); Assert.assertNotNull(resu...
Markdown
UTF-8
667
2.640625
3
[]
no_license
--- layout: work title: Lead Frontend Developer at Nabbesh tech_stack: React.js, JavaScript, Python, Django, Elasticsearch, Sass, py.test, AWS, Docker, Terraform work_type: Remote, Full time work_period: November 2015 - December 2016 image: nabbesh.jpg order: 10 type_tags: full_time, remote link: https://www.nabbesh.co...
C#
UTF-8
547
2.578125
3
[]
no_license
using UnityEngine; public class ScreenResizer : MonoBehaviour { Camera cam; public int ppu = 128; public int scale = 1; void Start () { Resize(); } public void Resize() { cam = gameObject.GetComponent<Camera>(); //Debug.Log("Screen Resolution: " + cam.pixelWidth + ...
Java
UTF-8
1,909
3.484375
3
[]
no_license
package day09; import java.sql.Connection; import java.sql.DriverManager; import java.sql.Statement; import java.sql.ResultSet; import java.util.ArrayList; import java.util.List; // Table -> Class class StudentVO { // field -> property private String stId = null; private String name = null; private St...
Python
UTF-8
2,306
2.953125
3
[]
no_license
#!/usr/bin/env python from nltk.stem.lancaster import LancasterStemmer from nltk.stem.wordnet import WordNetLemmatizer from collections import Counter import re import xml.etree.ElementTree as ET ###################################################### # global variables #############################################...
C++
UTF-8
9,140
3.234375
3
[]
no_license
/** * @file DrawHeartCommand.cpp * @brief DrawHeartCommand implementation, a command for drawing with the heart brush * @author Mike and created by Lunden and refactored by team van_doesnt_go * @date 2020-08-02 ***********************************************/ #include "App.hpp" #include "command/DrawHear...
Markdown
UTF-8
13,694
3.203125
3
[]
no_license
# Reproducible Research: Peer Assessment 1 Lucas Roesler In this analysis we are working with measurement data collected from a personal activity monitoring device. This analysis is only an exploration of the data from a single person. We will see that the dataset has many missing values, entire days are missing,...
Swift
UTF-8
3,780
2.578125
3
[]
no_license
// // UserInitialViewController.swift // NiteLyfe // // Created by Jonah Zukosky on 10/13/17. // Copyright © 2017 Jonah Zukosky. All rights reserved. // import UIKit import MapKit class UserInitialViewController: UIViewController { @IBOutlet weak var mapView: MKMapView! override func viewDidLoad() {...
Java
UTF-8
1,269
1.835938
2
[]
no_license
package com.epoch.cc.utils.newform; import java.io.Serializable; /** * @author songxl * @version 创建时间:2012-8-6 上午11:42:57 * @discription */ public class InitFieldVo implements Serializable{ private String billid; private String deptId; private String billName; private String deptName; private String useri...
Python
UTF-8
2,735
3.34375
3
[]
no_license
''' Created on Nov 12, 2018 @author: Matthew Peek @change: 12 November 2018 ''' import sys from matplotlib import pyplot as plt from queryPackage.SDSSQuery import SDSSQuery class HRDiagram: def __init__(self, longitude, latitude, radiusMultiplier): self.query = SDSSQuery(longitude, latitude, radiusM...
Java
UTF-8
6,807
2.390625
2
[]
no_license
package eu.clarussecure.dataoperations.encryption; import com.mongodb.MongoClient; import com.mongodb.client.MongoCollection; import com.mongodb.client.MongoCursor; import com.mongodb.client.MongoDatabase; import static com.mongodb.client.model.Filters.eq; import com.mongodb.client.model.UpdateOptions; import java.io....
Java
UTF-8
719
2.421875
2
[]
no_license
package id.application.mvpapp.presenter; import id.application.mvpapp.contract.MainContract; import id.application.mvpapp.interactor.MainInteractorImpl; import id.application.mvpapp.model.Friend; public class MainPresenterImpl implements MainContract.Presenter { private MainContract.View mainView; private Ma...
Java
UTF-8
1,053
2.0625
2
[]
no_license
package cn.fintecher.file.server.fileservice.fastdfs.service; import cn.fintecher.common.utils.basecommon.message.Message; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework...
Python
UTF-8
1,164
3.375
3
[]
no_license
""" N = 4 Player #0 ~ #(N-1) 0 1 2 3 4 0 5 6 7 1 0 2 3 4 5 0 한 팀당 N/2 = 2명 Player #0이 포함된 팀을 A, 아닌 팀을 팀 B라 하면 (pivoting) A -> Player #0 + ((N - 1)명 중 (N/2 - 1)명 뽑기) """ import itertools N = int(input()) grid = [list(map(int, input().split())) for _ in range(N)] # N = 6 # grid = [[0, 1, 2, 3, 4, 5], \ # [1,...
Java
UTF-8
1,199
3.78125
4
[]
no_license
package 第724题_寻找数组的中心下标.解法2; public class Solution { public int pivotIndex(int[] nums) { // 计算nums数组中所有元素的总和 int totalSum = 0; for (int num : nums) { totalSum += num; } // 前缀和 int preSum = 0;// 存储前i个元素(不包括i)的总和 for (int i = 0; i < nums.length; i++...
Markdown
UTF-8
1,131
2.625
3
[]
no_license
# GPUGraphVisualization Visualizing community detection after processed by a new graph processing system in GPUs 2016年小组年会演示多GPU图处理系统,其中主要演示的社区发现算法,实现的是LPA算法(社区发现中比较简单一个算法)。 页面主要这么几个部分: - 社区发现:简单社区发现的例子,为了结合实际说明社区发现在实际中的应用 - 性能对比:GPUs和CPU系统的性能对比 - 大图效果:动态显示社区发现的过程,使用工具主要是linkurious.js。Ps:其他部分都是采用d3实现的。 ...
C#
UTF-8
2,334
2.5625
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging;...
Java
UTF-8
4,103
2.5625
3
[]
no_license
package com.bitsend.evogene.agents; import java.util.ArrayList; import java.util.HashMap; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.g2d.Sprite; import com.badlogic.gdx.math.Vector3; import com.bitsend.evogene.Direction; import com.bitsend.evogene.Environment; import com.bitsend.evogene....
C++
UHC
3,069
2.859375
3
[]
no_license
#include "PurchaseManager.hpp" // ȸ RM_errcode PurchaseManager::retrieve(std::vector<Purchase>& view) { return RecordManager::retrieve(view); } // Ž RM_errcode PurchaseManager::search(const Purchase& source, Purchase& result) { return RecordManager::search(source, result); } // RM_errcode PurchaseManager::update(co...
C#
UTF-8
7,393
2.84375
3
[ "MIT" ]
permissive
using System; using System.Runtime.InteropServices; using Hell.LastCircle.Database; using Hell.LastCircle.System; namespace Hell.FirstCircle { /// <summary> /// Event from Miranda history. /// </summary> public class HistoryItem { /// <summary> /// Event type. /// </summary> public enum Hi...
Java
UTF-8
1,011
2.359375
2
[]
no_license
/** * */ package sk.seges.sesam.fork.shared.domain; import java.io.Serializable; /** * @author ladislav.gazo */ public class RemoteProcessResponse implements Serializable { private static final long serialVersionUID = -1712521545357800632L; private String output; private String error; private int exitStatu...
C
UTF-8
229
3.625
4
[]
no_license
#include <stdio.h> void main(void) { int count, sum, day; count = 0; sum = 0; printf("Enter a day:"); scanf("%d", &day); while (count++ < day) { sum = sum + count * count; } printf("%d day = %d\n", day, sum); }
Python
UTF-8
1,018
3.46875
3
[]
no_license
from Functions import * import random as rnd def main(): file_name = "or.txt" training_x, training_y, m, num_atrib = load_data(file_name) mu = 0.1 num_iterations = 50 umbral = lambda x: 0.0 if x < 0.0 else 1.0 # pesos iniciales aleatorios rnd.seed(1000) #w = [random.uniform(-1,1) for...
Java
UTF-8
352
2.078125
2
[]
no_license
package com.one.model; import org.springframework.stereotype.Component; @Component public class Product { private Integer prdId; public Integer getPrdId() { return prdId; } public void setPrdId(Integer prdId) { this.prdId = prdId; } @Override public String toString() { return "Product [prdId=...
Markdown
UTF-8
7,835
2.859375
3
[ "BSD-2-Clause" ]
permissive
## Raw callee WampSharp provides a lower level api that allows to deal with rpc operations as they're sent/received, which is called Raw callee. Actually, the reflection based callee api is built above the Raw callee api. In order to use the raw callee api, implement IWampRpcOperation. A IWampFormatter is passed to ...
Swift
UTF-8
481
2.75
3
[ "MIT" ]
permissive
// // TTSegmentedControlBounceOptions.swift // TTSegmentedControl // // Created by Igor Dumitru on 27.01.2023. // import UIKit public struct TTSegmentedControlBounceOptions { public let springDamping: CGFloat public let springInitialVelocity: CGFloat public init( springDamping: CGFloat = 0...
TypeScript
UTF-8
2,376
4.09375
4
[]
no_license
// 1. 通过关键字 class 定义 // class Person{ // name:string; //属性 前面省略了public关键词 // constructor(n:string){ // 构造函数, 实例化类的时候触发的方法 // this.name = n; // } // run():void{ // alert(this.name); // } // getName():string{ // return this.name; // } // setName(name:string):v...
C
UTF-8
245
3.09375
3
[ "MIT" ]
permissive
#define DIM 10 #include <stdio.h> int main() { int valor[DIM], num, i=0; scanf("%d", &num); for (i=0; i < DIM; i++) { valor[i] = num; printf("N[%d] = %d\n", i, valor[i]); num += num; } return 0; }
Markdown
UTF-8
3,489
3.140625
3
[]
no_license
# Orbital2020---ClassroomCompanion ClassroomCompanion is an educational mobile game to allow lower secondary students to learn anywhere and anytime in a fun and engaging manner. This is a project for Orbital2020 and I worked on it with my partner, Chloe. ## Overview of Project ClassroomCompanion is a 2D educational m...
PHP
UTF-8
814
2.8125
3
[ "MIT" ]
permissive
<?php namespace Wcms\Flywheel; class Repository extends \JamesMoss\Flywheel\Repository { /** * Get an array containing the path of all files in this repository * * @return array An array, item is a file */ public function getAllFiles() { $ext = $this->formatter->getFileExt...
TypeScript
UTF-8
377
2.53125
3
[]
no_license
// third party imports import { Guid } from 'guid-typescript'; // local imports import { IModel } from "./models.index"; export class Question implements IModel { id: string; text: string; answer: string; constructor(id: string, text: string, answer: string) { this.id = !id ? Guid.create().toString() : i...
Swift
UTF-8
591
2.578125
3
[]
no_license
// // Response.swift // Json example // // Created by tawanda chandiwana on 2021/07/27. // import Foundation import UIKit struct Response: Codable { let id = UUID() let results: MyResults let status: String = "" } struct MyResults { let sunrise: String let sunset: String let solar_noon: Str...
Java
UTF-8
2,316
2.28125
2
[]
no_license
import io.restassured.RestAssured; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; public class LoggingResponseDetails extends TestBase{ @Order(1) @Test public void printResponseHeaders() { System.out.println("-------------Printing Response Headers---------------"); ...
JavaScript
UTF-8
569
3.96875
4
[]
no_license
var sayHi = function(name) { return `hi ${name}` } // if only one param and one line in body var sayHi = name => `hi ${name}` // if no params var sayHi = () => `hi kang` var sayHi = (firstname, lastname) => { var number = 1 + 1 return `hi ${firstname} ${lastname}` } const languages = ['ruby', 'php', 'js', 'es...
JavaScript
UTF-8
1,110
2.5625
3
[]
no_license
var mongoose = require('mongoose'); var Question = mongoose.model('Question'); module.exports = { getAll: function(req, res) { console.log('Get all was called'); Question.find({}, function(err, questions) { console.log('Looking for stuff!'); if(err) { console...
Markdown
UTF-8
6,506
3.421875
3
[]
no_license
二六 “那为什么他们会没办法?”王振也搞不懂小邪所言何意。 小邪憋住笑意道:“有人——有人专门负责吃他们做的菜,他们当然没办法啦!” 小顺子和皇上都露出笑容,那人不就是小邪? 王振厉道:“谁那么大的胆子,敢专门负责吃菜?” 小邪摇头道:“不晓得,不过他,吃得好凶,能留下这几片,已是万幸的了!” 王振瞄向桌上那几两不到的珍馐,亦觉想笑——果真是万幸? 小邪指着去了五爪的螃蟹,道:“那螃蟹,好像一半是空的!” 皇上已忍不住笑出声音,道:“这人,实在太大胆了——凉鞋,你可知道他是谁?朕要斩了他!” 小邪睨眼道:“回皇上,奴才不知他是谁,不过奴才想那人还会去吃...
PHP
UTF-8
2,158
2.859375
3
[ "MIT" ]
permissive
<?php /** * This file is part of the Fakerino package. * * (c) Nicola Pietroluongo <nik.longstone@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Fakerino\DataSource\File; use Fakerino\DataSource\File\Excepti...
C++
UTF-8
1,110
3.125
3
[ "MIT" ]
permissive
#ifndef CONST_SKIP_ITERATOR_HPP #define CONST_SKIP_ITERATOR_HPP #include <iterator> #include <boost/iterator/iterator_facade.hpp> #include <boost/assert.hpp> namespace Stg { template<typename _InputIterator, typename __T = typename std::iterator_traits<_InputIterator>::value_type> struct ConstSkipIte...
Python
UTF-8
659
2.640625
3
[]
no_license
from utilz.const import limit as LIMIT from hw3.search import read_index from math import log def compute_idf(): documents_number = LIMIT token_document_map = dict() index = read_index("../hw3/index.txt") for element, pages in index.items(): token_document_map[element] = round(log(documents_nu...
Java
UTF-8
4,410
3.234375
3
[]
no_license
package inf112.app.board; import com.badlogic.gdx.maps.tiled.TiledMapTileLayer; import inf112.app.player.Direction; import inf112.app.player.Position; import java.util.Map; public class BoardObjects { private final Map<String, TiledMapTileLayer> board; public BoardObjects(Map<String, TiledMapTileLayer> boa...
PHP
UTF-8
2,201
3.15625
3
[]
no_license
<?php /** * FTP client class * * @package LSF * @version $Id$ * @copyright 2011 */ class LSF_Utils_FTP_Client { private $_stream; public function __construct() { } /** * Connect and login to an ftp server * * @param string $host * @param string $user * @param string $password * @param...
TypeScript
UTF-8
1,053
2.53125
3
[]
no_license
import { Injectable } from '@angular/core'; import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, Router } from '@angular/router'; import { Observable } from 'rxjs'; import {AuthService} from '../services/auth.service'; @Injectable({ providedIn: 'root' }) export class AuthGuardGuard implements CanActiv...
C++
UTF-8
637
2.671875
3
[]
no_license
/************************************************************************* > File Name: 174.cpp > Author: liqiang > Mail: 1398690148@163.com > Created Time: 2019年07月31日 星期三 13时49分38秒 ************************************************************************/ #include <iostream> #include <cstdio> #inclu...
Python
UTF-8
3,942
2.671875
3
[ "MIT" ]
permissive
# Postgres import pandas as pd import psycopg2 import sqlalchemy import matplotlib as plt from sqlalchemy import create_engine # Postgres username, password, and database name POSTGRES_ADDRESS = 'db.panoply.io' ## INSERT YOUR DB ADDRESS IF IT'S NOT ON PANOPLY POSTGRES_PORT = '5439' POSTGRES_USERNAME = 'username' ## CHA...
C#
UTF-8
1,784
3.125
3
[ "MIT" ]
permissive
using System; using System.Collections; using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Library.ThinkOrSwim.Adapter { class Queue : IEnumerator, IEnumerator<Tuple<int, double>> { public int...
Python
UTF-8
7,154
2.5625
3
[ "MIT" ]
permissive
import numpy as np import tensorflow as tf from PIL import Image batch_size = 128 decay = 0.99 input_dim = (32, 32, 3) iteration = 100000 learning_rate = 0.0001 noise_dim = 100 is_training = tf.placeholder(tf.bool) (x_train, y_train), (x_test, y_test) = tf.keras.datasets.cifar10.load_data() x_train ...
Java
UTF-8
773
2.390625
2
[ "Apache-2.0" ]
permissive
package org.intervalos.intervalos.data; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.JsonDeserializer; import com.fasterxml.jackson.databind.JsonNode; i...
Shell
UTF-8
280
2.671875
3
[]
no_license
#!/usr/bin/bash #SBATCH -p short VERSION=46 PREFIX=https://fungidb.org/common/downloads/release-${VERSION} FILE=CimmitisRS_Broad.mRNA.fasta if [ ! -f data/$FILE ]; then curl -o data/$FILE $PREFIX/CimmitisRS/fasta/data/FungiDB-${VERSION}_CimmitisRS_AnnotatedTranscripts.fasta fi
Java
UTF-8
443
1.914063
2
[]
no_license
package com.jrosetim.testearw.service; import com.jrosetim.testearw.model.PessoaModel; import java.util.List; import java.util.Optional; public interface PessoaService { PessoaModel salvar(PessoaModel pessoaModel); PessoaModel editar(PessoaModel pessoaModel); void deletar(Long id); Optional<Pesso...
JavaScript
UTF-8
4,036
2.625
3
[ "MIT" ]
permissive
'use strict'; var app = angular.module('halfLife', ['ngRoute']); app.config(['$routeProvider', function($routeProvider) { $routeProvider.when('/', { templateUrl: 'static/partials/main.html', controller: 'MainCtrl' }); $routeProvider.otherwise({ redirectT...
Java
UTF-8
1,371
2.109375
2
[]
no_license
package de.tbosch.tools.googleapps.controller; import java.net.URL; import java.util.ResourceBundle; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.fxml.FXML; import javafx.fxml.Initializable; import javafx.scene.control.Hyperlink; import javafx.scene.input.Clipboard; impo...
Markdown
UTF-8
164
2.75
3
[]
no_license
## Good machines have parts you can swap out. In order to build a machine this way, you have to think about each part's inputs and outputs, its role, its purpose.
Java
UTF-8
422
1.5625
2
[]
no_license
package com.westwell.backend.modules.generator.dao; import com.westwell.backend.modules.generator.entity.StudentBaseInfoEntity; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; /** * 学生基本信息 * * @author chenshun * @email sunlightcs@gmail.com * @date 2021-02-08 1...
Python
UTF-8
797
3.328125
3
[]
no_license
import random MIN0 = 0 MIN5 = -(10 ** 5) MIN9 = -(10 ** 9) MAX5 = 10 ** 5 MAX9 = 10 ** 9 MAX18 = 10 ** 18 def int_generator(min_value: int = MIN0, max_value: int = MAX5) -> int: return random.randint(min_value, max_value) def pair_generator( x_min: int = MIN0, x_max: int = MAX5, y_min: int = MIN0, y_max: i...
PHP
UTF-8
2,268
2.59375
3
[ "Apache-2.0" ]
permissive
<?php $err_msg=$success=""; if(isset($_POST['add_dept'])){ $dept=$_POST['department']; if(empty(trim($dept))){ $err_msg="PLEASE FILL IN THIS FIELD"; }else{ $sql="INSERT INTO tbl_department(department) VALUES(?)"; $stmt=$conn->prepare($sql); ...
Markdown
UTF-8
1,955
2.875
3
[]
no_license
# Tamagotchi ## How to install ### Pre-requisite * Install PHP5.6+ (see https://launchpad.net/~ondrej/+archive/ubuntu/php) * Install Laravel (see https://laravel.com/docs/5.3) * Install Composer (https://getcomposer.org/download/) * Install Node.js (Stable version) (https://github.com/creationix/nvm) * Install G...
C#
UTF-8
384
2.546875
3
[]
no_license
using System; using System.IO.Compression; namespace _6._Zip_and_Extract { class Program { static void Main(string[] args) { ZipFile.CreateFromDirectory(@"C:\ZipFileDemo", @"C:\ZipFileDemoOutput/MyZipFile.zip"); ZipFile.ExtractToDirectory(@"C:\ZipFileDemoOutput/MyZipFil...
Java
UTF-8
1,981
2.453125
2
[]
no_license
package com.school.controllers.WebControllers.student; import com.school.controllers.WebControllers.UserSessionController; import com.school.models.Student; import com.sun.net.httpserver.Headers; import com.sun.net.httpserver.HttpExchange; import com.sun.net.httpserver.HttpHandler; import java.io.*; import org.jtwig...
JavaScript
UTF-8
1,877
2.6875
3
[]
no_license
const importLogo = (div) => { let h1 = (document.createElement("h1").innerHTML = "HealthyFood"); div.append(h1); }; const importSearch = (div) => { let searchcomp = document.createElement("div"); searchcomp.classList.add("searchcomp"); let input = document.createElement("input"); input.placeholder = "Write ...
C++
UTF-8
559
3.578125
4
[]
no_license
#include<string> #include<vector> using namespace std; template<typename T> class HashTable { public: HashTable(int size) { arr = new T[size]; size_ = size; }; void hashAdd(string key_val, T item) { int key = calculateKey(key_val); arr[key % size] = item; } T getItem(string key_val) { int key = calcul...
Python
UTF-8
4,318
2.640625
3
[]
no_license
from pyspark.sql import SparkSession from collections import defaultdict import sys, math, time def main(): start = time.time() spark = SparkSession.builder.appName("assign2_task1").master("local[*]").getOrCreate() sc = spark.sparkContext sc.setLogLevel("OFF") sc.setSystemProperty('spark.driver.mem...
Java
UTF-8
10,854
2.15625
2
[ "Apache-2.0" ]
permissive
package com.mykey.sdk.common.util; import android.annotation.TargetApi; import android.app.Activity; import android.content.Context; import android.graphics.Color; import android.os.Build; import android.util.Log; import android.view.View; import android.view.ViewGroup; import android.view.Window; import android.view....
SQL
UTF-8
3,049
2.90625
3
[]
no_license
/* SQLyog Trial v10.2 MySQL - 5.6.11 : Database - myshop ********************************************************************* */ /*!40101 SET NAMES utf8 */; /*!40101 SET SQL_MODE=''*/; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, F...
Go
UTF-8
929
3.25
3
[]
no_license
package Week_03 import "fmt" //https://leetcode-cn.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/solution/ /** * Definition for a binary tree node. * type TreeNode struct { * Val int * Left *TreeNode * Right *TreeNode * } */ //[ 根节点, [左子树的前序遍历结果], [右子树的前序遍历结果] ] //[ [左子树的中...
Java
UTF-8
461
1.804688
2
[]
no_license
package com.hcl.mortgage.repository; import java.util.List; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; import com.hcl.mortgage.entity.Transaction; @Repository public interface TransactionRepository ...
Markdown
UTF-8
1,350
3.078125
3
[ "MIT" ]
permissive
# three-screenshake a screen shake tool for three.js example here : https://jsfiddle.net/e4h931co/ # how to use it instantiate it : ```javascript var screenShake = ScreenShake(); ``` update the camera in the loop : ```javascript function loop() { screenShake.update(camera); renderer.render(scene, ca...
Java
UTF-8
6,300
1.875
2
[]
no_license
package com.cts.outreach.email.config; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.stereotype.Component; @Component @ConfigurationProperties(prefix="email") public class ReportMailConfig { private String reportinsightsubject; private String repo...
Python
UTF-8
496
2.9375
3
[ "CC0-1.0" ]
permissive
#!/usr/bin/env python import re, sys def main(): phone_number = sys.argv[1] regex_str = r'''0 # area code starts with 0 [1-9]\d? # area code has 1 or 2 digits / # separator [1-9]\d{5,6} # 6 or 7 digit number''' if re.mat...
Java
UTF-8
3,860
3.53125
4
[]
no_license
package net.halalaboos.mcwrapper.api.util.math; /** * Represents a three-dimensional point. */ public class Vector3d { /** The x-coordinate of the point */ private final double x; /** The y-coordinate of the point */ private final double y; /** The z-coordinate of the point */ private final double z; publ...
C++
UTF-8
1,719
2.765625
3
[]
no_license
#include<bits/stdc++.h> using namespace std; const int MOD = 1e9 + 7; vector<long long> fact(1e5 + 1); int modInverse(int a, int m) { int m0 = m; int y = 0, x = 1; if (m == 1) return 0; while (a > 1) { // q is quotient int q = a / m; ...
Java
UTF-8
4,464
2.359375
2
[ "Apache-2.0", "CC-BY-4.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
// Copyright 2021 The Terasology Foundation // SPDX-License-Identifier: Apache-2.0 package org.terasology.engine.entitySystem.sectors; import org.joml.Vector3f; import org.joml.Vector3i; import org.joml.Vector3ic; import org.terasology.engine.entitySystem.entity.EntityRef; import org.terasology.engine.logic.location.L...
Python
MacCentralEurope
2,739
3.703125
4
[]
no_license
''' Created on Mar 20, 2014 @author: vatsa ''' ''' ################# Tetris ################# Implement the drop piece function for tetris. Tetris has a 10 column x 20 row grid. Your job is to implement the following function/method void drop_piece(string[][] piece , column_num) The function will accept moves fro...
Ruby
UTF-8
1,042
2.578125
3
[ "MIT" ]
permissive
require 'open-uri' require 'hpricot' class Twitter < Linkbot::Plugin def initialize @config = Linkbot::Config["plugins"]["twitter"] # Set the following in config.json to have linkbot retrieve and display # tweet content for chat services that don't do that already. # { "plugins": { # "twitt...