language stringclasses 15
values | src_encoding stringclasses 34
values | length_bytes int64 6 7.85M | score float64 1.5 5.69 | int_score int64 2 5 | detected_licenses listlengths 0 160 | license_type stringclasses 2
values | text stringlengths 9 7.85M |
|---|---|---|---|---|---|---|---|
C++ | UTF-8 | 1,730 | 3.65625 | 4 | [] | no_license | /*
# Boyer_Moore법을 이용하여 문자열에서 문자열을 검색하고 몇번째에 있었는지 표시하기
*/
#include<stdio.h>
#include<string.h>
#include<limits.h>
int boyer_moore_scan(char* str, char* letter) {
int str_p = 1; //문자열을 검사할 포인터
int let_p = 0; //패턴을 검사할 포인터
int str_len = strlen(str);
int let_len = strlen(letter);
int skip_p[UCHAR_MAX+1]; //몇번째 문자부... |
Java | UTF-8 | 2,707 | 1.859375 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2012-2014 eBay Software Foundation and selendroid committers.
*
* 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... |
JavaScript | UTF-8 | 348 | 3.1875 | 3 | [] | no_license | const propiedades = new Set();
propiedades.add("color");
propiedades.add("tamano");
propiedades.add("peso");
propiedades.add("forma");
console.log(propiedades);
propiedades.add("color");
console.log(propiedades);
const iterador = propiedades.entries();
console.log(iterador.next().value);
for(let item of iterador... |
C++ | UTF-8 | 3,755 | 3.234375 | 3 | [] | no_license | /*
* parser.h
*
* Created on: Mar 21, 2020
* Author: Jpost
*/
#include <string>
#include <unordered_map>
using namespace std;
vector<vector<string>> HRML_attr_parser(string tag, string line){
//inputs: tag name and line of source code e.g., <tag1 value = "HelloWorld">
//outputs: vect... |
C++ | UTF-8 | 1,162 | 3.546875 | 4 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
class Stack{
int top;
int s[10];
public:
Stack()
{
top=-1;
}
void push(int x)
{
if (!isFull())
{
s[++top]=x;
}
else{
cout<<"Stack is Full\n";
cout<<"------------------------------\n";
}
}
int pop()
{
if(!isEmpty())
... |
JavaScript | UTF-8 | 306 | 2.796875 | 3 | [] | no_license | const fs = require('fs');
fs.readdir('./node01',(err,dirs)=>{
for(let i of dirs){
if(fixfile(i)){
console.log("--"+i)
}else{
console.log("+"+i)
}
}
})
function fixfile(dir){
let stats = fs.statSync('./node01/'+dir)
return stats.isFile()
}
|
Java | GB18030 | 2,384 | 2.21875 | 2 | [] | no_license | package com.jeffen.note;
import android.annotation.SuppressLint;
import android.app.ActionBar;
import android.app.Activity;
import android.content.Intent;
import android.database.Cursor;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.w... |
Java | UTF-8 | 2,277 | 2.6875 | 3 | [] | no_license | package com.fitbank.webpages.util;
import java.io.Serializable;
import java.util.Collection;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.Transformer;
import com.fitbank.webpages.data.Reference;
/**
* Clase utilitaria para manejar dependencias.
*
* @author Smart F... |
C# | UTF-8 | 1,209 | 3.375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Lab03_Okoronko
{
class Program
{
static double Fact(double y)
{
return (y == 0) ? 1 : y * Fact(y - 1);
}
static void Main(string[] args... |
Python | UTF-8 | 405 | 2.6875 | 3 | [] | no_license | class Solution:
def totalHammingDistance(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
ones = [0 for _ in range(32)]
N = len(nums)
for num in nums:
i = 0
while num:
ones[i] += num & 1
i += 1
... |
Java | UTF-8 | 6,296 | 1.945313 | 2 | [] | no_license | package ru.adserver.service;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import org.apache.lucene.document.StringField;
import org.apache.lucene.document.TextField;
import org.apache.lucene.index.DirectoryReader;
import org.apache.lucene.index.IndexReader;
import org.apache.luc... |
Python | UTF-8 | 1,665 | 3.15625 | 3 | [] | no_license | from utils.file_service import read_file_from_resources
from typing import List
def part_1():
data_set = get_part_1_data()
correct_passwords_count = 0
for item in data_set:
occurences = item["query_string"].count(item["desired_character"])
if (occurences >= item["min_occurences"] ... |
JavaScript | UTF-8 | 607 | 3.296875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | function distanceFromHqInBlocks (someValue) {
return Math.abs(42 - someValue);
}
function distanceFromHqInFeet (someValue) {
return distanceFromHqInBlocks(someValue) * 264;
}
function distanceTravelledInFeet(num1, num2) {
let dist = Math.abs(num2 - num1);
return dist * 264;
}
function calculatesFarePrice(sta... |
C# | UTF-8 | 883 | 2.859375 | 3 | [] | no_license | using System;
namespace Zeghs.Events {
/// <summary>
/// 報價服務啟動或關閉狀態改變所觸發的事件
/// </summary>
public sealed class QuoteServiceSwitchChangedEvent : EventArgs {
private bool __bRunning = false;
private string __sDataSource = null;
/// <summary>
/// [取得] 報價資料來源名稱
/// </summary>
public string DataSourc... |
SQL | UTF-8 | 1,389 | 3.375 | 3 | [] | no_license | set pages 9999
set verify off
col Instance heading 'Environment Info' format a100
col sid heading 'Sid' format 999999
col serial# heading 'Serial#' format 999999
col username heading 'Username' format a15
col program heading 'Program' format a30
col event heading 'Event' ... |
C++ | UTF-8 | 2,397 | 3.734375 | 4 | [] | no_license | /******************************************************************************************
题目描述
输入一个整数数组,判断该数组是不是某二叉搜索树的后序遍历的结果。如果是则输出Yes,否则输出No。
假设输入的数组的任意两个数字都互不相同。
解题思路:例如序列 4, 8, 6, 12, 16, 14, 10
1. 后续遍历的最后一个结点是根节点,因此找到最后一个结点将序列分为左右子树。左子树结点都小于根
右子树结点均大于根。
2. 从序列开始找到比根结点大的位置,即为右子树开始。此时左边的元素均小于根,因此满足左子树要求
3. 判断右子树... |
Java | UTF-8 | 2,782 | 1.960938 | 2 | [] | no_license | package com.joy.xxfy.informationaldxn.module.driving.domain.repository;
import com.joy.xxfy.informationaldxn.module.common.domain.repository.BaseRepository;
import com.joy.xxfy.informationaldxn.module.common.enums.DailyShiftEnum;
import com.joy.xxfy.informationaldxn.module.department.domain.entity.DepartmentEntity;
im... |
Markdown | UTF-8 | 702 | 3.15625 | 3 | [] | no_license | # Prism Highlight
This is an adaptation of the [prismjs](https://github.com/PrismJS/prism)
library that works as an Angular component.
## Installation
Install `prism-highlight` with your favorite
package manager.
You will also need to install `prismjs`. Make sure that you
import the the libraries and styles you need... |
Python | UTF-8 | 4,655 | 2.828125 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | """AirbrakeHandler module.
All functions and types related to python logging
should be defined in this module.
A function for mapping a LogRecord object
https://docs.python.org/2/library/logging.html#logrecord-objects
to an Airbrake error should be included here.
"""
import logging
from airbrake.notifier import ... |
Go | UTF-8 | 2,105 | 3.171875 | 3 | [] | no_license | package mind
type EnrichResult struct {
Title string
Content string
ContentCopyright string
ContentSource string
ImageUrl string
ImageCopyright string
ImageSource string
Format EnrichFormat
}
func (e EnrichResult) Enriched() bool {
if len(e.Content) > 0 || len(... |
Java | UTF-8 | 2,352 | 2.578125 | 3 | [] | no_license | package com.wakaleo.dojo.melbourne1.checkout;
import com.sun.tools.doclets.internal.toolkit.util.TextTag;
import org.junit.Ignore;
import org.junit.Test;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.mockito.Mockito.mock;
import static org.mockito.Mocki... |
Java | UTF-8 | 2,406 | 2.5625 | 3 | [] | no_license | package tests;
import org.testng.Assert;
import org.testng.annotations.Test;
import base.TestBase;
public class LoginPageTests extends TestBase{
@Test(priority = 06)
public void verifyLoginPageTitle() {
hp.clickSignInLink();
String expectedLoginPageTitle = "Login - My Store";
String actualLoginPag... |
Python | UTF-8 | 7,113 | 2.703125 | 3 | [
"MIT"
] | permissive | # coding: utf-8
#------------------------------------------------------------------------------------------#
# This file is part of Pyccel which is released under MIT License. See the LICENSE file or #
# go to https://github.com/pyccel/pyccel/blob/master/LICENSE for full license details. #
#------------------------... |
JavaScript | UTF-8 | 825 | 2.625 | 3 | [] | no_license | import prefix from "./prefix.js"
import {reisy} from "./index.js"
export function use(...args) {
const style = {}
const classNames = []
args.forEach(processDef)
return {
className: classNames.join(" "),
style: prefix(style),
}
function processDef(def) {
if (!def) { return }
if (typeof de... |
C++ | UTF-8 | 898 | 2.59375 | 3 | [] | no_license | #ifndef P_H
#define P_H
#include<iostream>
#include<string>
#include <unistd.h>
#include<stdlib.h>
#include<time.h>
using namespace std;
class pokemon
{
protected:
string type;
string name;
int chance;
int stage;
int num;
public:
pokemon();
void set_type(string t);
void set_name(st... |
Java | UTF-8 | 574 | 1.898438 | 2 | [] | no_license | package cmpg.photoshare.repository;
import cmpg.photoshare.entity.MemberImage;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.repository.CrudRepository;
import javax.transaction.Transactional;
import java.util.List;
public interface MemberImageRepository extends CrudReposit... |
C++ | UTF-8 | 658 | 3.5 | 4 | [] | no_license | /*
Given two arrays, write a function to compute their intersection.
Example:
Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2].
Note:
Each element in the result must be unique.
The result can be in any order.
*/
#include <iostream>
#include <unordered_set>
#include <string>
#include <vector>
using nam... |
Java | UTF-8 | 249 | 1.789063 | 2 | [] | no_license | package com.jbp.randommaster.gui.common.grouping;
import java.util.EventListener;
public interface GroupingListener extends EventListener {
public void groupNameChanged(GroupingEvent e);
public void groupSelected(GroupingEvent e);
} |
Java | UTF-8 | 559 | 1.664063 | 2 | [] | no_license | package data;
public class PathData {
public static String pId = "choi";
public static String pStoreArea = null;
public static String pStoreName = null;
public static String pStoreTell = null;
public static String pStoreAddress = null;
public static String pProductName[] = {"주문상품1","주문상품2","주문상품3","주문상품4"};
pu... |
Java | UTF-8 | 2,585 | 3.296875 | 3 | [] | no_license | package com.study.schdule;
import java.util.PriorityQueue;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.ReentrantLock;
//该队列是一个优先级队列.并且也是一个阻塞队列
public class CustomPriorityQueue extends PriorityQueue<CustomTask>{
public ReentrantLock lock = new ReentrantLock();
private Cond... |
Java | UTF-8 | 2,415 | 2.375 | 2 | [] | no_license | package com.example.domain;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import javax.persistence.*;
import java.io.Serializable;
import java.util.List;
@Entity
@Table(name = "user")
@JsonIgnoreProperties(value = {"hibernateLazyInitializer", "handle... |
Java | UTF-8 | 1,823 | 3.484375 | 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 lab8;
/**
*
* @author Louis
*/
public final class XPoly {
// Bai 1. Them mot phuong thuc tinh voi tham so bien doi thuc... |
Java | UTF-8 | 566 | 2.015625 | 2 | [] | no_license | package com.lyb.service.impl;
import com.lyb.entity.AccWorksheet;
import com.lyb.mapper.AccWorksheetMapper;
import com.lyb.service.AccWorksheetService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class AccWorksheetServiceImpl implements... |
Java | UTF-8 | 787 | 3.15625 | 3 | [] | no_license | package com.oop.animalkingdom;
import java.awt.Color;
public class Bear extends Critter
{
private boolean polar;
private boolean rightStep=true;
public Bear() {};
public Bear(boolean polar) {
this.polar = polar;
}
@Override
public Action getMove(CritterInfo info)
{
return info.fr... |
Java | UTF-8 | 647 | 2.265625 | 2 | [] | no_license | package de.fzi.biggis.api;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import javax.ws.rs.ext.ExceptionMapper;
import javax.ws.rs.ext.Provider;
import de.fzi.biggis.exceptions.ParameterException;
@Provider
public class ParameterExceptionHandler implements ExceptionMapper<ParameterExcep... |
TypeScript | UTF-8 | 643 | 2.953125 | 3 | [] | no_license | import { CommandConfiguration } from './command-configuration.interface';
import { Executable } from '../interfaces/executable';
/**
* Decorator function defining a CLI command
*
* @param configuration Declaration of a command
*/
export function Command(configuration: CommandConfiguration): any {
return (const... |
JavaScript | UTF-8 | 1,673 | 3 | 3 | [] | no_license |
app.service('clientservice', function () {
//to create unique client id
var uid = 1;
//clients array to hold list of all clients
var clients = [{
id: 0,
'email': 'hello@gmail.com', // unique identifier
'username': 'Viral',
'fname': 'Viral',
'lname': 'Viral',... |
JavaScript | UTF-8 | 969 | 4.03125 | 4 | [] | no_license | // write a function to retrieve a blob of json
// make an ajax request! Use FETCH function.
//http://rallycoding.herokuapp.com/api/music_albums
/*function fetchAlbums() { //es6
fetch('http://rallycoding.herokuapp.com/api/music_albums') //endpoint
.then(res => res.json()) //return promise, when resolved, of... |
Python | UTF-8 | 19,094 | 3.34375 | 3 | [] | no_license | # coding=UTF-8
"""
=========================================
admin division数据(行政区划数据接口)
=========================================
:Author: glen
:Date: 2016.11.17
:Tags: mongodb database collection admin division
:abstract: admin division数据接口
**类**
==================
AdminDivision
admin division数据接口
**使用方法**
===... |
Python | UTF-8 | 6,659 | 3.09375 | 3 | [] | no_license | ## Librairie contenant les fonctions locales utilises
## par l'application
import pandas as pd
import numpy as np
import nltk
from nltk.corpus import stopwords
from nltk.stem import WordNetLemmatizer
from nltk.corpus import wordnet
from nltk.tokenize import word_tokenize
from sklearn.preprocessing import MultiLa... |
Python | UTF-8 | 1,549 | 4.3125 | 4 | [] | no_license | """
File: ta10-solution.py
Author: Br. Burton
This file demonstrates the merge sort algorithm. There
are efficiencies that could be added, but this approach is
made to demonstrate clarity.
"""
from random import randint
MAX_NUM = 100
def merge_sort(items):
"""
Sorts the items in the list
:param items: T... |
Java | UTF-8 | 319 | 2.578125 | 3 | [] | no_license | package web.card.demon;
public class Demon {
private String cardId;
private int power;
public String getCardId() {
return cardId;
}
public void setCardId(String cardId) {
this.cardId = cardId;
}
public int getPower() {
return power;
}
public void setPower(int power) {
this.power = power;
}
}
|
Java | UTF-8 | 1,825 | 2.265625 | 2 | [
"MIT"
] | permissive | package com.catalog.freezer.controller;
import java.util.List;
import javax.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
imp... |
C++ | UTF-8 | 657 | 2.640625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int main()
{
vector<vector<int>> nums(6);
int sum = 0;
int m = INT_MIN;
for (int i = 0; i < 6; i++) {
nums[i].resize(6);
for (int j = 0; j < 6; j++) {
cin >> nums[i][j];
}
cin.ignore(numeric_limits<streamsiz... |
Markdown | UTF-8 | 4,533 | 3.28125 | 3 | [] | no_license | # Annotation Guideline
# Milestone 2
This will be a multi-label annotation, meaning that a text can have multiple annotation labels.
Please read this instruction carefully, and for each text select ALL labels that apply.
If no labels apply to a particular text, select ‘None of the above’
#### Content
- Select Conte... |
Java | UTF-8 | 212 | 1.539063 | 2 | [] | no_license | package pl.krzywyyy.ztmwatcher.model;
import lombok.Data;
@Data
public class Ztm {
private Float Lat;
private Float Lon;
private String Time;
private String Lines;
private String Brigade;
}
|
C++ | UTF-8 | 554 | 2.875 | 3 | [] | no_license |
#include "common.h"
class Solution {
public:
vector<int> inorderTraversal(TreeNode *root) {
// Start typing your C/C++ solution below
// DO NOT write int main() function
vector<int> res;
if (root == NULL) return res;
vector<int> left = inorderTraversal(root->left);
... |
Markdown | UTF-8 | 3,624 | 2.921875 | 3 | [
"Apache-2.0"
] | permissive | ---
title: "조금더가설검정"
date: 2020-12-19T23:13:07+09:00
Description: ""
Tags: ['통계학']
Categories: ['통계학']
DisableComments: false
---
t- test 이외에 다른 가설검정을 배워본다.
- 독립성 : 두 그룹이 서로 독립적인 것이여야만 한다
- 정규성 : 가설 검정을 하려는 데이터가 정규분포와 일치하는지
- 등분산성 : 비교하고자하는 그룹간에 유사한 수준의 분산을 가지는지 (스케일이 비슷한지)
정규 분포가 아니고 많은 분포가 있을 수 있다.
- binomial, ... |
Java | UTF-8 | 2,072 | 2.34375 | 2 | [] | no_license | package com.cc.shop.dao;
import java.util.ArrayList;
import java.util.List;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import com.cc.shop.pojo.BillItem;
import com.cc.shop.pojo.Product;
import com.cc.shop.pojo.ShopCartItem;
import com.cc.shop.utils.PageHibernateCallback;
publ... |
C# | UTF-8 | 756 | 3.265625 | 3 | [] | no_license | using System.IO;
using System.Collections.Generic;
using System;
namespace RegexParser_Example
{
class Program
{
static void Main(string[] args)
{
var users = new List<Entity>();
var parser = new Parser();
using var sr = new StreamReader("Data.txt");
... |
Go | UTF-8 | 15,173 | 2.609375 | 3 | [] | no_license | package support
import (
"container/list"
"encoding/json"
"fmt"
"math/rand"
"net"
"os"
"reflect"
"strconv"
"strings"
"time"
)
type WorkerStat struct {
Reads int64
Writes int64
BytesRead int64
BytesWritten int64
ReadErrors int
WriteErrors int
Elapsed time.Duration
LowResponse ... |
C# | UTF-8 | 1,087 | 2.625 | 3 | [] | no_license | using UnityEngine;
/// <summary>
/// Script that will teleport the Kid at the Player's location
/// </summary>
public class Spawn : MonoBehaviour {
//Objects
public AudioClip laugh;
//Variables
public float x = 18;
public float y = 30;
public float z = -28;
public int timer = 0;
//U... |
Python | UTF-8 | 414 | 3.0625 | 3 | [] | no_license | # -- upsolve
N = int(input())
P = list(map(int, input().split()))
# 後ろから見ていって、P_n-1 > P_n < P_n+1となるnを探す(ここではj)
j = N - 2
while P[j] < P[j + 1]:
j -= 1
# P_n < P_kを満たす最小のkを探す
k = N - 1
while P[j] < P[k]:
k -= 1
# 入れ替える
P[j], P[k] = P[k], P[j]
# 性質を満たすnまで表示+残りは降順で表示
print(*P[: j + 1], *P[:j:-1])
|
Java | UTF-8 | 1,518 | 2.484375 | 2 | [] | no_license | package com.project.sms.app;
import android.content.ContentResolver;
import android.database.Cursor;
import android.net.Uri;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ListView;
import android.widget.SimpleCursorAdapter;
public class Inbox extends AppCompatActivit... |
Python | UTF-8 | 130 | 2.828125 | 3 | [] | no_license |
f = open('out/all_titles_processed.txt', 'r')
print(f)
titles = f.read()
for t in titles.split("'b"):
print(str(t.strip()))
|
Python | UTF-8 | 1,261 | 3.078125 | 3 | [] | no_license | # 给你一个 只包含正整数 的 非空 数组 nums 。请你判断是否可以将这个数组分割成两个子集,使得两个子集的元素和相等。
#
#
#
# 示例 1:
#
#
# 输入:nums = [1,5,11,5]
# 输出:true
# 解释:数组可以分割成 [1, 5, 5] 和 [11] 。
#
# 示例 2:
#
#
# 输入:nums = [1,2,3,5]
# 输出:false
# 解释:数组不能分割成两个元素和相等的子集。
#
#
#
#
# 提示:
#
#
# 1 <= nums.length <= 200
# 1 <= nums[i] <= 100
#
#... |
Java | UTF-8 | 766 | 3.796875 | 4 | [] | no_license | package Exception;
public class CustomException {
static void validate(int salary) throws SalaryException{
if(salary < 2000) {
throw new SalaryException("You need to work hard!");
}
if (salary >= 2000 && salary <= 5000) {
throw new SalaryException("You're salary is somewhat good");
}
if (salary > 51... |
SQL | UTF-8 | 433 | 2.8125 | 3 | [] | no_license | SELECT trd_date,
st_id,
avg(op) avg_op,
std(op) std_op,
avg(hp) avg_hp,
std(hp) std_hp,
avg(lp) avg_lp,
std(lp) std_lp,
avg(cp) avg_cp,
std(cp) std_cp,
avg(cnt) avg_cnt,
std(cnt) std_cnt,
avg(amt) avg_amt,
std(amt) std_amt,
... |
SQL | UTF-8 | 1,329 | 3.0625 | 3 | [
"MIT"
] | permissive | -- ---
-- SECTION TEST DATA
-- inserts a selection of sections for the courses offered
-- ---
INSERT INTO section
(
created_by,
course_id,
year,
term,
period,
active
)
VALUES
(
1, 1, '2014',
'Trimester 1 - Fall', 'D',
1
),
... |
Python | UTF-8 | 102 | 3.203125 | 3 | [] | no_license | word = input().split("WUB")
org = []
for x in word:
if len(x)>0:
org.append(x)
print(*org, sep=' ') |
Python | UTF-8 | 347 | 4.0625 | 4 | [] | no_license | def calculator(num1,num2):
add = num1+num2
subtract = num1-num2
multiply = num1*num2
divide = num1/num2
print("sum:", add, " difference:", subtract, " product:", multiply, " quotient:", int(divide))
number1 = input("please enter first number")
number2 = input("please enter second number")
calculator... |
Go | UTF-8 | 2,997 | 3.15625 | 3 | [] | no_license | // 56 ms, faster than 96.77%
// 限制条件 :
// 1. 统计每个方块的四个角出现的次数,一定注意,可能次数不不不不不是 1,2,4,可能有3的情况
// 2. 组合后的大面积与小面积相同(注意,不能只看这个条件,比如覆盖面积和缺失面积相同的时候也满足这个条件)
// 3. 次数为1的四个点是最大最小的四个点
// [[0,-1,1,0],[0,0,1,1],[0,1,1,2],[0,2,1,3]]
// [[1,1,3,3],[3,1,4,2],[3,2,4,4],[1,3,2,4],[2,3,3,4]]
// [[1,1,2,2],[1,1,2,2],[2,1,3,2]]
// [[0,0,3,3... |
Shell | UTF-8 | 474 | 3.234375 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env sh
. "${bin}/include/all"
connection_details="--defaults-extra-file=${connection_config}"
"${mysql}" ${connection_details} -e"quit" >/dev/null
code=${?}
if [ "${code}" -eq 127 ]; then
echo "${COLOR_RED}Could not find mysql binary.${COLOR_NC}"
else
if [ "${code}" -eq 1 ]; then
echo "${COLO... |
Python | UTF-8 | 2,186 | 2.890625 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Tue Mar 16 12:59:21 2021
@author: Sonu
"""
import numpy as np
import cv2
MIN_MATCH_COUNT = 4
img1 = cv2.imread('left2.jpg',0) #QueryImage
img2 = cv2.imread('right2.jpg',0) #TrainImage
#Initiating SIFT descriptor
sift = cv2.xfeatures2d.SIFT_create()
#Finding ... |
C | UTF-8 | 571 | 3.171875 | 3 | [] | no_license | /***********************************************************
Function File: F_CI_F.C - MCA Lab Assignment - 3.11
Author: Deepak Shakya
Date: 26-09-2009
Description: Stores the function that calculates the compound interest
***********************************************************/
float compound_interest(floa... |
Python | UTF-8 | 1,034 | 2.640625 | 3 | [] | no_license | import sys
input = sys.stdin.readline
N = int(input())
A = list(map(int, input().split()))
A.append(0)
S = [A[0], A[1], A[2], sum(A[3:])]
l = 0
r = 2
while r < N-1:
if S[2] + A[r+1] <= S[3] - A[r+1]:
S[2] += A[r+1]
S[3] -= A[r+1]
r += 1
else:
break
S2 = [S[0], S[1], S[2]+A[r+1... |
C | UTF-8 | 598 | 3.3125 | 3 | [] | no_license | #include "Arquivao.h"
void main(){
int op;
int n;
do{
printf("\nQuantos valores serão utilizados?\n");
scanf("%d",&n);
}while((n>10)||(n<4) );
printf("Qual media deseja calcular?\n 1-Media aritmetica simples\n 2-Media aritmetica ponderada\n 3-Media geometrica\n 4-Media harmon... |
C# | UTF-8 | 2,640 | 3.625 | 4 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
/* Neben den Delegate-Typen Func und Action gibt es den built-in Delegate-Typ Predicate.
* Siehe MSDN Predicate<T> Delegate.
*
* Der Delegate-Typ Predicate (Aussage) ist in der Bibliothek mscorlib.d... |
Java | UTF-8 | 2,912 | 2.40625 | 2 | [] | no_license | package com.testdvdrental.dvdrental.service;
import com.testdvdrental.dvdrental.dto.ActorDto;
import com.testdvdrental.dvdrental.entity.ActorEntity;
import com.testdvdrental.dvdrental.exception.ResourceNotFoundException;
import com.testdvdrental.dvdrental.repository.ActorRepository;
import org.springframework.beans.fa... |
PHP | UTF-8 | 747 | 2.796875 | 3 | [] | no_license | <?php
/**
*
*/
class Reservation
{
private $num,$dated,$datef,$voyage,$client;
function __construct($b,$c,$v,$cl)
{
$this->dated = $b;
$this->datef = $c;
$this->voyage = $v;
$this->client = $cl;
}
function getnums(){
return $this->num;
function getdated(){
return $this->dated;
}
function getdat... |
PHP | UTF-8 | 3,083 | 2.515625 | 3 | [] | no_license | <?php
/**
*
* ..::..
* ..::::::::::::..
* ::'''''':''::'''''::
* ::.. ..: : ....::
* :::: ::: : : ::
* :::: ::: : ''' ::
* ::::..:::..::.....::
* ''::::::::::::''
* ''::''
*
*
* NOTICE OF LICENSE
*
* This source file is subject to the Creative Commons Licens... |
Java | UTF-8 | 4,072 | 1.742188 | 2 | [] | no_license | /**
*/
package petrinetv3Trace.Steps.impl;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.impl.EFactoryImpl;
import org.eclipse.emf.ecore.plugin.EcorePlugin;
import petrinetv3Trace.Steps.*;
/**
* <!-- begin-user-doc -... |
Markdown | UTF-8 | 478 | 2.640625 | 3 | [] | no_license | # travel_app
## Explanation:
App works on an emulator, but it doesn't quite work on a real device. I'm not sure if I'm continuing this project, because the main objective was to learn how to work with fragments and how to make a single activity application. In addition, I've learned a lot about SQLite databases in An... |
C# | UTF-8 | 13,488 | 3.265625 | 3 | [] | no_license | using System;
using System.Linq;
namespace Core {
public class MatrixDouble {
protected int _Col, _Row;
public int Col => _Col;
public int Row => _Row;
protected double[,] _Data;
public double[,] Data {
get => _Data;
set => _Data = value;
}
... |
Python | UTF-8 | 775 | 3.078125 | 3 | [
"MIT"
] | permissive | class RestrictingWrapper(object):
def __init__(self, wrappee, block):
self._wrappee = wrappee
self._block = block
def __getattr__(self, attr):
if attr in self._block:
raise RestrictionError(attr)
return getattr(self._wrappee, attr)
class RestrictionError(Exceptio... |
C# | UTF-8 | 3,066 | 2.84375 | 3 | [] | no_license | using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Collections.Generic;
namespace LceUnitTest
{
[TestClass]
public class UnitTest1
{
[TestMethod]
public void TestDivisibleBy3()
{
//initialize
LceLibrary.Lce lce = new LceLibrary.Lc... |
Java | UTF-8 | 14,724 | 1.9375 | 2 | [] | no_license | package com.boyaa.mf.service.task;
import com.alibaba.fastjson.JSONException;
import com.alibaba.fastjson.JSONObject;
import com.boyaa.base.hbase.HConnectionSingleton;
import com.boyaa.base.hbase.MultiThreadQuery;
import com.boyaa.base.utils.CsvUtil;
import com.boyaa.base.utils.JSONUtil;
import com.boyaa.mf.constants.... |
Python | UTF-8 | 2,573 | 2.96875 | 3 | [] | no_license | from time import time
def get_joker_positions(word):
positions = [0] * len(word)
queue = [""]
prev_q = [""]
most_right_subword_end = dict() # [{} for i in range(len(word)+1)]
for i in range(len(word)):
new_q = [subword+word[i] for subword in queue if len(subword) < subword_len_... |
Python | UTF-8 | 2,823 | 2.53125 | 3 | [] | no_license | # -*- coding:utf-8 -*-
import sys
import csv
import json
from bs4 import BeautifulSoup
import js2xml
from lxml import etree
# Async model
import aiohttp
import asyncio
from aiohttp import ClientSession
# retry- setting
import requests
from urllib3.util.retry import Retry
from requests.adapters import HTTPAdapter
s =... |
C++ | GB18030 | 1,394 | 3.953125 | 4 | [] | no_license | /*
*
*/
#include "stdio.h"
//ȡֵȷм
int getMax(int arr[], int len){
int i, max;
max = arr[0];
for(i=1;i<len;i++)
{
if(arr[i]>max)
max = arr[i];
}
return max;
}
void count_Sort(int arr[], int len, int exp)
{
int i;
int temp[len];//ʱ
//ʮͰ
int bucket[10] = { 0 };
... |
C++ | UTF-8 | 3,895 | 2.703125 | 3 | [] | no_license | #pragma once
#include "libtcod.hpp"
#include "dungeonMap.h"
#include "direction.h"
#include "mapRectangle.h"
#include <algorithm>
#include <vector>
/*
TODO
Implement "room" class for use in map generation, probably also later during gameplay
e.g. for use with lineOfRooms function; return set of generated rooms
... |
Java | UTF-8 | 1,106 | 2.984375 | 3 | [] | no_license | package com.core.aop;
import java.util.HashMap;
import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
import org.apache.commons.lang.time.StopWatch;
/**
* 记录方法的执行时间
*
* @author ljs
*/
public class MethodTimeAdvice implements MethodInterceptor {
/**
* 拦截要执行的目标... |
JavaScript | UTF-8 | 1,133 | 2.515625 | 3 | [] | no_license | const {animate,dp,ease_cubicinout,lerp,between,color,golden,enframe,blur} = require('./animate');
function ease_linearinout(t) {
return 1-2*Math.abs(t-0.5);
}
const SIZE = 6;
const x_order = [0,3,2,1,4];
const y_order = [4,0,1,3,2];
const GAP = 20;
const w = 100/SIZE;
const g = GAP/SIZE;
function draw(ctx,t1,t2)... |
Python | UTF-8 | 3,478 | 2.515625 | 3 | [
"Unlicense"
] | permissive | from flask import Blueprint, render_template, request, redirect, url_for
from foodtracker.models import Food, Log
from foodtracker.extensions import db
from datetime import datetime
main = Blueprint('main', __name__)
@main.route('/')
def index():
logs = Log.query.order_by(Log.date.desc()).all()
log_dates ... |
Java | UTF-8 | 2,184 | 2.34375 | 2 | [] | no_license | package com.demo.xf.filter;
import org.springframework.core.annotation.Order;
import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import javax.servlet.annotation.WebInitParam;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSes... |
C++ | UTF-8 | 1,078 | 2.625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int election[32];
string parties[32];
int main() {
string s;
getline(cin, s);
int t = atoi(s.c_str());
while(t--) {
getline(cin, s);
getline(cin, s);
int n = atoi(s.c_str());
map<string, int> mt;
for(int i = 0; i < n; i++) {
string n... |
Go | UTF-8 | 563 | 2.625 | 3 | [] | no_license | package main
import(
"html/template"
"path/filepath"
"net/http"
)
type Page struct {
Title string
Body []byte
}
type vue struct{
Title string
}
type donne struct{
IsCo bool
Name string
Ar interface{}
}
func jointure(r *http.Request,w http.ResponseWriter,are donne,ar ...string){
var joins []string
are.I... |
Markdown | UTF-8 | 3,146 | 3.0625 | 3 | [] | no_license | ---
layout: post
title: 3D dinosaur scene
date: 2018-05-08
permalink: /projects/dinosaur3D/
---
# 3D engine : dinosaur scene (Python / OpenGL4)
_Contributors: Mathieu Tillet_
<hr />
This project was the final assignment for the **3D computer graphics** course.
We were required to create a 3D engine, providing solutio... |
C | UTF-8 | 5,105 | 4.0625 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include "linkedlist.h"
// Initialize an empty list
void initList(List* list_pointer){
list_pointer->head = NULL;
list_pointer->tail = NULL;
}
// Create node containing item, return reference of it.
Node* createNode(void* item){
Node* new_node = (Node*)malloc(sizeof(Node));... |
Python | UTF-8 | 1,267 | 2.765625 | 3 | [] | no_license |
from random import randint
import asyncio
from asyncio_pool import AioPool
from scapy.sendrecv import sr1, send, srp, srp1, sr
from scapy.layers.inet import IP, ICMP, TCP,UDP
def udp_task():
#随机产生一个1-65535的IP的id位
ip_id=randint(1,65535)
#随机产生一个1-65535的icmp的id位
icmp_id=randint(1,65535)
#随机产生一个1-655... |
Java | UTF-8 | 1,071 | 2.0625 | 2 | [] | no_license | package com;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.SQLFeatureNotSupportedException;
import java.util.logging.Logger;
import javax.sql.CommonDataSource;
/**
*
* <p>Copyright: Copyright (c) 2017</p>
* <p>Company: 熠道大数据</p>
* @ClassName: Re... |
Java | UTF-8 | 1,035 | 2.234375 | 2 | [
"MIT"
] | permissive | package org.serverct.parrot.parrotx.command;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.NotNull;
import org.serverct.parrot.parrotx.utils.i18n.I18n;
public interface PCommand extends CommandExecutor {
Stri... |
C# | UTF-8 | 555 | 2.5625 | 3 | [] | no_license | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MHWarBand : MonoBehaviour
{
// Use this for initialization
void Start()
{
MHumanoid human = new MHumanoid();
MHumanoid enemy = new MHEnemy();
MHumanoid orc = new MHOrc();
// Notice ... |
Java | UTF-8 | 5,957 | 2.234375 | 2 | [
"Apache-2.0"
] | permissive | package com.example.oigami.twimpt;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.w... |
Python | UTF-8 | 1,769 | 2.859375 | 3 | [
"MIT"
] | permissive | from django.test import TestCase
from books.models import Book, BookDetails
class TestDeletingBook(TestCase):
"""When a book is deleted, the corresponding BookDetails object (if any)
should be automatically deleted as well. This is not a built-in feature
since Book has a OneToOneField for BookDetails, no... |
Java | UTF-8 | 4,649 | 2.21875 | 2 | [] | no_license | package com.zx.order.activity;
import android.app.Activity;
import android.support.design.widget.TabLayout;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import com.zx.order.R;
import org.xutils.view.annotation.Vie... |
Java | UTF-8 | 1,361 | 2.671875 | 3 | [] | no_license | package entity;
public class Empl_Proj {
private Long employeeId;
private Long prijectId;
public Empl_Proj(){}
public Long getEmployeeId() {
return employeeId;
}
public void setEmployeeId(Long employeeId) {
this.employeeId = employeeId;
}
public Long getPrijectId() {
return prije... |
Rust | UTF-8 | 6,572 | 2.59375 | 3 | [] | no_license | use crate::prelude::*;
use super::util::*;
use super::gfx::{Gfx, ui};
use crate::task::{PlayerCommand, ControllerMode, Promise};
use crate::gamestate::GameState;
use crate::room::Room;
pub struct MapView {
door_views: [DoorView; 4],
player_move_in_progress: bool,
full_map_view_requested: bool,
in_main_mode: bool... |
Swift | UTF-8 | 1,228 | 2.53125 | 3 | [] | no_license | //
// CategoriesRequestService.swift
// Pets
//
// Created by Valerii Petrychenko on 5/20/20.
// Copyright © 2020 Valerii. All rights reserved.
//
import Foundation
final class CategoriesRequestService {
static func getCategories(callBack: @escaping (_ categories: [Category]?, _ error: Error?) -> Void) {
... |
Go | UTF-8 | 3,428 | 3.03125 | 3 | [
"BSD-3-Clause"
] | permissive | // -*- coding:utf-8; indent-tabs-mode:nil; -*-
// Copyright 2014, Wu Xi. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package logex
import (
"bytes"
"errors"
"fmt"
"runtime"
"strconv"
"strings"
"testing"
)
func TestNormalOutput(t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.