language
stringclasses
15 values
src_encoding
stringclasses
34 values
length_bytes
int64
6
7.85M
score
float64
1.5
5.69
int_score
int64
2
5
detected_licenses
listlengths
0
160
license_type
stringclasses
2 values
text
stringlengths
9
7.85M
Shell
UTF-8
1,733
3.09375
3
[ "MIT" ]
permissive
#!/bin/bash # Copyright 2014 The Kubernetes Authors All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
C++
UTF-8
501
2.828125
3
[]
no_license
byte ADCpin = 0; int ADCvalue = 0; void setup(){ Serial.begin(9600); } void loop() { ADCvalue = analogRead(ADCpin); float voltage = ADCvalue * 5.0; voltage = voltage / 1024.0; Serial.print("voltage = "); Serial.print(voltage); Serial.print(" "); // The TMP36 outputs 10mV per degree Celsius...
Markdown
UTF-8
871
2.8125
3
[]
no_license
# Smart home app - mobile version This project is made as a part of a recruitment task. It was created with ReactJS with React Router (bootstrapped with [Create React App](https://github.com/facebook/create-react-app)). Main state is created as Class Object and is managed by reducer. [Live preview](https://olgami...
C#
UTF-8
1,549
3.125
3
[ "Apache-2.0" ]
permissive
namespace Core.Interfaces { /// <summary> /// Represents an interface for Factory Method patern /// </summary> /// <typeparam name="TKey"> /// A key type by which creator is registrated /// </typeparam> /// <typeparam name="TRegValue"> /// A creator type, which know how to crea...
Python
UTF-8
2,999
2.546875
3
[]
no_license
''' # Other code import maya.OpenMaya as OpenMaya import maya.cmds as cmds import maya.OpenMayaAnim as OpenMayaAnim """--------------------------------------------------------------------""" #declare variables as types node = OpenMaya.MObject() selectionList = OpenMaya.MSelectionList() OpenMaya.MGlobal.getActiveSele...
Python
UTF-8
527
3
3
[]
no_license
import sys import math S = 1 P = 0 t = int(input()) for i in range(t): n = int(input()) H = [int(health) for health in input().split(' ')] H = H[:n] H.sort() flag = True eat_no_mandragoras = 0 new_P = 0 for i in range(n): total_hp = sum(map(int,H[eat_no_mandragoras:])) ...
Markdown
UTF-8
812
2.78125
3
[]
no_license
## Installation - Clone the repository with `git clone --recurse-submodules` to update submodules. - After cloning: - Run `npm install` to install packages. - Follow the [Node-Logger readme](https://github.com/thomasnorris/Node-Logger) for instructions on setting up the logger. - In the `config` folder: ...
SQL
UTF-8
1,661
4.09375
4
[]
no_license
-- Where the lot area is zero but the geometry is not null -- compute the lot area from the geometry in sq feet -- Insert old and new values into tracking table INSERT INTO pluto_corrections SELECT DISTINCT a.bbl as bbl, 'lotarea' as field, a.lotarea as old_value, round(ST_Area(ST_Transform(a.geom,2263)))::tex...
Java
UTF-8
647
2.078125
2
[]
no_license
package br.com.jorgerabellodev.eniacproject.api.services; import br.com.jorgerabellodev.eniacproject.api.models.entities.Address; import br.com.jorgerabellodev.eniacproject.api.repositories.AddressRepository; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframewo...
Swift
UTF-8
3,086
2.78125
3
[]
no_license
// // FaceDetector.swift // DemoAppTascentOwlBytes // // Created by Henrique Valcanaia on 12/09/17. // Copyright © 2017 None. All rights reserved. // import Foundation import UIKit.UIImage class FaceDetector { // static func getFaces(from image: UIImage) -> [UIImage]? { // guard let personciImage = CIIm...
Python
UTF-8
247
2.671875
3
[ "MIT" ]
permissive
class Solution: def canJump(self, nums: List[int]) -> bool: steps = nums[0] for n in nums[1:]: if not steps: return False steps -= 1 steps = max(steps, n) return True
Java
UTF-8
1,178
2.0625
2
[ "Apache-2.0" ]
permissive
package com.bpwizard.bpm.demo.task.send_receive; import org.camunda.bpm.engine.delegate.DelegateExecution; import org.camunda.bpm.engine.delegate.JavaDelegate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import com.bpwizard.bpm.demo.task.send_receive...
Java
UTF-8
3,002
2.046875
2
[ "MIT" ]
permissive
package org.haobtc.wallet.utils; import android.app.PendingIntent; import android.content.Intent; import android.content.IntentFilter; import android.nfc.NfcAdapter; import android.nfc.tech.IsoDep; import android.nfc.tech.Ndef; import android.nfc.tech.NfcF; import android.nfc.tech.NfcV; import android.provider.Setting...
Java
GB18030
1,824
4.15625
4
[]
no_license
package BasicClassTypeStu; import java.util.Arrays; public class Test { /** * @param args */ public static void main(String[] args) { /* * 23 9 -4 18 100 7 Сγַ ˼· 1.Ҫ飬ҪԪ * 2.ԪַУҪȡַݣҪString 3.ַȡֵ洢һintн * 4.źַ */ String numberString = "23 9 -4 18 100 7"; numberString = sortNumberString(numberSt...
Java
UTF-8
3,845
2.046875
2
[ "BSD-3-Clause" ]
permissive
package scratch.kevin.simulators.ruptures.subduction; import java.io.File; import java.io.IOException; import java.text.DecimalFormat; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import org.opensha.sha.simulators.RSQSimEvent; import org.opensha.sha.simulators.SimulatorElement; import ...
TypeScript
UTF-8
646
2.671875
3
[]
no_license
import Client, { Issue } from "../client"; import ParameterInput from "./parameterInput"; export default class StatusNameInput extends ParameterInput { private value: string; constructor(bareInput: string) { super(); this.value = bareInput; } public async toParams(client: Client, issue: Issue) { ...
Go
UTF-8
1,020
3.078125
3
[]
no_license
package main import ( "fmt" "net" "time" ) const MAIN_HOSTNAME = "init_testrun_1" const PORT = "3002" var ME Contact func main() { inits() time.Sleep(5 * time.Second) if ME.Address != getMainIP() { fmt.Println("Im not main") sendInit() } else { fmt.Println("Im main") } server(PORT) } /* Getting t...
Python
UTF-8
3,358
2.65625
3
[]
no_license
from flask import Flask, Blueprint, render_template, request from flask_sqlalchemy import SQLAlchemy app = Flask(__name__) bp = Blueprint('app', __name__) #database user = 'ciechjpy' password = 'JAGrOSsMPm2Ad1lQRB7tCX8A8CwTRdyQ' host = 'tuffi.db.elephantsql.com' database = 'ciechjpy' app.config['SQLALCHEMY_DATABASE...
TypeScript
UTF-8
400
2.515625
3
[]
no_license
export class Settings { httpPort: number; reaperURI: string; lightingVenueURI: string; public load(data: SettingsData): void { this.httpPort = data.httpPort; this.reaperURI = data.reaperURI; this.lightingVenueURI = data.lightingVenueURI; } } export interface SettingsDat...
Markdown
UTF-8
1,961
2.9375
3
[]
no_license
## 数据库关系说明 - 房间 (room) 和资产 (asset) 是多对多的关系, 所以有 changes 这个中间实体. 一个房间有多个资产, 一个资产在不同时间段内可能在不同的房间 - changes 和 assets 之间不用实际的外键连接, 只有隐性的外键关系. 可以通过提交修改的资产编号查到 asset_id, 然后再加到 changes 表中. ## 表说明 - assetManager: 哪个负责人负责哪些资产的表 - users: 各级管理员和普通人的表 - ## 数据字典 ### userProfile | 字段 | 说明 | |...
Java
UTF-8
3,437
2.25
2
[]
no_license
/** * @author yuanhh1 * * @email yuanhh1@lenovo.com * */ package com.yhh.analyser.view.fragment; import android.annotation.SuppressLint; import android.app.Fragment; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.view.LayoutInflat...
TypeScript
UTF-8
1,975
3.59375
4
[]
no_license
class Oven { private _isOn : boolean; public lightGas() : void { setTimeout(function (){ document.getElementById('target').innerHTML += "<p>"+new Date().getHours()+":"+new Date().getMinutes()+" : THE GAS IS ON!</p>"; }, 1000); console.log("THE GAS IS ON!"); //insert fart...
Java
UTF-8
1,484
4.03125
4
[]
no_license
package a1.secuenciales; /** *@author María Moreno Muñoz @Fecha 02/11/2019 Ejercicio 16. Dos vehículos viajan a diferentes velocidades (v1 y v2) y están distanciados por una distancia d. El que está detrás viaja a una velocidad mayor. Se pide hacer un algoritmo para ingresar la distancia entre los dos vehículos...
Markdown
UTF-8
740
3.109375
3
[]
no_license
# Cài đặt virtualenv Trước khi làm bước này, hãy đảm bảo rằng bạn đã cài Python 3.6 trở lên. ## 1. Tạo thư mục venv Tại thư mục gốc của dự án (thư mục `cuuhomientrung`), chạy lệnh sau: ``` $ python3 -m venv venv ``` Lệnh vừa rồi sẽ tạo thư mục `venv` trong thư mục `cuuhomientrung`. Tham khảo: - https://docs.pyth...
Java
UTF-8
10,067
2.40625
2
[ "Apache-2.0" ]
permissive
import java.awt.BorderLayout; import java.awt.EventQueue; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.border.EmptyBorder; import javax.swing.JLabel; import javax.swing.JTextField; import javax.swing.JComboBox; import javax.swing.ImageIcon; import javax.swing.JButton; import java...
PHP
UTF-8
806
2.671875
3
[]
no_license
<?php // Timeout in seconds $timeout = 5; $fp = fsockopen("10.2.73.156", 80, $errno, $errstr, $timeout); if ($fp) { /* fwrite($fp, "GET /file.php HTTP/1.0\r\n"); fwrite($fp, "Host: www.server.com\r\n"); fwrite($fp, "Connection: Close\r\n\r\n"); stream_set_blocking($fp, TRUE); ...
Markdown
UTF-8
1,359
2.765625
3
[ "MIT" ]
permissive
We show how substituting letters with their corresponding confusable tricks spam filters into classifying spam emails as ham emails. The data was used for this experiment below: - spam-classification: data downloaded from [spam-classification](https://github.com/subhashbylaiah/spam-classification) on November 24, 201...
Markdown
UTF-8
958
3.09375
3
[]
no_license
Реализуйте и экспортируйте по умолчанию функцию, \ которая сравнивает объекты по совпадению данных,\ а не по ссылкам. Эта функция принимает на вход две компании и возвращает true, \ если их структура одинаковая, и false в обратном случае. \ Проверка должна проходить по свойствам name, state, website. ```js const compa...
Ruby
UTF-8
966
3.265625
3
[]
no_license
# frozen_string_literal: true require 'basic_file_reader' adapters = BasicFileReader.lines(file_name: 'input').map(&:to_i).sort # Monkeypatch the [] for arrays so that the default value for an array will # be 0 instad of nil; this way we don't need to add .to_i or exatra checks class Array def [](index) at(i...
Swift
UTF-8
781
3.421875
3
[]
no_license
extension ListNode { func nextForRemovedDuplicates() -> ListNode? { var current = self var next = current.next while true { if next != nil, current.val == next!.val { current = next! next = current.next } else { ...
Java
UTF-8
1,660
2.234375
2
[]
no_license
/* * Remuco - A remote control system for media players. * Copyright (C) 2006-2010 by the Remuco team, see AUTHORS. * * This file is part of Remuco. * * Remuco is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free...
Shell
UTF-8
1,715
3.78125
4
[]
no_license
#!/bin/bash OPENNMS_HOME="/usr/share/opennms" URL="" RESTURL=" -u admin:admin http://localhost:8980/opennms/rest/foreignSources/policies/Manage" foreignsource="ARSINFO" foreignid="" ip="" show_help () { cat <<END Usage: $0 -t <target ip address(optional)> -n <foreignid> -a <ip address to add> -d (opennms ho...
PHP
UTF-8
630
3.859375
4
[]
no_license
<!DOCTYPE html> <html> <head> <title>Ejercicio 6</title> </head> <body> <?php echo "<pre>"; for ($i=0; $i < 15 ; $i++) { $arreglo[]=rand(1,50); } $arreglo[0]=0; $arreglo[1]=0; echo "Arreglo original: <br>"; print_r($arreglo); /*echo "<br><br>arreglo sin duplicados:<br>"; $array = array_uni...
Java
UTF-8
2,310
2.015625
2
[ "Apache-2.0" ]
permissive
/* * Copyright 2008 Alin Dreghiciu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ag...
C++
UTF-8
1,051
2.6875
3
[]
no_license
#include <iostream> #include <opencv2/opencv.hpp> #define IMAGE_WITH 2496 #define IMAGE_HEIGHT 1664 using namespace cv; int main() { Mat img; FILE *fp = NULL; char *imagedata = NULL; int framesize = IMAGE_WITH * IMAGE_HEIGHT; //Open raw Bayer image fp = fopen("bild.CR2", "rb"); //try{ ...
JavaScript
UTF-8
933
3.015625
3
[]
no_license
$("#creep-button").click( function(evt) { $.getJSON('/creepy', { your_age: $('input[name = "your_age"]').val(), other_age: $('input[name = "other_age"]').val() }, function(data){ if (data.is_creepy) { // tell user they a creep //alert("Straight creep"); $("#creep-result...
Java
UTF-8
4,490
3.40625
3
[]
no_license
package ua.univer.javacore.Case.task18; import java.util.Scanner; public class SP18 { public static void task18() { Scanner in = new Scanner(System.in); System.out.println("Input the digit : "); int input = in.nextInt(); int odinitsy = input % 10; int desiatky =...
C++
UTF-8
2,119
4.3125
4
[ "Apache-2.0" ]
permissive
/* C++ program for 3-way quick sort Contributor: Vatsalya Gupta */ #include <bits/stdc++.h> using namespace std; /* This function partitions a[] in three parts a) a[l..i] contains all elements smaller than pivot b) a[i+1..j-1] contains all occurrences of pivot c) a[j..r] contains all elements greater than pivot */ vo...
Markdown
UTF-8
2,215
3.0625
3
[ "MIT" ]
permissive
# 03 Webpack React ## Resumen Este ejemplo toma como punto de partida el ejemplo _02-webpack-boiler_. Vamos a ir paso a paso añdiendo la configuración necesaria para que integrar **React** en nuestro proceso de build. ## Paso a Paso - Primero copiamos el ejemplo anterior, y hacemos un _npm install_ ```bash npm in...
Java
UTF-8
1,425
3.484375
3
[]
no_license
import java.util.Scanner; class PasswordChecker { public static void main(String args[]) { int digitCount=0; int lowerCount=0; int upperCount=0; int spaceCount=0; Scanner scanner = new Scanner(System.in); System.out.print("Please enter your password:"); String password = scanner.nextLine(); ...
C
UTF-8
4,978
4.0625
4
[]
no_license
/** @file voronoi.c @author Brian Morris (bcmorri3) This program outputs a 100x100 pixel voronoi diagram by accepting 6 double values from standard input representing the (x, y) coordinates of 3 points on the diagram and fills in the remaining diagram coordinates with the appropriate colors. */...
C#
UTF-8
2,472
2.625
3
[]
no_license
using System.Collections; using System.Collections.Generic; using UnityEngine; using System.Linq; public class CardIDs : MonoBehaviour { public static Dictionary<int, string > cards; [SerializeField] public List<cardID> cardList; [System.Serializable] public struct cardID { public...
Python
UTF-8
397
3.875
4
[ "MIT" ]
permissive
# -*- coding: utf-8 -*- """ Created on Wed Dec 27 13:41:53 2017 @author: User """ import math def compareArea(circum, width): circleA = (circum*circum)/(4*math.pi) squareA = width*width if circleA == squareA: print("tie") elif circleA >= squareA: print("circle") else...
Java
UTF-8
760
2.6875
3
[]
no_license
package DP; public class zeroOneBU { public static int table(int[] weight, int[] val, int w, int n) { int[][]t = new int[n+1][w+1]; for(int i =0;i<n+1;i++) { for(int j =0;j<w+1;j++) { t[i][0] = 0; } } for(int i =1;i<n+1;i++) { for(int j =0;j<w+1;j++) { if(weight[i-1] > w) { t[i]...
Python
UTF-8
274
3.484375
3
[]
no_license
if __name__ == '__main__': res_list = [] for x in range(1, 50): res = '' if x % 3 == 0: res += 'Fizz' if x % 5 == 0: res += 'Buzz' res_list.append(res if res != '' else str(x)) print(', '.join(res_list))
Java
UTF-8
733
2.046875
2
[ "MIT" ]
permissive
package net.ncguy.editor.modules.world.adapter; import com.kotcrab.vis.ui.widget.VisTable; import net.ncguy.editor.modules.world.adapter.widget.Layout; import net.ncguy.editor.modules.world.adapter.widget.StringInput; import net.ncguy.foundation.data.components.mesh.AssetMeshComponent; public class AssetMeshComponent...
Markdown
UTF-8
15,454
2.984375
3
[]
no_license
My mostly unqualified observations of your SMB server ===================================================== This is a part of a note I recently send to my doctor regarding his data management system. I was prompted to send him this when I found out that he did not know about RAID disk arrays. As a general text it may...
TypeScript
UTF-8
5,495
2.515625
3
[]
no_license
import { v4 as uuid } from 'uuid'; import { html, render } from 'lit-html'; import { DOTWALLET_API } from '../config'; const engButton = require('../../assets/dotwallet-pay-button-blue-138x48-en.svg'); const zhButton = require('../../assets/dotwallet-paybutton-blue-152x48-zh.svg'); export interface PayOptions { produ...
Python
UTF-8
1,293
2.953125
3
[]
no_license
""" Builds a simple convolutional nerual network for MNIST similarity (quadruplet encoder). Output format of the Keras model: Embedding ; Output (Flatten) Needs to be trained with talos. """ import keras from keras.models import Model from keras.models import Sequential from keras.layers import Input, Dense, Dropout, ...
Java
UTF-8
243
1.515625
2
[ "Apache-2.0" ]
permissive
/** * node è il package che raccoglie tutte le classi utili a definire un nodo nel contesto del dominio applicativo * dei Taxi * @author robertovecchio * @version 1.0 * @since 15/01/2021 * */ package com.robertovecchio.model.graph.node;
Java
UTF-8
1,087
1.914063
2
[]
no_license
package com.example.cities.presentation.cities_search; import androidx.paging.PagedList; import com.example.cities.model.CitiesSearchResultCode; import com.example.cities.model.data.CityData; public interface CitiesSearch { interface Presenter { void onViewReady(); void onSearchTextChanged(Str...
PHP
UTF-8
6,798
2.625
3
[]
no_license
<?php session_start (); ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <link rel="stylesheet" type="text/css" href="style.css"> <title></title> </head> <body> <?php if ($_SERVER['REQUEST_METHOD'] == "POST") { // Creating array $_SESSION['users'][] = [ 'radio' => $_POST['radio'], 'name' => $_POST['na...
Java
UTF-8
3,737
2.578125
3
[]
no_license
/* * Copyright (c) 2013 NTB Interstate University of Applied Sciences of Technology Buchs. * All rights reserved. * * http://www.ntb.ch/inf * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributio...
Markdown
UTF-8
10,370
2.640625
3
[]
no_license
--- layout: post title: "composer使用总结" date: 2017-02-16 11:51:00 categories: php composer excerpt: composer使用总结 --- * content {:toc} ## composer 安装 用法 --- ### 【安装】### 安装 Composer,只需要下载 composer.phar 可执行文件。 wget https://getcomposer.org/download/1.0.0-alpha11/composer.phar 在 https://getcomposer.org/dow...
C
UTF-8
1,070
3.984375
4
[]
no_license
/** STRING4.C **/ # include<stdio.h> # include<malloc.h> void gets1 (char **, int ); void display ( char **, int); void input (char **, int ); /* gets1() function to read a string */ void gets1(char **s, int i ) { int j; char ch; ch = getchar(); while(ch != '\n') { s[i][j] = ch ; ch = getchar(); j+...
Shell
UTF-8
1,386
3.921875
4
[]
no_license
#!/bin/bash if [[ "$1" == "" || "$2" == "" ]]; then echo "error: You need to put paths of wordpress installation" exit fi SourceDir="$1" DestinationDir="$2" if [ ! -d "$SourceDir" ]; then echo "error: Source path either doesn't exists or it's not a directory" exit elif [ ! -d "$DestinationDir" ]; the...
Java
UTF-8
440
2.09375
2
[]
no_license
package com.baidu.location.b; public class a { private String a; private String b; private boolean c; public a(String str, boolean z, String str2) { this.b = str; this.c = z; this.a = str2; } public String a() { return this.b; } public String toString(...
Python
UTF-8
662
3.15625
3
[]
no_license
import os import pickle def to_pickel(pickle_name, dataframe, dir="../dataset"): """ save dataframe on pickle format :param dataframe: :param dir: :return: """ os.chdir(dir) pickle.dump(dataframe, open(pickle_name + '.pickle', 'wb')) def file_to_list(filename, dir="../resources")...
Java
UTF-8
828
1.976563
2
[]
no_license
package com.hardkernel.odroid.settings.display.position; import android.content.Context; import com.droidlogic.app.DisplayPositionManager; import com.hardkernel.odroid.settings.ConfigEnv; public class DisplayPositionReceiver { private final String TAG = "DisplayPositionReceiver"; public static void onReceiv...
Java
UTF-8
551
2.4375
2
[ "Apache-2.0" ]
permissive
package edu.gy.personalmanagersystem.pojo; public class Role { private String number; private Integer roleid; public String getNumber() { return number; } public void setNumber(String number) { this.number = number == null ? null : number.trim(); } public Integer getRole...
C++
UTF-8
2,111
2.984375
3
[]
no_license
#include<iostream> #include<cstdio> #include<string.h> using namespace std; long p,q,n,t,e,d; void printArray(long *x) { for(int i=0;x[i]!=-1;i++) cout<<"\t"<<x[i]; } /* void printArray(char *x) { int i; for(i=0;x[i]!='\0';i++) cout<<"\t"<<(int)x[i]; cout<<(int)x[i]; } */ long modPow(long x, long n,long mod) ...
C
UTF-8
886
3.0625
3
[]
no_license
/******************************************************** *temp.h * * SER486 Assignment 4 * Spring 2020 * Written By: Thor Nielsen * Modified By: * * header file for function declarations * declarations: * void temp_init(void) * unsigned int temp_is_data_ready(void) * void temp_start(void) ...
TypeScript
UTF-8
482
2.609375
3
[]
no_license
// Action queue will be a firestore collection // each action representing a user action export type IDocumentSnapshot<T> = firebase.firestore.DocumentSnapshot<T>; export type IQuerySnapshot<T> = firebase.firestore.QuerySnapshot<T>; export type IUserID = string; export type IDisplayName = string; export interface IU...
C#
UTF-8
2,389
2.734375
3
[]
no_license
namespace Downloader.Core.Tests.Store { using System; using System.Linq; using System.Threading.Tasks; using Core.Store; using Microsoft.VisualStudio.TestTools.UnitTesting; [TestClass] public class JobStoreTests { private readonly IJobStore _jobStore; public JobStoreTe...
Java
UTF-8
1,108
2.15625
2
[]
no_license
package info.khyh.opengltest; import info.khyh.opengltest.DrawLibrary.DrawMain; import info.khyh.opengltest.Library.GLLoader.GLES; import javax.microedition.khronos.egl.EGLConfig; import javax.microedition.khronos.opengles.GL10; import javax.microedition.khronos.opengles.GL11; import android.content.Context; import an...
Java
UTF-8
692
3.6875
4
[]
no_license
import java.util.*; public class Poj1862 { public static void main(String args[]) { Scanner cin = new Scanner(System.in); int n = cin.nextInt(); PriorityQueue<Double> heap = new PriorityQueue<Double>(10, new Comparator<Double>() { @Override public int compare(Double a, Double b...
Java
UTF-8
7,208
3.375
3
[]
no_license
package madeexercises.MultiFormatCalculator.ui.model; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.HashMap; import java.util.Map; import madeexercises.MultiFormatCalculator.multiformat.*; import madeexercises.MultiFormatCalculator.ui.view.ModelView; /** * Mode...
C++
UTF-8
366
3.125
3
[]
no_license
#include "GradeMap.h" #include <vector> GradeMap::GradeMap() { } char& GradeMap::operator[] (const std::string index) { for (StudentGrade &member : m_map) { if (index == member.studentName ) { return member.grade; } } StudentGrade temp {index, ' '}; m_map.push...
Python
UTF-8
8,195
2.734375
3
[ "Apache-2.0" ]
permissive
# ------------------------------------------------------------------------------ # Based on: # apex # Copyright (c) NVIDIA # Licence under The BSD 3-Clause "New" or "Revised" License # https://github.com/NVIDIA/apex # All rights reserved. # # Redistribution and use in source and binary forms, with or without modificati...
Java
UTF-8
510
2.109375
2
[]
no_license
package alokamMTOMClient; /** * Created by IntelliJ IDEA. * User: alokamve * Date: 28 Jul, 2011 * Time: 5:56:34 PM */ import javax.xml.ws.soap.MTOMFeature; public class MTOMClient { public static void main(String[] args) { String FOO = "7777745656"; MtomService service = new MtomService() ; MtomPor...
Markdown
UTF-8
639
2.703125
3
[]
no_license
Pour jouer à ce jeu, les règles sont simples : - Démarrez une nouvelle partie - Séléctionnez une des trois classes du jeu (Guerrier, Magicien, Paladin) - Entrez dans le donjon et essayez d'atteindre la salle 10 pour défier le titan ! Dans chaque salle : - Vous avez une chance sur deux de rencontrer un ennemi - Vous av...
Java
UTF-8
1,673
2.09375
2
[]
no_license
package sv.gob.mitur.application.configuration; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annot...
Python
UTF-8
783
3.9375
4
[ "MIT" ]
permissive
# 题意:一个长度为n-1的递增排序数组中的所有数字都是唯一的,并且每个数字都在范围0~n-1之内。在范围0~n-1内的n个数字中有且只有一个数字不在该数组中,请找出这个数字。 # 题解1: 位运算 # 题解2: 二分法,注意边界条件! class Solution: def missingNumber(self, nums): # 位运算 res = 0 for i in range(len(nums)+1): res ^= i for j in nums: res ^= j return res class Solution_2: ...
Ruby
UTF-8
596
3.015625
3
[]
no_license
#--- # Excerpted from "Programming Ruby", # published by The Pragmatic Bookshelf. # Copyrights apply to this code. It may not be used to create training material, # courses, books, articles, and the like. Contact us if you are in doubt. # We make no guarantees that this code is fit for any purpose. # Visit http://www...
JavaScript
UTF-8
356
2.65625
3
[]
no_license
var express = require('express'); var app = express(); app.get('/test', function (req, res) { console.log('api called successfully'); res.send("helloworld"); }) var server = app.listen(8000, function () { var host = server.address().address var port = server.address().port console.log("Example app listeni...
C
UTF-8
719
3.59375
4
[]
no_license
#include <stdio.h> int ft_str_is_printable(char *str); int main(void) { char str1[] = " fdhhAAA | /%f1235`"; char str2[] = "ABCDE!á"; char str3[] = "aasr342AA433¬¬¬"; int validate; validate = 0; if (ft_str_is_printable(str1)) { printf ("1ª string has printable chars only : %s\n", str1); validate++; } ...
PHP
UTF-8
753
2.71875
3
[]
no_license
<?php namespace netForum\xWeb\Xml\Generated; class GetVersionResponse { /** * @var xWebVersion $GetVersionResult */ protected $GetVersionResult = null; /** * @param xWebVersion $GetVersionResult */ public function __construct($GetVersionResult) { $this->GetVersionResult...
Java
UTF-8
4,590
2.4375
2
[ "Apache-2.0" ]
permissive
package com.seahorse.youliao.controller; import com.itextpdf.text.DocumentException; import com.itextpdf.tool.xml.exceptions.CssResolverException; import com.seahorse.youliao.utils.PDFUtils; import freemarker.template.Configuration; import freemarker.template.Template; import io.swagger.annotations.Api; import io.swag...
Java
UTF-8
296
1.789063
2
[]
no_license
package org.lxy.demo.mp.sharding.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.lxy.demo.mp.sharding.model.table.Book; /** * @author liuxinyi * @date 2019-06-12 */ public interface BookMapper extends BaseMapper<Book> { String queryNameByGuid(String guid); }
Java
UTF-8
5,654
3.3125
3
[]
no_license
package com.company; import java.io.File; import java.io.FileNotFoundException; import java.io.FileWriter; import java.io.IOException; import java.util.Scanner; public class Pizza extends Product { private String size , name ,description;//big,medium,small public static String newline = System.getPr...
Python
UTF-8
4,926
2.65625
3
[]
no_license
import requests import csv import json class bcolors: HEADER = '\033[95m' OKBLUE = '\033[94m' OKGREEN = '\033[92m' WARNING = '\033[93m' FAIL = '\033[91m' ENDC = '\033[0m' BOLD = '\033[1m' UNDERLINE = '\033[4m' def slugify(value): """ Normalizes string, converts to lowercase, re...
PHP
UTF-8
4,379
3.125
3
[]
no_license
<?php interface PizzaInterface { public function setMeet($newMeet); public function setCheese($newCheese); public function setExtra($newExtra); } class PizzaMaker implements PizzaInterface { public $meet; public $cheese; public $extra; public $resultingPizzaName; public function __construct($newIng...
Markdown
UTF-8
886
3.171875
3
[ "MIT" ]
permissive
Read the following code. ```js var bar = "dance"; function foo() { bar = 10; var innerFoo = function() { var bar = 15; } console.log("2: " + bar); //2: What will bar be on this line? innerFoo(); console.log("3: " + bar); //3: What will bar be on this line? } console.log("1: " + bar); //1: What will...
PHP
UTF-8
11,100
2.734375
3
[]
no_license
<?php require_once "common.php"; define('MYSQL_ERR_INSERT_','1062'); class MysqlException extends RuntimeException { public $logRefNum; public function __construct($logRefNum) { parent::__construct(); $this->logRefNum = $logRefNum; } } class MysqlQueryOneException extends MysqlException { public $rec...
Markdown
UTF-8
10,948
2.890625
3
[]
no_license
# Project 3: Create a Data Warehouse with AWS Redshift ## Summary * [Introduction](#Introduction) * [Data Warehouse Schema Definition](#Data-Warehouse-Schema-Definition) * [ETL Process](#ETL-Process) * [Project Structure](#Project-Structure) * [How To Run](#How-to-Run) -------------------------------------------- ##...
C++
UTF-8
3,655
2.796875
3
[ "MIT" ]
permissive
#include "CommandAttack.h" #include "ComponentHealth.h" #include "ComponentLocation.h" #include "ComponentRegistry.h" #include "Constants.h" #include "Direction.h" #include "Game.h" #include "Point.h" #include <vector> CommandAttack::CommandAttack ( std::optional<int> characterId) : mCharacterId(characterId) { }...
JavaScript
UTF-8
762
2.78125
3
[]
no_license
var fs=require('fs'); function fetchAndCount(dirPath){ var countJs=0; var countTxt=0; var count=0; var totalCount=0; return new Promise((res,rej)=>{ fs.readdir(dirPath,(err,files)=>{ if(err){ rej("Error occured while reading directory"); } else{ var filesObj={}; //var totalCount=0; for(var i=0;i<files.leng...
C#
UTF-8
1,568
2.796875
3
[]
no_license
using MongoDB.Driver; using MongoDB.Driver.Linq; using PrisonersDilemma.Core.Helpers; using PrisonersDilemma.Core.Models; using System.Collections.Generic; using System.Threading.Tasks; namespace PrisonersDilemma.Core.Repositories { public class StrategyRepository : IStrategyRepository { private reado...
PHP
UTF-8
261
2.515625
3
[]
no_license
<?php namespace gossi\webform\validation; interface IValidatable { public function addTest(AbstractTest $test); public function removeTest(AbstractTest $test); public function addError($message); public function hasErrors(); public function getErrors(); }
Markdown
UTF-8
1,296
3.15625
3
[]
no_license
# [SCUFFLE](https://scuffle.online) <img src="http://heroku-badge.herokuapp.com/?app=angularjs-crypto&style=flat&svg=1" alt=""/> ##### About This is a <b>WIP</b> multiplayer game that I am making to play with my family from across the country. (My family's version of Bananagrams) Recommended 3-5 Players ### Play No...
Python
UTF-8
5,292
3.125
3
[]
no_license
import unittest import re import os, sys currentdir = os.path.dirname(os.path.realpath(__file__)) parentdir = os.path.dirname(currentdir) sys.path.append(parentdir) from candidatetesting import * class TestCandidateQuiz(unittest.TestCase): # PART 1 # question tests def test_question(self): self.asser...
C++
SHIFT_JIS
3,390
2.6875
3
[ "MIT" ]
permissive
#include "stdafx.h" namespace basedx12 { //-------------------------------------------------------------------------------------- /// Q[zuIuWFNgeNX //-------------------------------------------------------------------------------------- GameObject::GameObject(const shared_ptr<Stage>& StagePtr) : ObjectInterface...
Swift
UTF-8
1,248
4.46875
4
[]
no_license
import UIKit var distance: Int = 0 // MARK: - Function // func 이름() { 구현 } func moveForward() { distance = distance + 1 // distance += 1 } print(distance) // 반복하는 동작! moveForward() moveForward() moveForward() print(distance) // MARK: for 구문 distance = 0 for _ in 1...3 { // 1부터 3까지 _ 에 대하여 // 반복되는 구문이...
Python
UTF-8
1,772
2.890625
3
[ "MIT" ]
permissive
from .base import Interface class Betriebsstellen(Interface): """Wrapper for Deutsche Bahn's Betriebsstellen API. Documentation at: https://developer.deutschebahn.com/store/apis/info?name=BahnPark&version=v1&provider=DBOpenData """ def __init__(self, token=None, key=None, secret=None, confi...
C++
SHIFT_JIS
1,649
2.78125
3
[]
no_license
#include "ActorGroundPlane.h" void ActorGroundPlane::Create(){ NxActorDesc actorDesc; ///actor Descriptor with Collection of Shapes. NxPlaneShapeDesc planeDesc; ///Plane Shape Descriptor //ʕ: ax + by + cz + d = 0; planeDesc.normal = NxVec3(0, 1, 0); //ʂ̖@Y() planeDesc.d = 0.0f; //Y = 0.0fɖʂ actorDe...
C++
UTF-8
2,563
2.84375
3
[]
no_license
#include "kingBomb.h" #include "ground.h" #include "player.h" KingBomb* KingBomb::getInstance() { static KingBomb instance("King"); return &instance; } KingBomb::KingBomb(const std::string& name): Enemy(name), throwing(false), bombs(), freeBombs() { setY(Ground::getInstance().getGround(getX(), getY()) - h...
JavaScript
UTF-8
4,593
2.890625
3
[]
no_license
(function() { function easeOut(t, b, c, d, a, p) { if(t > d) return b + c; if(t == 0) return b; if((t /= d) == 1) return b + c; if(!p) p = d * .3; if(!a || a < Math.abs(c)) { a = c; var s = p / 4; } else { var s = p / (2 * Math.PI) ...
Markdown
UTF-8
21,614
3.0625
3
[]
no_license
## mudou网络库解析 ### 写在前面 mudou网络库是我当时学习某个开源项目叫做[Flamingo](https://github.com/balloonwj/flamingo),这是一个纯c++开发的即时通讯软件,当时我并不知道mudou网络库,只是当初想要对c++服务器开发做一个深入了解,看看人家服务器端项目怎么写的,于是找到了这个项目。这个项目主要包括flamingoserver服务端,flamingoclient客户端两部分。其中flamingoserver服务端里面就包含了mudou库。其中的net和base文件夹就是属于mudou源码的大部分。我这里讲解的是mudou源码中关于整个网络库的一部分,...
C#
UTF-8
3,255
2.65625
3
[ "MIT" ]
permissive
// Copyright © 2014-2018 Stig Schmidt Nielsson. This file is Open Source and distributed under the MIT license - see LICENSE.txt or https://opensource.org/licenses/MIT. using System.Collections.Concurrent; using System.Collections.Generic; using System.Threading; using static System.Math; namespace StigsDotNetLib.C...
C#
UTF-8
1,257
2.640625
3
[]
no_license
using SmileWithStyleDB; using System; using System.Collections.Generic; using System.Linq; using System.Web; using SmileWithStyleDB; namespace pjct_webshop.Models { public class Produkt_model { public Produkt_model() { } public Produkt_model(Product p) { Name = p.Na...