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 | 826 | 2.890625 | 3 | [
"BSD-3-Clause"
] | permissive | #include <fstream>
#include <sstream>
#include <algorithm>
#include "file_io.hh"
std::string message_from_file(const std::string& fname) {std::string msg;
std::ifstream ifs(fname);
std::ostringstream oss;
oss << ifs.rdbuf();
msg = oss.str();
return msg;
}
void message_to_file(const std::string& msg, const s... |
Java | UTF-8 | 1,886 | 2.203125 | 2 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package bpvip.controller.dto;
import bpvip.entity.Proizvodjac;
import java.io.Serializable;
/**
*
* @author Admin
*/
... |
Java | UTF-8 | 3,765 | 3.203125 | 3 | [] | no_license | package org.ip.sesion07;
public class Fraccion implements Comparable {
private int numerador;
private int denominador;
private static int numFracciones;
public Fraccion() {
this.numerador = 0;
this.denominador = 1;
Fraccion.numFracciones += 1;
}
public Fraccion(int numerador, int denominador) {
thi... |
C++ | GB18030 | 237 | 2.765625 | 3 | [] | no_license | /*鷨±*/
#include <stdio.h>
#include <string.h>
#define MAXSIZE 100
int main(void)
{
char a[MAXSIZE];
int i;
gets(a);
for (i = strlen(a)-1; i >= 0; i--)
putchar(a[i]);
return 0;
}
|
Java | UTF-8 | 5,035 | 3.09375 | 3 | [] | no_license | package model;
import java.util.*;
import java.util.regex.Pattern;
import java.util.regex.Matcher;
public class RegexChecker
{
private ArrayList<String> firstNameList;
private ArrayList<String> lastNameList;
private Matcher emailMatcher;
private Pattern emailPattern;
private Matcher phoneMatcher;
private Patt... |
C++ | UTF-8 | 726 | 2.96875 | 3 | [] | no_license | #ifndef _PELICULA_H_
#define _PELICULA_H_
#include <iostream>
#include <string>
#include "lista.h"
using namespace std;
class Pelicula{
private:
string nombre;
string genero;
int puntaje;
string director;
Lista<string>* actores;
public:
Pelicula(string nombre,string genero,string director,int punta... |
Swift | UTF-8 | 1,678 | 2.546875 | 3 | [
"MIT"
] | permissive | //
// MGJViewController.swift
// WLRRoute.swift
//
// Created by 伯驹 黄 on 2017/3/2.
// Copyright © 2017年 伯驹 黄. All rights reserved.
//
import UIKit
var titleWithHandlers: [String: () -> UIViewController] = [:]
var titles: [String] = []
class MGJViewController: UITableViewController {
static func register(wit... |
PHP | UTF-8 | 4,448 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers\Core;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Spatie\Permission\Models\Role;
use DB;
class UserController extends Controller
{
protected $entity;
public function __construct () {
$this->middleware('permission:listar usuarios|crear u... |
Markdown | UTF-8 | 1,475 | 3.171875 | 3 | [
"Apache-2.0"
] | permissive | ---
layout: post
title: "CSS3画红心"
description: ""
category: css3
tags: [CSS3]
---
多多的红心: [红心](/red-heart.html) [/red-heart.html](/red-heart.html)
###`红心`
<div id="heart"> </div>
<br/>
<style type="text/css">
#heart{
position: relative;
width: 300px;
height: 270px;
}
#heart:after,
#heart:befo... |
Markdown | UTF-8 | 42,137 | 3.046875 | 3 | [] | no_license | ---
layout: post
title: "Casas de california"
date: 2020-08-17 20:12:00 -0500
category: Machine-Learning
---
Modelo de Machine Learning que ayuda a predecir el valor de una casa en
California dependiendo ciertos factores
<!--more-->
## Descripción del conjunto de datos
Primeras 5 filas del conjunto de datos
```p... |
C++ | UTF-8 | 740 | 2.84375 | 3 | [] | no_license | #ifndef REPLAYMEMORY_H
#define REPLAYMEMORY_H
#include "crabtensor.h"
/**
Experience: 5-tuple (state_1, action_1, reward, state_2, action_2)
*/
typedef struct Experience{
CRAbTensor state1, state2;
int action1, action2;
CRAbTensor reward;
bool empty;
}Experience;
class ReplayMemory{
public:
... |
Python | UTF-8 | 1,634 | 2.984375 | 3 | [] | no_license | import unittest
from unittest import mock
from datetime import datetime
from ..reader import FileReader # ListReader, HTTPReader
from ..reader import HTTPReader
class FileReaderTest(unittest.TestCase):
@mock.patch("builtins.open",
mock.mock_open(read_data="""
GOOG,2014-02... |
JavaScript | UTF-8 | 1,036 | 3.296875 | 3 | [] | no_license | function weatherBalloon( cityZIP ) {
var key = '{yourkey}';
fetch('https://api.openweathermap.org/data/2.5/weather?zip=' + cityZIP+ '&appid=' + "f13d8c523b86e058f40d4b5332b9edca")
.then(function(resp) { return resp.json() }) // Convert data to json
.then(function(data) {
drawWeather(data);
})
.ca... |
C++ | UTF-8 | 315 | 3.296875 | 3 | [] | no_license | //program to add digit of number
#include<stdio.h>
#include<conio.h>
int main()
{
int num,sum=0,dig;
printf("enter a five digit number =");
scanf("%d",&num);
while(num!=0)
{
dig=num%10;
sum=sum+dig;
num=num/10;
}
printf("sum of digits=%d ",sum);
getch();
}
|
Java | UTF-8 | 403 | 2.0625 | 2 | [] | no_license | package com.jyannis.serviceb;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@RestController
public class TestController {
/**
* 上传文件
* @param file
* @return
*/
@PostMapping("/upload")
public String upload(@RequestPart("file"... |
Java | UTF-8 | 3,220 | 1.609375 | 2 | [] | no_license | // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: braces fieldsfirst space lnc
package com.xfinity.playnow;
import android.content.pm.ApplicationInfo;
import com.comcast.cim.android.application.AppUpgradeHelper;
import com.... |
Swift | UTF-8 | 1,444 | 2.8125 | 3 | [] | no_license | //
// ContentView.swift
// Tiles
//
// Created by soohong ahn on 2021/07/20.
//
import SwiftUI
struct ContentView: View {
var body: some View {
NavigationView{
GeometryReader { geometry in
ZStack {
Image("background")
.resizable()
... |
Java | GB18030 | 386 | 2.71875 | 3 | [] | no_license | package cn.hj_01;
class Fu{
public void show(){
System.out.println("ǾԴ,κ˲÷ !");
}
}
class Zi extends Fu{
public void show(){
System.out.println("һ");
}
}
public class ZiDemo {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Zi z = new Zi();
z.sho... |
Java | UTF-8 | 5,883 | 2.453125 | 2 | [] | no_license | /*
* AppUtil.java
* v1.0
* July 2019
* Copyright ©2019 Footprnt Inc.
*/
package com.example.footprnt.Util;
import android.content.Context;
import android.location.Address;
import android.location.Geocoder;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Environment;
impor... |
PHP | UTF-8 | 714 | 2.921875 | 3 | [
"MIT"
] | permissive | <?php
namespace Lamoda\Metric\Storage;
/**
* @internal
*/
final class StorageRegistry
{
/** @var array MetricStorageInterface[] */
private $storages = [];
public function register(string $name, MetricStorageInterface $storage): void
{
$this->storages[$name] = $storage;
}
/**
*... |
Python | UTF-8 | 187 | 2.71875 | 3 | [] | no_license | from sense_hat import SenseHat
from time import sleep
while True:
sense = SenseHat()
sense.clear()
temp = sense.get_temperature_from_pressure()
print(temp)
sleep(5)
|
Python | UTF-8 | 2,024 | 2.546875 | 3 | [
"Apache-2.0"
] | permissive | # Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
#
# WSO2 Inc. licenses this file to you 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/... |
TypeScript | UTF-8 | 921 | 3.421875 | 3 | [
"MIT"
] | permissive | export const levels = {
debug: Symbol('debug'),
info: Symbol('info'),
clear: Symbol('clear'),
};
export function createLogger(
onLog: (level: 'info' | 'debug', ...messages: string[]) => void,
onClear: () => void
) {
return function log(...messages: any[]) {
const clear = messages[messag... |
Go | UTF-8 | 12,026 | 2.8125 | 3 | [
"MIT"
] | permissive | package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
"strings"
"encoding/json"
"bytes"
"time"
"sync"
)
type Key struct {
Encoding string `json:"encoding"`
Data string `json:"data"`
}
type Value struct {
Encoding string `json:"encoding"`
Data string `json:"data"`
}
type MyData struct {
... |
TypeScript | UTF-8 | 4,635 | 2.71875 | 3 | [] | no_license | import { TMTaskQueue } from '../task-mng';
import { EDEventDispatcher } from '../event-dispatcher';
import { WizardStage } from './wizard-stage';
export type WizFlagCallback = () => boolean;
export type WizNextStageCallback = (stage: WizardStage) => WizardStage;
export type WizStageNavOutEnabledCallback = (stage: Wiza... |
Go | UTF-8 | 2,633 | 2.578125 | 3 | [] | no_license | package ffmpeg
import (
"errors"
"fmt"
"github.com/cute-angelia/go-utils/syntax/icmd"
"github.com/cute-angelia/go-utils/syntax/itime"
"math/rand"
"regexp"
"strconv"
"strings"
"time"
)
func (c Component) cutOne(sec string, mp4path string, savePic string) error {
status := icmd.Exec(c.config.FfmpegPath, []str... |
Markdown | UTF-8 | 2,669 | 3.34375 | 3 | [] | no_license | # Read: 08 - OO Design
**SOLID - First 5 Principles of Object Oriented Design**
* *SOLID* - acronym for the first five object-oriented design principles, and it stands for:
- S - Single-responsiblity Principle - This principle states that a class should have one and only one reason to change, in other words a class ... |
Markdown | UTF-8 | 2,259 | 3.84375 | 4 | [] | no_license | # 1073 多选题常见计分法 (20分)
批改多选题是比较麻烦的事情,有很多不同的计分方法。有一种最常见的计分方法是:如果考生选择了部分正确选项,并且没有选择任何错误选项,则得到50%分数;如果考生选择了任何一个错误的选项,则不能得分。本题就请你写个程序帮助老师批改多选题,并且指出哪道题的哪个选项错的人最多。
## 输入格式:
输入在第一行给出两个正整数$N(≤1000)$和$M(≤100)$,分别是学生人数和多选题的个数。随后$M$行,每行顺次给出一道题的满分值(不超过5的正整数)、选项个数(不少于2且不超过5的正整数)、正确选项个数(不超过选项个数的正整数)、所有正确选项。注意每题的选项从小写英文字母`a`开始顺次排列。各项间... |
Shell | UTF-8 | 896 | 2.953125 | 3 | [] | no_license | #!/bin/bash
#SBATCH -n 8 # Number of cores
#SBATCH -N 1 # Ensure that all cores are on one machine
#SBATCH -t 0-01:00 # Runtime in D-HH:MM
#SBATCH -p serial_requeue # Partition to submit to
#SBATCH --mem-per-cpu=1000 # Memory pool for all cores (see also --mem-p... |
Java | UTF-8 | 5,530 | 2.296875 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2019-2020 The Polypheny Project
*
* 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... |
Java | UTF-8 | 6,408 | 2.1875 | 2 | [] | no_license | //
// Translated by CS2J (http://www.cs2j.com): 2015-12-12 7:53:49 PM
//
package ApexEngine.Rendering;
import java.util.HashMap;
import ApexEngine.Math.Vector2f;
import ApexEngine.Math.Vector3f;
import ApexEngine.Math.Vector4f;
public class Material {
public static final String MATERIAL_NAME = "matname";
pu... |
C++ | UTF-8 | 926 | 3.609375 | 4 | [] | no_license | //Nearest greatest right
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
void findNGR(int arr[], int size);
int main(){
int size;
cout << "Enter the size of array :"; cin >> size;
int arr[size];
for(int i = 0; i < size; i++){
cin >> arr[i];
}
findNGR(arr, size);
... |
Java | UTF-8 | 1,138 | 3.328125 | 3 | [] | no_license | import java.util.*;
public class C4Q43 {
public static void main(String... args) {
BTree root = BTree.createInstance(10, true);
root.print();
Random r = new Random();
int i = r.nextInt(BTree.getDepth(root));
System.out.println(i);
printLevel(root, i);
System.out.println();
printAll(root);
}
public... |
Java | UTF-8 | 5,098 | 2.078125 | 2 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | package fi.riista.feature.harvestpermit.season;
import com.fasterxml.jackson.annotation.JsonProperty;
import fi.riista.feature.common.dto.BaseEntityDTO;
import fi.riista.feature.common.entity.Has2BeginEndDates;
import fi.riista.feature.gamediary.GameSpecies;
import fi.riista.feature.gamediary.GameSpeciesDTO;
import fi... |
Java | UTF-8 | 5,299 | 2.109375 | 2 | [
"Apache-2.0"
] | permissive | package aurelienribon.bodyeditor;
import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import com.badlogic.gdx.math.Vector2;
import org.apache.commons.io.FileUtils;
import org.json.JSONException;
import aurelienribon.bodyeditor.io.JsonIo;
import aurelienribon.bodyeditor.models.... |
Rust | UTF-8 | 3,357 | 3.15625 | 3 | [] | no_license | use rust_sls_common::{ Error, generic_error::GenericError, serde_date };
use serde::{Deserialize, Serialize};
use sha2::{Sha256, Digest};
use serde_json::Value;
use chrono::NaiveDate;
use std::str;
use regex::Regex;
#[derive(Deserialize, Debug, Serialize)]
pub struct User {
pub email: String,
pub password: Str... |
Java | UTF-8 | 1,467 | 1.992188 | 2 | [
"Apache-2.0"
] | permissive | package com.toparchy.platform.security.model;
public enum ApplicationRealm {
AH;
// AH("Anhui", "安徽"), BJ("Geijing", "北京"), FJ("Fujian", "福建"), GS("Gansu",
// "甘肃"), GD("Guangdong", "广东"), GX("Guangxi", "广西"), GZ("Guizhou",
// "贵州"), HI("Hainan", "海南"), HE("Hebei", "河北"), HA("Henan", "河南"), HL(
// "Heilong... |
Markdown | UTF-8 | 9,565 | 2.625 | 3 | [] | no_license | * 1 本法依憲法第一百零六條制定之。
* 2 監察院行使憲法所賦予之職權。
* 3 監察院得分設委員會,其組織以法律定之。
* 3.1 監察院監察委員,須年滿三十五歲,並具有左列資格之一:一、曾任中央民意代表一任以上或省(市)議員二任以上,聲譽卓著者。二、任簡任司法官十年以上,並曾任高等法院、高等法院檢察署以上司法機關司法官,成績優異者。三、曾任簡任職公務員十年以上,成績優異者。四、曾任大學教授十年以上,聲譽卓著者。五、國內專門職業及技術人員高等考試及格,執行業務十五年以上,聲譽卓著者。六、清廉正直,富有政治經驗或主持新聞文化事業,聲譽卓著者。前項所稱之服務或執業年限,均計算至次屆監察委員就職前一日止。
> 釋:一、本條新... |
PHP | UTF-8 | 2,235 | 3.109375 | 3 | [] | no_license | <?php
$array = array("firstname" => "", "name" => "", "email" => "", "phone" => "", "message" => "", "firstnameError" => "", "nameError" => "", "phoneError" => "", "messageError" => "","isSuccess" => false);
$emailto = "test@test.com";
if ($_SERVER['REQUEST_METHOD'] == "POST") {
$array['firstname'] = verifyInput... |
C | UTF-8 | 1,516 | 2.5625 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_vector.c :+: :+: :+: ... |
Python | UTF-8 | 1,055 | 3.1875 | 3 | [] | no_license | def encode(tm):
tm_list = []
for instruction in tm:
state = binary(int(instruction[0]))
state = expand(state)
first_symbol = simplify(instruction[1])
tm_list.append(state)
tm_list.append(first_symbol)
if len(instruction) == 3:
second_symbol = simplify... |
Java | UTF-8 | 1,074 | 2 | 2 | [] | no_license | package com.trendyol.scheduler.controller;
import com.trendyol.scheduler.controller.sample.SampleJobController;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.sp... |
C++ | UTF-8 | 12,934 | 2.71875 | 3 | [] | no_license | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <string>
using namespace std;
bool DEBUG;
class task_set
{
public:
int p[10]; //periods in milli-seconds
double c[10]; // worst-case execution times in micro-seconds
//double e_c[10];
long hyper_period;
};
bo... |
C++ | UTF-8 | 4,072 | 2.640625 | 3 | [] | no_license | // Host_CSR_Graph index_type node_data_type
#include "host_csr_graph.h"
Host_CSR_Graph::Host_CSR_Graph() {
nnodes = 0;
nedges = 0;
row_start = NULL;
edge_dst = NULL;
node_data = NULL;
}
unsigned Host_CSR_Graph::readFromGR(char file[]) {
// Copied from https://github.com/IntelligentSoftwareSystem... |
Java | UTF-8 | 6,162 | 2.1875 | 2 | [
"MIT"
] | permissive | /*
Copyright (c) 2014 zuendorf
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, ... |
Java | UTF-8 | 1,404 | 2.09375 | 2 | [] | no_license | package com.joymeter.controlcenter.config;
import org.springframework.cache.annotation.CachingConfigurerSupport;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.r... |
Java | UTF-8 | 689 | 3.8125 | 4 | [] | no_license | package replit_assignments;
import java.util.*;
public class Replit75 {
public static void main(String[] args) {
// Given a string word, if the first or last chars are 'x' or 'X', print the string without those 'x' or 'X' chars, otherwise print the string unchanged.
Scanner scan = new Scanner(System.in);
... |
Java | UTF-8 | 661 | 1.789063 | 2 | [] | no_license | package com.software.test.generatingexam.controller;
import com.alibaba.fastjson.JSONObject;
import com.software.test.generatingexam.service.KnowledgePointService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.we... |
Java | UTF-8 | 929 | 1.945313 | 2 | [] | no_license | package com.redknee.topup.cts.common.jobs;
import com.redknee.topup.cts.service.subscounter.SubsCounterAdminBean;
import javax.enterprise.inject.spi.CDI;
import lombok.extern.slf4j.Slf4j;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.qua... |
Shell | UTF-8 | 1,507 | 3.609375 | 4 | [] | no_license | #! /bin/bash
echo "Welcome to Employee Wage Computation Program "
IS_PART_TIME=1
IS_FULL_TIME=2
EMP_RATE_PER_HR=20
MAX_HRS_IN_MONTH=100
NUM_WORKING_DAYS=20
totalEmpHrs=0
totalWorkingDays=0
totalSalary=0
declare -A dayWiseWages
function calculateDailyWage()
{
empHrs=$1
daySalary=$(( $empHrs * $EMP_RATE_PE... |
Java | UTF-8 | 1,679 | 1.796875 | 2 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /*
* Copyright © 2016 Cask Data, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed t... |
Java | UTF-8 | 1,043 | 3.515625 | 4 | [] | no_license | package taskK2;
/**
* Класс Окно:
* может менять статус с занято на свободно и свободно на занято
* может вызывать следующий талон (т.е устанавливать статус свободно)
*
*/
import java.time.LocalTime;
public class Window {
private boolean isFree; // false - занято, true - свободно
private int number; // н... |
Python | UTF-8 | 370 | 4.21875 | 4 | [] | no_license | #第五个练习 - 全局变量和局部变量应用
tree = "我只是一颗松树"
def fun_dream():
tree = "孩子们为我挂上了彩灯、礼物……我变成了一颗圣诞树 ^_^ \n"
print(tree)
#调用函数
print("下雪了……\n")
print("========进入了梦乡========\n")
fun_dream()
print("==========梦醒了==========\n")
print(tree) |
Shell | UTF-8 | 1,609 | 3.859375 | 4 | [
"MIT",
"LicenseRef-scancode-proprietary-license"
] | permissive | #!/bin/bash
#
# Extract the oxAuth OpenID private keys to PEM format for use by Passport
#
# Retrieve the key ids (kid) for each key from the oxAuth jwks_uri
for retries in {1..10} ; do
kids=$(curl -s https://$(hostname)/oxauth/restv1/jwks | jq -r ".keys[].kid")
if [[ $? -ne 0 || -z "$kids" ]] ; then
e... |
Java | UTF-8 | 1,263 | 2.3125 | 2 | [] | no_license | package com.example.demo.exception;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.http.converter.HttpMessageNotReadableException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import... |
Python | UTF-8 | 1,691 | 3.671875 | 4 | [] | no_license | import random
import emoji
"""
This programme helps the user to generate random pins and passwords for day to day use and keeps
a record of those.
"""
def pin():
pinsample = "123456789"
Used = str(input("What do you intend the PIN for :"))
passlen = int(input("Enter the length of PIN :"))
p =... |
TypeScript | UTF-8 | 1,281 | 2.546875 | 3 | [
"MIT"
] | permissive | /**
* makecode I2C LM75A Package.
* From microbit/micropython Chinese community.
* http://www.micropython.org.cn
*/
//% weight=20 color=#0855AA icon="\uf043" block="温度传感器"
namespace LM75A{
let LM75A_BASE_ADDRESS = 0x48;
let LM75A_DEGREES_RESOLUTION = 0.125;
/**
* 获取温度值
* @param none
* @para... |
Markdown | UTF-8 | 298 | 2.671875 | 3 | [] | no_license | # copy-webpack-plugin
拷贝目录或目录中的文件到output.path指定的目录中
```js
new CopyWebpackPlugin([
{from: './doc', to: 'doc'} // 拷贝根目录下的doc目录中的所有文件到output.path指定的目录下的doc目录中,to可以不写,默认为output.path目录
])
``` |
Java | UTF-8 | 943 | 2.625 | 3 | [] | no_license | package com.helloxin.zootopia.goose.queue.utils;
import java.util.UUID;
/**
* Created by yexin on 2019/9/20.
*/
public class LinkUtils {
private static final ThreadLocal<LinkBean> linkHolder = new ThreadLocal<>();
//目前写了一个过滤器来拦截请求,所以如果没有;链路id,则会取一个
static {
LinkBean linkBean = new LinkBean();... |
Python | UTF-8 | 1,806 | 3.09375 | 3 | [
"MIT"
] | permissive | from parts.prob_calculator import IProbCalculator
from parts import data_holder as dh
import numpy as np
class Model(object):
def __init__(self, prob_calculator: IProbCalculator, class_num: int):
self.__prob_calculator = prob_calculator
self.__class_index_set = np.arange(class_num)
self._... |
C# | UTF-8 | 1,511 | 3.0625 | 3 | [] | no_license | using System.Collections.Generic;
using System.Runtime.Serialization;
namespace ConsoleOop.Configs
{
/// <summary>
/// 封裝Schedule物件類別
/// </summary>
[DataContract]
class ScheduleManager : JsonManager
{
/// <summary>
/// 陣列儲存多筆Schedule物件
/// </summary>
[DataMembe... |
C# | UTF-8 | 3,028 | 3.25 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
namespace AllImportantProjects
{
class SumRootToLeave
{
public SumRootToLeave()
{
}
public int calculateSum()
{
InOrder id = new InOrder();
... |
Java | UTF-8 | 1,002 | 2.03125 | 2 | [
"MIT"
] | permissive | package com.thelivelock.elasticsearch_autocomplete.service;
import com.thelivelock.elasticsearch_autocomplete.model.User;
import com.thelivelock.elasticsearch_autocomplete.repository.UserRepository;
import org.elasticsearch.index.query.MatchQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
import org.s... |
Markdown | UTF-8 | 4,147 | 2.609375 | 3 | [
"MIT"
] | permissive | <!-- PROJECT SHIELDS -->
<!--
*** I'm using markdown "reference style" links for readability.
*** Reference links are enclosed in brackets [ ] instead of parentheses ( ).
*** See the bottom of this document for the declaration of the reference variables
*** for contributors-url, forks-url, etc. This is an optional, con... |
C# | UTF-8 | 1,046 | 2.546875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Threading.Tasks;
namespace Hotel19760575.Models
{
public class Customer
{
[Key, Required]
[DataType(DataType.EmailAd... |
JavaScript | UTF-8 | 138 | 3.34375 | 3 | [] | no_license | let nums = [24,8,23,32,5,62];
function arrange(a, b) {
if (a > b) return 1;
if (b > a) return -1;
return 0;
}
nums.sort(arrange); |
Java | UTF-8 | 8,715 | 3.1875 | 3 | [
"MIT"
] | permissive | import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.PriorityQueue;
import java.util.Comparator;
/**
* @author Samuel Balco <sb592@le.ac.uk>
*... |
JavaScript | UTF-8 | 1,972 | 2.8125 | 3 | [] | no_license | import React, { Component } from 'react';
import style from './GameFieldBundle.module.scss';
class GameField extends Component {
constructor(props) {
super(props);
this.drawX = this.drawX.bind(this);
this.fieldNumbers = [1,2,3,4,5,6,7,8,9];
this.fields = this.fieldNumbers.map((num) ... |
Java | UTF-8 | 794 | 1.609375 | 2 | [] | no_license | /**
*/
package ifc2x3tc1.impl;
import ifc2x3tc1.Ifc2x3tc1Package;
import ifc2x3tc1.IfcPreDefinedCurveFont;
import org.eclipse.emf.ecore.EClass;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Ifc Pre Defined Curve Font</b></em>'.
* <!-- end-user-doc -->
* <p>
* </p>
*
* @generat... |
Java | UTF-8 | 471 | 2.3125 | 2 | [] | no_license | package servlet;
import java.io.PrintWriter;
public class ServletResponse {
public PrintWriter out;
private String enCoding="utf-8";
public PrintWriter getOut() {
return out;
}
public void setOut(PrintWriter out) {
this.out = out;
}
public String getEnCoding() {
... |
Java | UTF-8 | 1,474 | 2.046875 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright (c) 2020 Dzikoysk
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... |
C# | UTF-8 | 2,528 | 2.796875 | 3 | [] | no_license | using System;
using System.ComponentModel;
using System.Text;
namespace ID3TagLib {
[Serializable]
public class TermsOfUseFrame: TextFrame, ISelectableTextEncoding, ISelectableLanguage, IEquatable<TermsOfUseFrame> {
private TextEncoding encoding;
private string language;
protected internal TermsO... |
SQL | UTF-8 | 2,109 | 3.046875 | 3 | [
"MIT"
] | permissive | -- migrate:up
create procedure _add_example_data_0()
modifies sql data
begin
set @userid = uuid_to_bin('17fbf1c6-34bd-11eb-af43-f4939feddd82', 1);
set @otheruser = uuid_to_bin('972084d4-34cd-11eb-8f13-f4939feddd82', 1);
set @sysid = uuid_to_bin('6b61d9ac-2e89-11eb-be2a-4dc7a6bcd0d9', 1);
set @othersysid = uui... |
C# | UTF-8 | 1,138 | 3.6875 | 4 | [
"MIT"
] | permissive | /********************************************************************
*
* 34. Write a program to check if a string starts with a specified word.
*
* By: Jesus Hilario Hernandez
* Last Updated: October 14th 2017
*
*
********************************************************************/
using System;
public class Exer... |
C++ | UTF-8 | 3,741 | 2.90625 | 3 | [
"BSD-3-Clause",
"MIT"
] | permissive | // Copyright 2006 David D. Diel, MIT License
#include <malloc.h>
#include <math.h>
#include <stdio.h>
#include <memory.h>
#include "mex.h"
/*** helper function prototypes ***/
signed char manageFeatures(unsigned char*,double,double,double,int,int);
/*
MATLAB function [outmask,status]=MEXmanageFeature... |
C | UTF-8 | 353 | 3.296875 | 3 | [] | no_license | #include <stdio.h>
#include "Queue.h"
int emptyQueue(Queue *q) {
if ((q->ll).size == 0) return 1;
else return 0;
}
int enqueue(Queue *q, int item) {
insertNode(&(q->ll), (q->ll).size, item);
}
int dequeue(Queue *q) {
int item = ((q->ll).head)->item;
removeNode(&(q->ll), 0);
return item;
}
int front(Queue *q) ... |
C# | UTF-8 | 2,812 | 3.15625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CodingCataliyst_AddictiveGame
{
static class Utils
{
public static void Position(int val, int rows, int column, out int x, out int y)
{
int counter = 0;
... |
Python | UTF-8 | 1,685 | 3.25 | 3 | [] | no_license | class Solution(object):
def maxAreaRectangle(self, heights):
heights = [0]+heights+[0]
stack = []
maxArea = 0
for i in range(len(heights)):
if not stack or heights[i]>=heights[stack[-1]]:
stack.append(i)
continue
while(heights[s... |
Java | UTF-8 | 618 | 2.546875 | 3 | [] | no_license | package com.hpdev;
/**
* Created by harry on 16/10/2016.
*/
public class Command {
private String PiName;
private String RoomName;
private String UserName;
private int Command;
public Command( String roomName, String userName, int command) {
RoomName = roomName;
UserName = user... |
Markdown | UTF-8 | 207 | 3.078125 | 3 | [] | no_license | **Create a function that takes two integers and checks if they are equal.**
**Examples:**
***isEqual(5, 6) ➞ false***
***isEqual(1, 1) ➞ true***
***isEqual(36, 35) ➞ false***
***
Solving by java
|
JavaScript | UTF-8 | 7,072 | 2.90625 | 3 | [] | no_license | //Dropdown
function dropdown() {
document.getElementById('dropdown').classList.toggle('show');
}
function dropdownFilter() {
var input, filter, a, i;
input = document.getElementById('dropdownInput');
filter = input.value.toUpperCase();
div = document.getElementById('dropdown');
a = div.getElemen... |
Java | UTF-8 | 50,598 | 2.609375 | 3 | [] | no_license | package com.example.demo.service;
import com.example.demo.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.mail.javamail.MimeMessageHelper;
import... |
PHP | UTF-8 | 2,297 | 2.625 | 3 | [
"MIT"
] | permissive | <?php
namespace Lincable\Http\File;
use Illuminate\Http\Request;
use Lincable\Http\FileRequest;
use Illuminate\Container\Container;
use Illuminate\Http\File as IlluminateFile;
use Lincable\Exceptions\NotResolvableFileException;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\HttpFoundati... |
PHP | UTF-8 | 4,186 | 2.6875 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Models;
use Eloquent as Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Auth;
/**
* Class Material
* @package App\Models
* @version March 5, 2020, 5:02 pm UTC
*
* @property \App\Models\Group group
* @property \App\Models\Library library
* @property \App\... |
C# | UTF-8 | 1,681 | 2.625 | 3 | [] | no_license | using Shop.Domain.Dto;
using Shop.Domain.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Shop.Domain.Converters
{
public static class ItemConverter
{
public static ItemDto Convert(Item item)
{
return new ItemDto
... |
PHP | UTF-8 | 317 | 2.6875 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Listeners;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
class CounterListener implements ShouldQueue
{
use InteractsWithQueue;
public function handle($event)
{
$x = 0;
while($x < 1000) {
$x++;
}
}
}
|
Python | UTF-8 | 261 | 3.625 | 4 | [] | no_license | from time import sleep
def sleep_decorator(function):
def wrapper(*args,**kwargs):
sleep(2)
return function(*args,**kwargs)
return wrapper
@sleep_decorator
def print_num(num):
return num
print print_num(45)
for num in range(6):
print print_num(num) |
JavaScript | UTF-8 | 1,075 | 2.5625 | 3 | [
"MIT"
] | permissive |
const createValidate = values => {
const errors = {
validate: {
required: {},
regex: {}
}
}
if (!values.name) {
errors.name = 'Required'
} else {
const regex = new RegExp('^[a-z]+$', 'i')
if (!regex.test(values.name)) {
errors.name = 'Must be: a-z'
}
}
if (!values... |
TypeScript | UTF-8 | 3,988 | 2.515625 | 3 | [] | no_license | import { Reducer, Effect, IRoute } from 'umi';
import { NoticeData } from '@/components/Notice/NoticeTary';
import { queryNotices } from '@/services/UserService';
export interface NoticeItem extends NoticeData {
id: string;
type: string;
status: string;
}
export interface GlobalModelState {
/** 菜单栏是否折叠 */
c... |
Python | UTF-8 | 511 | 4.21875 | 4 | [] | no_license | # find power (**) using recursion
def power (d, n):
if (n == 0): return 1;
#reverse number and power if n is negative
if (n < 0):
d = 1.0 / d
n = -n
return power (d, n)
#if n is even, then calculated value = (d**(n/2))
#if n is odd, then calculated value =... |
Java | UTF-8 | 905 | 3.359375 | 3 | [] | no_license | package zhaoTest;
/**
* Created by zhaochao on 2019/7/25.
*/
public class ListNode {
private int value;
private ListNode next;
public int getValue() {
return value;
}
public void setValue(int value) {
this.value = value;
}
public ListNode getNext() {
return ne... |
C++ | UTF-8 | 1,323 | 2.890625 | 3 | [] | no_license | // Author: Remco de Boer
// Date: June 13th, 2018
// For NIKHEF Project 2018
/* === CLASS DESCRIPTION =======
This algorithm transposes al timepixes on the clipboard. Columns become rows.
*/
// === INCLUDES =======
#include "TTimepixTranspose.h"
using namespace std;
using namespace NIKHEFProject;
// === ALGORITH... |
Java | UTF-8 | 1,334 | 2.125 | 2 | [] | no_license | package com.in28minutes.login;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org... |
C# | UTF-8 | 618 | 2.78125 | 3 | [
"MIT"
] | permissive | namespace CloudServices.Sender
{
using System;
using IronMQ;
public class Sender
{
private static void Main()
{
Client client = new Client("5643068273d0cd0006000007",
"GkTDl7hOYke63lBeysep");
Queue queue = client.Queue("Today's demo");
... |
Java | UTF-8 | 2,621 | 1.992188 | 2 | [] | no_license | package com.eugenefe.controller;
import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import org.jboss.seam.ScopeType;
import org.jbos... |
Markdown | UTF-8 | 2,507 | 3.171875 | 3 | [
"MIT"
] | permissive | # array-intersection [](http://badge.fury.io/js/array-intersection)
> Return an array with the unique values present in _all_ given arrays using strict equality for comparisons.
Based on [mout's](http://moutjs.com/) implementation of `intersection`.
## I... |
JavaScript | UTF-8 | 1,475 | 2.71875 | 3 | [
"MIT"
] | permissive | /**
* Loads classes and resources from a given JAR file. This function purges state of JVM.
* @param {string} filename Path to JAR file.
* @param {function} callback Function to execute when loading is over.
*/
js2me.loadJAR = function (file, callback) {
function loadReader(reader) {
zip.useWebWorkers = false;
... |
PHP | UTF-8 | 2,313 | 2.546875 | 3 | [] | no_license | <?php
# exceedPictureLimit - Present error message to the user has exceed the picture limit
#
# Connection & Session setup
require("common.php");
# Common functions
require("functions.php");
# check if active session is not set, used to prevent unauthorised access
if (!isset($_SESSION['active'])) {
# if no... |
Markdown | UTF-8 | 3,797 | 2.828125 | 3 | [
"LicenseRef-scancode-generic-cla",
"CC-BY-4.0"
] | permissive | ---
layout: project
title: Docking Station - OpenXC
---
<div class="page-header">
<h1>Docking Station</h1>
</div>
The OpenXC docking station is a hardware platform that allows car enthusiasts and hackers alike to create their own hardware and easily integrate it with OpenXC. The docking station features three dif... |
Python | UTF-8 | 3,369 | 3.609375 | 4 | [] | no_license | from tkinter import *
from tkinter import messagebox
from Password_Generator import *
import pyperclip
'''
This program uses Tkinter to create a GUI to manage information about login.
messagebox is not a class so have to be imported by itself.
Data will be written to a text file.
Password can be manually entered or a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.