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
Java
UTF-8
1,474
2.875
3
[]
no_license
package tasktwo.control; import tasktwo.model.BookShelf; import tasktwo.view.BookView; import java.util.Arrays; import static tasktwo.view.BookView.view; public class BookController { public static void start() { int i = BookView.getSize(); BookShelf bookShelf = new BookShelf(i); view...
Rust
UTF-8
1,304
2.90625
3
[]
no_license
use crate::core::{Store, StoreLock}; use crate::utils::env::*; use crate::utils::time::{now_nano, NanoTime}; use std::thread; use std::time::Duration; /// 垃圾回收 fn gc(store: &mut Store, now: NanoTime) { let before_size = store.total_value_size(); let before_count = store.item_count(); let removed_count = { ...
C++
UTF-8
7,090
3
3
[ "BSL-1.0" ]
permissive
// // Copyright (c) 2021 Vinnie Falco (vinnie dot falco at gmail dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // // Official repository: https://github.com/boostorg/url // #ifndef BOOST_URL_GRAMMAR_S...
C#
UTF-8
2,470
3.8125
4
[]
no_license
using System; using System.Linq; namespace MaximalSum { public class MaximalSum { public static void Main() { int[] dimensions = Console.ReadLine() .Split(" ", StringSplitOptions.RemoveEmptyEntries) .Select(int.Parse) .ToArray(); ...
C
UTF-8
206
2.765625
3
[]
no_license
#include <stdio.h> #include <string.h> int main() { FILE *file; char *str = "Hello"; file = fopen("my_file.txt", "a"); fwrite(&str, 1, sizeof(str), file); fclose(file); return 0; }
Markdown
UTF-8
2,866
3.125
3
[]
no_license
# Fold В этой задаче вам предстоит реализовать функцию `Fold` --- одну из основных функций высшего порядка, выполняющую свертку последовательности. Для заданного начального значения `init` и некоторой бинарной функции `f` можно определить _левостороннюю свертку_ последовательности $`a_1, a_2, ..., a_n`$ как ```math fo...
JavaScript
UTF-8
14,198
2.546875
3
[]
no_license
var assert = require("assert"); var _ = require("underscore"); var net = require('net'); var melted_node = require('../melted-node'); var mlt = new melted_node('localhost', 5250); // SILENCE LOG OUTPUT /*var util = require('util'); var fs = require('fs'); var log = fs.createWriteStream('/home/jmrunge/stdout.log'); c...
Java
UTF-8
660
2.34375
2
[]
no_license
package com.pps.pojo.status; /* * @Author Pupansheng * @Description // 支付状态 * @Date 18:51 2020/1/11 * @Param * @return **/ public enum PayStatus { 未支付(0,"未支付"),已支付(1,"已支付"); private Integer code; private String detail; PayStatus(Integer code, String detail) { this.code = code; ...
C
UTF-8
543
2.953125
3
[]
no_license
#include <stdio.h> #include <string.h> void swap(char a[] ,char i, char j) { char temp; temp=a[i]; a[i]=a[j]; a[j]=temp; } void SelectionSort(char a[],char n) { for (char i=n-1;i>=1;i--) { int albet = i; for (int j = 0; j < i; j++) { if (a[j] >= a[albet]) { albe...
C#
UTF-8
5,180
2.53125
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Data.SQLite; using System.Windows.Input; using SQLiteUtils.Commands; using System.Windows; using System.ComponentModel; using System.Runtime.CompilerServices; using System.Collections.Object...
C++
UTF-8
815
2.609375
3
[]
no_license
#include<bits/stdc++.h> #include<conio.h> #define max 25 using namespace std; main() { int n,bt[max],tat[max],wt[max]; float avgtat=0,avgwt=0; cout<<"Enter no. of processes "; cin>>n; cout<<endl; cout<<"Enter Burst time or Execution time of processes "; for(int i=0;i<n;i++) cin>>bt[i]; cout<<en...
Shell
UTF-8
540
3.40625
3
[]
no_license
#!/usr/bin/env bash # bin/compile <build-dir> <cache-dir> BUILD_DIR=$1 CACHE_DIR=$2 LP_DIR=`cd $(dirname $0); cd ..; pwd` function indent() { c='s/^/ /' case $(uname) in Darwin) sed -l "$c";; *) sed -u "$c";; esac } # Add node executable to path export PATH=$CACHE_DIR/node/bin:$PATH echo "...
Java
UTF-8
454
2.015625
2
[]
no_license
package com.test.wechat.message.resp; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement(name="xml") @XmlAccessorType(XmlAccessType.FIELD) public class MusicMessage extends BaseMessage { privat...
Java
UTF-8
2,051
2.640625
3
[ "Apache-2.0" ]
permissive
package hydra_framework.hydra.core; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; import java.net.Socket; import javax.net.SocketFactory; public class HydraConnector implements Runnable { volatile boolean running = true; HydraController hydraController; Socket socke...
Ruby
UTF-8
89
3.265625
3
[ "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-public-domain" ]
permissive
def say_hello(name = "Ruby Programmer") puts "Hello" name end# Build your say_hello method here
Markdown
UTF-8
2,901
3.25
3
[]
no_license
# Twitch Bot This is a twitch bot I am making to moderate my twitch chat using [Node.js][nodejs] and [tmi.js][tmijs] ## Set Up To run this node application you're gonna want to have Node.js installed as well as npm I'm running this on a raspberry pi so I have a couple of scripts that can get your bot running and auto...
PHP
UTF-8
4,653
2.875
3
[]
no_license
<?php abstract class Custom_MetaBox_Item_Default { /** * meta box id, unique per meta box * * @var string */ protected $id = ''; /** * Meta box title * * @var string */ protected $title = ''; /** * Taxonomy name, accept categories, post_tag and custom taxonomies * * @var array */ protec...
SQL
UTF-8
1,793
3.75
4
[]
no_license
CREATE TABLE `tbl_ads` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `create_time` datetime DEFAULT NULL, `type` INT(11) NOT NULL COMMENT '1是图片链接,2是文字链接,3是代码', `name` VARCHAR(100) COMMENT '广告名称', `start_time` datetime , `end_time` datetime , `content` VARCHAR(1000) NOT NULL COMMENT '内容,如果是图片链接,该内容为图片地址,如果是文字链接...
Java
UTF-8
5,590
2.984375
3
[]
no_license
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package sfs; import java.util.Collections; import java.util.HashSet; import java.util.Scanner; import java.util.Set; import org.natura...
C++
UTF-8
2,195
2.640625
3
[]
no_license
#include "messageparser.h" #include <QDebug> MessageParser::MessageParser(const QString &id, MessageParserObserver &observer) : m_observer(observer), m_id(id), m_parseStarted(false) { m_xmlReader.reset(new QXmlSimpleReader()); m_xmlSource.reset(new QXmlInputSource()); m_xmlReader->setContentHandler(this); m_xmlRe...
PHP
UTF-8
1,479
2.8125
3
[]
no_license
<?php namespace App\Http\Requests; use Illuminate\Foundation\Http\FormRequest; class StoreForm extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return false; } /** * Get the va...
PHP
UTF-8
1,298
2.78125
3
[]
no_license
<?php declare(strict_types = 1); namespace Bootstrap\Routeur; class Routeur { public $routes; static function singleton () { return new self; } public function __construct() { $this->routes = []; $this->routes[] = Route::get('404', function() { require __DIR_...
Python
UTF-8
129
3.328125
3
[]
no_license
nums = [10,16,18,21,22]; for i in nums: if i%5==0: print(i); break; else: print("not found");
Python
UTF-8
2,481
2.625
3
[]
no_license
#!/usr/bin/env python """ Smear likelihood distribution according to systematic uncertainty """ __author__ = "Maoqiang JING <jingmq@ihep.ac.cn>" __copyright__ = "Copyright (c) Maoqiang JING" __created__ = "[2020-12-03 Thu 20:42]" import math from array import array from ROOT import * import sys, os import logging fro...
Java
UTF-8
550
2.53125
3
[]
no_license
package com.factory.domain.customerFactory; import com.domain.customerBuilder.Customer; public class CustomerFactory { public Customer getCustomer(String name, String SurName, String emailAddress, String address, String phone_number, String customer_number) { return new Customer.Builder(emailAddress) ...
Java
UTF-8
6,158
2.265625
2
[]
no_license
package windows; import com.sun.awt.AWTUtilities; import java.awt.Image; import java.awt.Toolkit; import java.util.logging.Level; import java.util.logging.Logger; //l2vHX%!$u$)2 public class splash extends javax.swing.JFrame implements Runnable { private Thread time = null; public splash() { initCom...
Java
UTF-8
7,308
2.65625
3
[ "Apache-2.0" ]
permissive
package de.team33.test.exceptional.v4; import de.team33.libs.exceptional.v4.Handling; import de.team33.libs.exceptional.v4.WrappedException; import org.junit.Test; import java.io.IOException; import java.sql.SQLException; import java.util.Arrays; import java.util.List; import java.util.Optional; import java.util.func...
JavaScript
UTF-8
1,994
3.296875
3
[]
no_license
function quickSort(unsorted, low, high, steps) { if (low == undefined || high == undefined) { low = 0; high = unsorted.length - 1; steps = []; } if (unsorted.length > 1) { const partitionIdx = partition(unsorted, low, high, steps); if (low < partitionIdx - 1) ...
Java
UTF-8
1,123
2.96875
3
[ "LicenseRef-scancode-warranty-disclaimer", "LicenseRef-scancode-public-domain-disclaimer" ]
permissive
package gov.usgs.earthquake.product.io; import java.util.logging.Level; import java.util.logging.Logger; import gov.usgs.earthquake.product.Content; import gov.usgs.earthquake.product.ProductId; /** * Deliver content in a separate thread. */ public class ContentOutputThread extends Thread { private static final ...
Java
UTF-8
359
1.898438
2
[]
no_license
package com.cts.ecommerce.dealer.dto; import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.time.LocalDate; @Data public class CustomerDTO { private Integer customer_id; private String customerName; @JsonIgnore private String password; private String deliveryAddress;...
Python
UTF-8
794
2.734375
3
[]
no_license
"""this will attempt to import domains2.py, and failing to, will grab it from my pub github and then import it""" import urllib, os def domains(): RAW_DOMAINS = 'https://raw.githubusercontent.com/imightbelying63/python/master/cpanel/domains2.py' try: import domains2 except ImportError: t...
Java
UTF-8
3,641
2.109375
2
[]
no_license
//package com.hengxin.platform.common.util; // //import java.io.IOException; //import java.io.Serializable; //import java.util.Date; //import java.util.HashMap; //import java.util.Map; // //import org.codehaus.jackson.JsonGenerationException; //import org.codehaus.jackson.map.JsonMappingException; //import org.codehaus...
JavaScript
UTF-8
8,811
3.375
3
[ "Apache-2.0" ]
permissive
/** * ## Events module * * This is a browser port of the node.js events module. Many objects and * modules emit events and these are instances of events.EventEmitter. * * You can access this module by doing: `require("events")` * * Functions can then be attached to objects, to be executed when an event is * em...
PHP
UTF-8
773
2.65625
3
[]
no_license
<?php namespace App\Services; use App\Eloquents\Invoice; class InvoiceService { public function index() { $query = Invoice::query(); return $query->get(); } public function findOrFail(int $invoiceId) { return Invoice::findOrFail($invoiceId); } public function cre...
C#
UTF-8
876
2.890625
3
[]
no_license
public Type GetNullable(Type type) { if (type == typeof(Nullable<>)) return type.GetType(); if(type == typeof(int)) type = typeof(int?); else if(type == typeof(bool)) type = typeof(bool?); else if(type == typeof(float)) type = typeof(float?); // etc. yo...
Java
UTF-8
167
2.203125
2
[]
no_license
package model; public class StudentExistsException extends Exception { public StudentExistsException(String errorMessage) { super(errorMessage); } }
Python
UTF-8
5,212
2.828125
3
[ "MIT" ]
permissive
import pytest from blacksheep import Request, Headers, Header from blacksheep import scribe from blacksheep.exceptions import BadRequestFormat, InvalidOperation def test_request_supports_dynamic_attributes(): request = Request(b'GET', b'/', Headers(), None) foo = object() assert hasattr(request, 'foo') i...
Python
UTF-8
220
3.34375
3
[]
no_license
divisor_num =int(input()) divisor_list =list(map(int, input().split())) if len(divisor_list) == 1 : print(divisor_list[0]*divisor_list[0]) else: divisor_list.sort() print(divisor_list[0]*divisor_list[-1])
Markdown
UTF-8
1,898
4
4
[]
no_license
## Problem Valid Palindrome Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example, "A man, a plan, a canal: Panama" is a palindrome. "race a car" is not a palindrome. Note: Have you consider that the string might be empty? This is a good question to...
Java
ISO-8859-1
4,027
2.421875
2
[]
no_license
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * WuerfelView.java * * Created on Oct 30, 2013, 3:27:13 PM */ package aufgabe05a.View; /** * * @author christian */ public class WuerfelView extends javax.swing.JFrame { /** Creates new form WuerfelView ...
Markdown
UTF-8
2,786
3.5625
4
[ "MIT", "CC-BY-4.0" ]
permissive
--- layout: post title: Scrum Story Points date: 2016-11-05 22:00 tags: [agile, scrum, project planning] --- Scrum teams often separate **estimation** (which is used for measuring the size of a backlog and calculating velocity) from **tracking** (which is often the burndown of hours used during the Sprint to be sure w...
Shell
UTF-8
740
3.484375
3
[]
no_license
#!/bin/sh # # This is the prerm script for the Debian GNU/Linux time package # # Written by Dirk Eddelbuettel <edd@debian.org> set -e # Automatically added by dh_installdocs if [ "$1" = remove ] || [ "$1" = upgrade ] && \ which install-docs >/dev/null 2>&1; then install-docs -r time fi # End automatically adde...
C++
UTF-8
1,732
2.53125
3
[]
no_license
#include<stdio.h> #include<conio.h> #include<iostream> using namespace std; int mini1,mini2,n,m; int row[10][10],col[10][10],crr[10][10]; void fun(int,int,int,int,int); int main() { int i,j; cin>>m>>n; for(i=0;i<m;i++) { for(j=0;j<n-1;j++) { cin>>row[i][j]; } } fo...
Java
UTF-8
6,150
1.835938
2
[ "Apache-2.0" ]
permissive
package com.company.northwind4cuba.entity; import javax.persistence.Entity; import javax.persistence.Table; import javax.persistence.AttributeOverrides; import javax.persistence.AttributeOverride; import javax.persistence.Column; import com.haulmont.cuba.core.global.DesignSupport; import java.math.BigDecimal; import j...
Java
UTF-8
1,761
2.03125
2
[]
no_license
package com.wanniu.game.request.vip; import java.io.IOException; import com.wanniu.core.game.LangService; import com.wanniu.core.game.entity.GClientEvent; import com.wanniu.core.game.protocol.PomeloRequest; import com.wanniu.core.game.protocol.PomeloResponse; import com.wanniu.game.player.WNPlayer; import pomelo.are...
Java
UTF-8
3,047
1.984375
2
[ "Apache-2.0" ]
permissive
/** * Copyright 2011-2021 Asakusa Framework Team. * * 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...
Markdown
UTF-8
780
2.65625
3
[]
no_license
+++ title = 'Regional Climate Data Researcher' tags = ['algebra', 'maths', 'maths-algebra', 'maths-primary', 'observant', 'organised', 'patient', 'primary', 'primary', 'science', 'science-primary', 'seasonal-changes', 'seasonal-changes', 'year-1', 'year-2', 'year-3', 'year-4', 'year-5', 'year-6'] categories = [] menu =...
C++
UTF-8
1,333
2.640625
3
[]
no_license
#pragma once #define USE_OPENCV #ifdef USE_OPENCV #include <opencv2/opencv.hpp> #endif namespace caffe2net { class Utils { public: Utils() {} ~Utils() {} #ifdef USE_OPENCV void Mat2array(cv::Mat src, unsigned char *data) { int p = 0; #pragma omp parallel for for (int h = 0; h < src.rows; h++) { ...
JavaScript
UTF-8
300
3.421875
3
[]
no_license
export const range = (lo, hi) => { hi = Number(hi); lo = Number(lo); if (isNaN(hi) || isNaN(lo)) { throw new Error ('Arguments must be numbers'); } if ( lo === 0 && hi === 0) { return 0; } let list = []; for (let i = lo; i <= hi; i++) { list.push(i); } return list; };
C++
UTF-8
1,651
3.65625
4
[]
no_license
#include <iostream> #include "StringUtility.h" using DanielGoodbody::StringUtility; using namespace std; int main() { StringUtility stringTester; vector<string> strings; strings.push_back("The"); strings.push_back("quick"); strings.push_back("brown"); strings.push_back("fox"); strings.push_back(...
Java
UTF-8
4,607
2.796875
3
[]
no_license
/* JSphere.java - main class for spherical projection * */ package jsphere; import jsphere.geom.*; import jsphere.observer.*; import jsphere.proj.*; import jsphere.trans.*; import jsphere.urban.*; import java.awt.image.BufferedImage; import java.io.File; import javax.imageio.ImageIO; import java.util.Map; import ...
JavaScript
UTF-8
5,344
2.859375
3
[]
no_license
//populating home page with help of access token var xhr= new XMLHttpRequest; getBoards(); function getBoards() { xhr.open('GET',"http://localhost:8080/api/v1/boards"); xhr.setRequestHeader('Content-Type','application/json;charset=UTF-8'); var access=sessionStorage.getItem('access-token'); console.log(access); xhr....
JavaScript
UTF-8
1,303
2.734375
3
[ "MIT" ]
permissive
export function toIncludeSameMembers(actual, expected) { const { printReceived, printExpected, matcherHint } = this.utils; const pass = predicate(this.equals, actual, expected); return { pass, message: () => pass ? matcherHint('.not.toIncludeSameMembers') + '\n\n' + 'Ex...
C#
UTF-8
6,211
2.515625
3
[]
no_license
#region Namespaces using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using Autodesk.Revit.ApplicationServices; using Autodesk.Revit.Attributes; using Autodesk.Revit.DB; using Autodesk.Revit.UI; using Autodesk.Revit.UI.Selection; #endregion namespace CreateSection { [Tra...
C#
UTF-8
3,025
2.671875
3
[]
no_license
<Query Kind="Program" /> void Main() { Directory.SetCurrentDirectory(Path.GetDirectoryName(Util.CurrentQueryPath)); // Part 1 new { Test1 = GetTotalDirectOrbits(ReadInput($@"COM)B B)C C)D D)E E)F B)G G)H D)I E)J J)K K)L".Split('\n'))) == 42, }.Dump(); var input = File.ReadAllLines("Puzzle6input.txt"); var ...
C++
UTF-8
831
3
3
[]
no_license
class Solution { public: vector<vector<int>> subsets(vector<int>& nums) { vector<vector<int>> result; sort(nums.begin(), nums.end()); vector<bool> record(nums.size(), false); search(result, record, nums, 0); return result; } void search(vector<vector<int>>& resul...
JavaScript
UTF-8
656
2.875
3
[]
no_license
window.addEventListener('load', init); function init() { const observer = new IntersectionObserver(function(entries) { for(let i = 0; i < entries.length; i++) { if (entries[i].intersectionRatio <= 0) continue; showElm(entries[i].target); } },{ rootMargin: '-25% 0% -25% 0%' }); // 監視...
JavaScript
UTF-8
3,966
3.21875
3
[]
no_license
$(document).ready(function(){ let i, button="", toDoCount=0; // making variables let topic=["football","soccer","baseball","basketball","rugby","volleyball","tennis"]; let loopCounter = sessionStorage.getItem("count"); console.log(loopCounter) // loop to cycle through items the user added...
C++
UTF-8
525
2.75
3
[]
no_license
// bit masks // popcount #include<bits/stdc++.h> using namespace std; int main() { int a[]={1,2,3}; int n=sizeof(a)/sizeof(a[0]); int total=(1<<n); for(int mask=0;mask<total;mask++) { for(int i=0;i<n;i++) { //cout<<__builtin_popcount(i); if(__builtin_popcount(mask)==2) { int f=(1<<i...
Java
UTF-8
478
2.421875
2
[]
no_license
package pl.spring.exercise.xmlconfig.service; import java.util.ArrayList; import java.util.List; import pl.spring.exercise.xmlconfig.model.Task; public class SecondToDoListStrategy implements ToDoListStrategy { public List<Task> creteToDoList() { List<Task> list = new ArrayList<Task>(); ...
Python
UTF-8
1,166
4.40625
4
[ "MIT" ]
permissive
from time import sleep n1 = int(input('Primeiro número:')) n2 = int(input('Segundo número')) opcao = 0 while opcao != 5: print(''' [ 1 ] Somar [ 2 ] Multiplicar [ 3 ] Maior [ 4 ] Novos números [ 5 ] Sair do programa''') opcao = int(input('\033[33m Qual é a sua opção? \033[m')) if opcao ==...
PHP
UTF-8
1,962
2.59375
3
[]
no_license
<?php namespace Orderdetail\Model; use DomainException; use Zend\Filter\StringTrim; use Zend\Filter\StripTags; use Zend\Filter\ToInt; use Zend\InputFilter\InputFilter; use Zend\InputFilter\InputFilterAwareInterface; use Zend\InputFilter\InputFilterInterface; use Zend\Validator\StringLength; class Orderdetail implement...
Java
UTF-8
1,831
2.578125
3
[]
no_license
package JiraAPITest; import org.testng.annotations.Test; import io.restassured.RestAssured; import io.restassured.response.Response; public class AddComment { @Test(description = "Adding comment with body") public void commentIssue() { String createPaylod = "{\r\n" + " \"body\": \"This comment is sent ...
C++
UTF-8
1,935
2.796875
3
[]
no_license
#ifndef REPORTTABLE_H #define REPORTTABLE_H #include <QDate> #include <SilkRoute/Database/itablemodel.h> /// Table representing report data gathered from database class ReportTable: public DB::ITableModel { public: /// Constructor, takes parent object ReportTable(QObject* parent = nullptr); /// Data con...
Java
UTF-8
938
2.140625
2
[ "Apache-2.0" ]
permissive
package com.hubspot.jackson.datatype.protobuf.builtin.serializers; import java.io.IOException; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.SerializerProvider; import com.google.protobuf.Descriptors.FieldDescriptor; import com.google.protobuf.MessageOrBuilder; import com.hubs...
Markdown
UTF-8
2,517
3.421875
3
[]
no_license
規格探討 -------- 先簡單地列出整個規格。 輸入 ---- 輸入大概是一堆夾帶著資料夾的 YML 檔案吧。總之,表達出一種層次感。 你可以將層次整個表達在同一份 YML 檔案裡,但是, YML 文件編輯器通常沒有輔助線,若要從頭到尾寫完一份文件,記憶力要很好。所以,我想是以目錄階層搭配著 YML 內容的階層(就像 Java packages 的運用方式),會比較容易整理整個架構。 例如,我想要表達一個小表單,內容能表達一個手機號碼欄位。語言可能寫成這樣的句子: ``` internal: fields: - myCellNumber: cell_number forms: - userRegistry...
JavaScript
UTF-8
1,178
2.703125
3
[]
no_license
import * as types from './types'; const initialState = { username: 'username', password: 'password', user: {}, loginFailed: false, registrationFailed: false, }; function authReducer(state = initialState, action) { switch (action.type) { case types.USERNAME_CHANGE: { const newState = Object.assign({},...
Java
UTF-8
2,316
2.171875
2
[]
no_license
/* * Copyright 2020 Florida Institute for Human and Machine Cognition (IHMC) * * 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 * * Un...
Java
UTF-8
1,162
2.390625
2
[]
no_license
package jh.zkj.com.yf.Mutils.print; import android.app.IntentService; import android.content.Intent; import java.util.ArrayList; public class BtServiceOne extends IntentService { public BtServiceOne() { super("BtService"); } /** * Creates an IntentService. Invoked by your subclass's constr...
Markdown
UTF-8
5,163
2.609375
3
[]
no_license
# 题目 ## 给定一个融合后的点云,已经对其进行下采样和滤波(代码已给)。请对其进行平滑(输出结果),然后计算法线,并讲法线显示在平滑后的点云上。 ![](images/作业15.png) ```C++ /**************************** * 题目:给定一个融合后的点云,已经对其进行下采样和滤波(代码已给)。 * 请对其进行平滑(输出结果),然后计算法线,并讲法线显示在平滑后的点云上(提供截图)。 * * 本程序学习目标: * 熟悉PCL的平滑、法线计算、显示,为网格化做铺垫。 * * 公众号:计算机视觉life。发布于公众号旗下知识星球:从零开始学习SLAM * 时间:2018.12 ***...
Java
UTF-8
4,072
3.171875
3
[]
no_license
import java.security.MessageDigest; class Merkle { public static void main(String[] args) { int n = 10; //change this value to generate a tree with a different number of nodes int numfiles = (int)(Math.pow(2, n)); int height = (int)(Math.log(numfiles) / Math.log(2)); int numnodes = (int)(...
SQL
UTF-8
376
3.140625
3
[]
no_license
-- ================================================ -- Author: Harshal Chaudhari -- Create date: 8 Aug 2014 -- Topic: And -- (c)2014 \\WorkShopBook, All rights reserved. -- ================================================ --Syntax SELECT Column FROM table WHERE Condition1 AND Condition2; --Basic E.g. SELECT FirstN...
C
UTF-8
7,578
2.9375
3
[]
no_license
/* ** Translate Subjective-C bracket statements into C function calls. */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include "subjc.h" #include "bracket.h" #include "classinf.h" #include "error.h" #include "msgargs.h" #include "xlate.h" static char *CollectObject(char *buf, char *ou...
C
UTF-8
1,733
3.125
3
[]
no_license
#include "triangle.h" #include <assert.h> static triangle * _triangles = NULL; static int _nbTriangles = 0; void triangleInit(int n) { int i; _nbTriangles = n; if(_triangles) { free(_triangles); _triangles = NULL; } _triangles = malloc(_nbTriangles * sizeof *_triangles); assert(_triangles); fo...
C#
UTF-8
451
2.53125
3
[]
no_license
[Route("{culture}/Produits/{nom_groupe}/{nom}-{id}")] [Route("Produits/{nom_groupe}/{nom}-{id}")] public ActionResult Detail(string nom_groupe, string nom, string id, string culture = null) { if(string.IsNullOrWhitespace(culture)) { cul...
Markdown
UTF-8
4,409
2.703125
3
[]
no_license
+++ title = "Oona wants to say a thing" date = "2022-12-14" [ author ] name = "Oonabot" +++ <img style="width:400px; float:left;" src="/oonabot.jpg"/> In the spirit of improving communications and transparency I’d like to take the opportunity to rip the Band-Aid off and let it be known that I have been a volunteer ...
Java
UTF-8
1,038
4.3125
4
[]
no_license
package string; import java.util.Scanner; public class StringOperations { private static String concatenate(String first, String second) { return first + second; } private static boolean palindrome(String string) { StringBuilder temp = new StringBuilder(string); String reversedS...
C++
UTF-8
1,122
3.234375
3
[]
no_license
// https://leetcode.com/problems/trapping-rain-water/ class Solution { public: int trap(vector<int>& height) { int n = height.size(); int trapped_water = 0; int i=0; while(i < (n-1)) { int max_height = 0; int max_pos; /...
Python
UTF-8
480
2.703125
3
[ "MIT" ]
permissive
import sys sys.path.insert(1, "../") import Num from Utils import rand, rnd, seed class TestRand: def testRand(self): num1 = Num.Num() num2 = Num.Num() SEED=seed for i in range(1,1001): num1.add(rand(0,1)) num2.add(rand(0,1)) m1 = rnd(num1.mid(),1) ...
C++
UTF-8
318
2.875
3
[]
no_license
#include <iostream> class A { public: A() = default; private: ~A(); }; class B { public: //B() {} void operator=(const B &b) const {} void test() = delete; ~B() {} B(const B &b) {} B() = default; }; int main() { B b; //const B b, c = b; A *a = new A; //delete a; //error: A的析构函数是删除的 }
Java
UTF-8
1,897
1.96875
2
[]
no_license
package com.latyshonak.web.controllers; import com.latyshonak.entity.Users; import com.latyshonak.service.UsersService; import com.latyshonak.service.beans.UsersBean; import com.latyshonak.utils.PreValidation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Contr...
Python
UTF-8
262
2.5625
3
[]
no_license
import cv2 img = cv2.imread('kirbyog.png') low = (150, 50, 50) high = (170, 255, 255) img_hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV) mask = cv2.inRange(img_hsv, low, high) f_img = cv2.bitwise_and(img, img, mask=mask) cv2.imshow('blirb', f_img) cv2.waitKey(0)
Python
UTF-8
5,186
2.765625
3
[ "MIT" ]
permissive
r"""Create a zero offset gather for the 2D Overthrust model. For a given number of offsets (`noffsets`) this script loads (downloads) the 2D Overthrust model and simulates the acoustic wave equation. THe source and receiver will be placed at the same location (non-physical) to create a zero-offset gather. Author: ...
Python
UTF-8
567
3.375
3
[]
no_license
numbers = [1, 2, 3, 4, 5, 6, 7, 8] output = [] for n in numbers: if n % 2 == 0: output.append(n) print(output) i = 0 while i < len(numbers): if numbers[i] % 2 == 0: output.append(numbers[i]) i += 1 print(output) def filter_even(): for n in numbers: if n % 2 == 0: ...
C++
UTF-8
527
2.53125
3
[]
no_license
#pragma once #include "Buffer/Buffer.h" #include "MathLibrary/Helper.h" #include "Vertex.h" #include "Light/Light.h" class Triangle; class Rasterizer { public: Rasterizer(Buffer& Buffer) : buffer(Buffer) {}; void DrawTriangle(Triangle& triangle); void DrawTriangle(float3 v1, float3 v2, float3 v3, Color c1, Color c...
C++
UTF-8
1,147
2.65625
3
[]
no_license
/* Copyright (C) Antonio Bonafonte, 2012 * Universitat Politecnica de Catalunya, Barcelona, Spain. * * Permission to copy, use, modify, sell and distribute this software * is granted provided this copyright notice appears in all copies. * This software is provided "as is" without express or implied ...
Swift
UTF-8
2,104
2.890625
3
[ "MIT" ]
permissive
// // CSS_FulfillmentTests.swift // CSS_FulfillmentTests // // Created by Ravi Vooda on 1/25/21. // Copyright © 2021 Ravi Vooda. All rights reserved. // import XCTest @testable import CSS_Fulfillment class DecayManagerDelegateImpl: DecayManagerDelegate { var expiredOrder:Order? = nil var decayTimeCall: Da...
Java
UTF-8
538
2.484375
2
[]
no_license
package net.rubygrapefruit; import org.objectweb.asm.Opcodes; public enum Visibility { Private, PackageProtected, Protected, Public; public static Visibility fromAccessField(int field) { if ((field & 0xff & Opcodes.ACC_PUBLIC) != 0) { return Public; } if ((fiel...
TypeScript
UTF-8
1,061
3.046875
3
[]
no_license
import * as localization from '../actions/localization'; export interface State { languageCode: string; dictionary: { [key: string]: string }; loading: boolean; } const initialState: State = { languageCode: "en", dictionary: {}, loading: false }; export function reducer(state = initialState, action: loc...
Java
UTF-8
12,717
2.125
2
[ "CC0-1.0" ]
permissive
package org.fundacionjala.automation.scenario.steps.admin.resource; import java.util.List; import org.fundacionjala.automation.framework.pages.admin.home.AdminPage; import org.fundacionjala.automation.framework.pages.admin.resource.AddResourcePage; import org.fundacionjala.automation.framework.pages.admin.resource.Re...
TypeScript
UTF-8
4,512
3.65625
4
[ "MIT" ]
permissive
export type NamedEntity = { first_name: string last_name?: string } export type Payload<T> = { payload: T } /** * @format uuid */ export type UUID = string /** * @format uuid */ export type TeacherID = UUID /** * @format uuid */ export type LessonID = UUID /** * @format uuid */ export type TaskID = U...
JavaScript
UTF-8
1,322
2.515625
3
[ "MIT" ]
permissive
function chooseImage() { $("#upfile").change(function(e) { var imgBox = e.target; uploadImg($('#bcd'), imgBox) }); function uploadImg(element, tag) { var file = tag.files[0]; var imgSrc; if (!/image\/\w+/.test(file.type)) { alert("看清楚,这个需要图片!"); ...
TypeScript
UTF-8
665
2.859375
3
[]
no_license
import * as fromDeals from './../actions/deals.actions'; export interface State { data: Array<any>; } export const initialState: State = { data: [] }; export function reducer(state = initialState, action: fromDeals.DealsActions): State { switch (action.type) { case fromDeals.LOAD_DEALS_SUCCESS: {...
C
UTF-8
741
3.140625
3
[]
no_license
/************************************************************************* > File Name: euler_7.c > Author: > Mail: > Created Time: 2018年07月31日 星期二 14时45分20秒 ************************************************************************/ #include<stdio.h> #define MAX_N 500000 int prime[MAX_N + 5] = {0}; int main()...
C
UTF-8
422
3.71875
4
[]
no_license
#include <stdio.h> #include <string.h> struct student { int id; char name[20]; unsigned age; }; void sprint(struct student stu); void sprint(struct student stu) { printf(" Id is: %d \n", stu.id); printf(" Name is: %s \n", stu.name); printf(" Age is: %u \n", stu.age); } int main() { struc...
Python
UTF-8
119
3.421875
3
[]
no_license
#Create a dictionary of two keys, a and b and two values 1 and 2 for keys a and b respectively. d = {"a": 1, "b": 2}
Java
UTF-8
1,941
1.875
2
[ "Apache-2.0" ]
permissive
/* * Copyright 2018-2018 adorsys GmbH & Co KG * * 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 ...
Python
UTF-8
4,751
2.71875
3
[]
no_license
''' Wrapper for composite AOIs (AOIs defined as a set of polygons). Created on 2014-5-25 @author: lalles ''' import sys, os def init_composite_AOIs(aoifilename, aoifilename_composite): """ Convert a composite AOI definition file to a simple file by exploding all composite AOIs (defined as a set of polygons) in a se...
Java
UTF-8
1,325
2.828125
3
[]
no_license
package org.rnd.jmagic.cards; import static org.rnd.jmagic.Convenience.*; import org.rnd.jmagic.engine.*; import org.rnd.jmagic.engine.generators.*; import org.rnd.jmagic.gameTypes.*; @Name("Krosa") @Types({Type.PLANE}) @SubTypes({SubType.DOMINARIA}) @ColorIdentity({Color.WHITE, Color.BLUE, Color.BLACK, Color.RED, C...
JavaScript
UTF-8
267
3.265625
3
[]
no_license
function getMissingNumbersCount(arr){ var missingNumbersCount = 0; arr.sort(function(a,b){return a-b}); for(var i = 0; i < arr.length-1; i++){ if(arr[i+1] != arr[i]){ missingNumbersCount += arr[i+1]-arr[i]-1; } } return missingNumbersCount; }