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 | 566 | 3.15625 | 3 | [] | no_license | //Normal Space Class: Defines a ladder space
//Alex Wells, William Rathbun | Project 1
public class ladderSpace extends Space
{
public ladderSpace(){
}
public int onLanding(int position){
switch (position) { //returns how many spaces ahead a player should climb
case 1: return 37;
case... |
C# | UTF-8 | 1,312 | 2.546875 | 3 | [] | no_license | using System;
using System.Net.Sockets;
using System.Windows.Forms;
using Client.Forms;
using GameData.ClientInteraction;
namespace Client
{
public static class Program
{
/// <summary>
/// Главная точка входа для приложения.
/// </summary>
[STAThread]
public static void... |
Java | UTF-8 | 3,609 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2012-2022 Erwin Müller <erwin.mueller@anrisoftware.com>
*
* 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 r... |
Markdown | UTF-8 | 13,907 | 2.53125 | 3 | [
"MIT"
] | permissive | # Development Tools
A collection of awesome development libraries, resources and tools.
> For those resource with ⭐️ it's just my personal preference.
* [Analytics Platform](development-tools.md#analytics-platform)
* [Console](development-tools.md#console)
* [Code Editor](development-tools.md#code-editor)
* [Online ... |
Python | UTF-8 | 760 | 2.546875 | 3 | [
"MIT"
] | permissive | import traces
import pytest
@pytest.mark.mpl_image_compare(
savefig_kwargs={'bbox_inches': 'tight', 'dpi': 300},
remove_text=True,
style='ggplot',
tolerance=20,
)
def test_plot():
ts = traces.TimeSeries()
ts[0] = 0
ts[1] = 2
ts[3] = 1
ts[5] = 0
figure, axes = ts.plot()
... |
Markdown | UTF-8 | 5,316 | 2.875 | 3 | [
"MIT"
] | permissive | ---
title: 课堂话语分析:转录的两个偏见(上)
author: S
layout: post
permalink: /2011/04/classroom-discourse-analysis-two-biases-in-transcription-1/
views:
- 630
categories:
- 发改委
tags:
- 应用语言学
- 视频转录
- 话语偏见
- 话语转录
- 语言人类学
- 课堂话语分析
---
在话语分析领域,转录(transcription)就是把录音或视频中的话语转换为书面的文字。我在念硕士的时候,做过几个简单的视频转录工作。当时只觉得耗时耗力,一节四十分钟... |
Python | UTF-8 | 1,582 | 3.609375 | 4 | [] | no_license | import os
def loadCharacterSelect():
print(os.path.isfile("characters/characterList.csv"))
if os.path.isfile("characters/characterList.csv"):
file = open("characters/characterList.csv", "r")
else:
file = open("characters/characterList.csv", "w+")
charArray = file.readlines()
characters = []
for char in char... |
C# | UTF-8 | 1,758 | 3.296875 | 3 | [] | no_license | public abstract class SocialNetwork
{
/// <summary>
/// Email address of the user
/// </summary>
public virtual string EmailAddress { get; set; }
/// <summary>
/// When posting a public message, the number of characters allowed.
/// </summary>
public virtual int AllowedNumberOfCharacters
{
get
... |
Java | UTF-8 | 320 | 1.609375 | 2 | [] | no_license | package com.hbwang.viewbindlib.inject.provider;
import android.app.Activity;
import com.hbwang.viewbindlib.inject.sender.bindclick.IBindClick;
/**
* ----------Dragon be here!----------/
* Created by HBWang on 2019/3/25-13:46
*/
public interface IBindClickFactory {
IBindClick getProduct(Activity activity);
}
|
Shell | UTF-8 | 342 | 3.1875 | 3 | [] | no_license | #!/bin/sh
tree -T "Libarchive downloads" -H "." -L 1 -r -I "index.html" -i --noreport downloads | sed -E -e 's,^.*<a href=".">.</a>.*,,' > downloads/index.html
cd downloads && (
FILES=`ls -1 *.zip *.tar* *.asc | sort -r`
rm -f .sha256sums
for FILE in ${FILES}
do
openssl sha256 ${FILE} >> .sha256sums
done
mv .sh... |
C++ | UTF-8 | 404 | 3.140625 | 3 | [] | no_license | #include <iostream>
#include "Stack.h"
using namespace std;
using namespace MYStack;
int main()
{
Stack<int> A(10);
A.push(7);
A.push(11);
cout << A.top() << endl;
A.pop();
A.push(9);
cout << A.top() << endl;
cout << A[0] << endl;
//cout << A[3] << endl;
A.pop();
Stack<string> B(10);
B.push("Bob");
... |
JavaScript | UTF-8 | 629 | 2.75 | 3 | [] | no_license | //npm - global command, comes with node
//npm -- version
//local dependency - use it only in this particular project
//npm i <packagename>
//global dependency - use it in any project
//npm install -g <packageName>
//sudo npm install -g <packageName> (mac)
//package.json - manifest file( stores important info about p... |
TypeScript | UTF-8 | 530 | 2.984375 | 3 | [] | no_license | export class User {
constructor(private name: string,
private active: number,
private unactive: number,
private status: boolean) {
}
getName(): string {
return this.name;
}
getActive(): number {
return this.active;
}
getUnactive(): number {
return this... |
Java | UTF-8 | 1,789 | 3.734375 | 4 | [] | no_license | package Shu;
import mode.TreeNode;
import java.util.ArrayList;
/**
* 找二叉树的第k个节点
* 二叉查找树,二叉搜索树,的特点,左边节点都比跟节点小,右节点都比左节点大
* <p>
* 利用中序遍历的有序性来做这个事
* <p>
* 第k个或者第k大个节点,直接用中序求
* <p>
* https://leetcode-cn.com/problems/er-cha-sou-suo-shu-de-di-kda-jie-dian-lcof/
*/
public class BinaryTreeKNode {
public static v... |
Shell | UTF-8 | 1,988 | 3.625 | 4 | [
"MIT"
] | permissive | #!/usr/bin/env sh
BASEDIR=$(git rev-parse --show-toplevel)
COMMAND=${@}
TOPIC=${TOPIC:-test}
KAFKA_HOST=${KAFKA_HOST:-localhost:9193}
ZHOST=${ZHOST:-localhost:2181}
CLIENT_JAAS="${BASEDIR}/setup/kafka-setup/client-jaas.conf"
echo "Kafka host: ${KAFKA_HOST} // ZHost: ${ZHOST}"
create_client_properties () {
if [ -z... |
C++ | UTF-8 | 6,698 | 2.59375 | 3 | [
"MIT"
] | permissive | #ifndef RX_CORE_JSON_H
#define RX_CORE_JSON_H
#include "rx/core/concurrency/atomic.h"
#include "rx/core/traits/return_type.h"
#include "rx/core/traits/is_same.h"
#include "rx/core/traits/detect.h"
#include "rx/core/utility/declval.h"
#include "rx/core/utility/exchange.h"
#include "rx/core/string.h"
#include "rx/core... |
Java | GB18030 | 145 | 2.109375 | 2 | [] | no_license | package subject;
/**
* ǶҪʵֵĽӿ
* @author swh
*
*/
public interface Subject {
public void buyMac();
}
|
Java | UTF-8 | 1,096 | 3.640625 | 4 | [] | no_license | package com.demo.gyw.java.multi_thread.create;
/**
* @Description: 创建多线程之实现Runnable
* @Author: gyw
* @CreateDate: 2019/11/5 11:20
* @Version: 1.0
*/
public class ImplementsRunnable implements Runnable {
private String name;
public ImplementsRunnable(String name) {
this.name = nam... |
Java | UTF-8 | 2,906 | 1.828125 | 2 | [] | no_license | package com.howell.activity;
import android.app.Activity;
import android.content.ComponentName;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.Bundle;
import android.os.IBinder;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.Vie... |
C# | UTF-8 | 1,226 | 2.59375 | 3 | [] | no_license | using PresentationProjectDomainDb;
using PresentationProjectDomainModels.Implementation;
using PresentationProjectDomainServices.Abstraction;
using System;
using System.Collections.Generic;
using System.Linq;
namespace PresentationProjectDomainServices.Implementation
{
public class AccountService : IAccountServic... |
Python | UTF-8 | 1,210 | 3.265625 | 3 | [] | no_license | #!/usr/bin/env python3
#
# Advent of Code 2016 - Day 5
#
import hashlib
from itertools import count
INPUT = 'ugkcyxxp'
# PART 1
def next_char(door_id, start=0):
for idx in count(start):
text = "{}{}".format(door_id, idx).encode()
hashi = hashlib.md5(text).hexdigest()
if hashi.startswith(... |
Python | UTF-8 | 615 | 2.65625 | 3 | [] | no_license | import sys
sys.stdin = open('sample_input.txt')
T = int(input())
for tc in range(1,T+1):
F = int(input())
numbers = list(map(int,input().split()))
for i in range(len(numbers)):
for j in range(len(numbers)-1):
if numbers[j] > numbers[j+1]:
numbers[j], numbers[j+1] = numbe... |
Python | UTF-8 | 556 | 3.078125 | 3 | [] | no_license | '''
using hashmap
time: O(N)
space: O(N)
'''
class Solution:
def maxOperations(self, nums: List[int], k: int) -> int:
counter = collections.Counter(nums)
ans = 0
for n in nums:
if n == k / 2:
ans += counter[n] // 2
del counter[n]
... |
Python | UTF-8 | 5,151 | 3.203125 | 3 | [] | no_license | import sys
import io
from math import floor
from random import randint
import pygame
from pygame.locals import QUIT, MOUSEBUTTONDOWN
while True:
a = input("난이도를 몇으로 하시겠습니까? 1, 2, 3, 4:\n")
if a == '1':
WIDTH = 10
HEIGHT = 10
BOMBS = 10
break
elif a == '2':
WIDTH = 15... |
Java | UTF-8 | 9,061 | 2.328125 | 2 | [] | no_license | package com.danqiu.myapplication.socket;
import android.annotation.SuppressLint;
import android.app.Service;
import android.content.Intent;
import android.os.Binder;
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
import android.util.Log;
import com.danqiu.myapplication.utils.MLog;
i... |
PHP | UTF-8 | 4,721 | 2.59375 | 3 | [] | no_license | <?php
# редактирование записи
if (isset($_GET['uri']) and $page['uri'] = $_GET['uri']) {
require_once 'db.php';
require_once 'simpleMySQLi.class.php';
# создание объекта для работы с БД
$sql = new simpleMySQLi($db, pathinfo(__FILE__, PATHINFO_DIRNAME));
# поиск записи по URI
$sql->str = 'select * from a... |
JavaScript | UTF-8 | 2,357 | 2.734375 | 3 | [] | no_license | const LANGUAGE_MAP = require('./languages');
function findTextNodes(nodeList) {
return Array.from(nodeList)
.filter((node) => node.nodeType === 3);
}
module.exports = function consumeIndex(document) {
return Array.from(document.querySelectorAll('.sectiontable tr'))
.filter((row) => row.childElementCount)
... |
Python | UTF-8 | 2,260 | 3.078125 | 3 | [] | no_license | #! /usr/bin/env python3
from pathlib import Path
import git
def search_upwards_for_file(d, filename):
"""Search in the current directory and all directories above it
for a file of a particular name.
https://stackoverflow.com/a/68994012/79125
Arguments:
---------
filename :: Path, the direct... |
Markdown | UTF-8 | 318 | 2.5625 | 3 | [] | no_license | # Assignment-4.2
d=list(map(str,input("enter the words: ").split(" ")))
def lenlet(x): return len(x)
ans=list(map(lenlet, d))
print("lenght of words are: ", ans)
a=input("Enter the charecter to check vowel: ")
def vche(x):
if x in "AEIOUaeiou": return True
else: return False
ans=list(map(vche, a))
print(ans)
|
Ruby | UTF-8 | 1,433 | 2.5625 | 3 | [
"LGPL-2.1-or-later",
"LGPL-3.0-only",
"Apache-2.0"
] | permissive | /**
* Validators can not delegate validation while registered as validators.
*/
rule no_validate_delegation_when_validating {
env _e;
env eF;
address account = eF.msg.sender;
bool _isAccountValidating = sinvoke _isValidating(_e,account);
calldataarg arg;
invoke delegateValidating(eF,arg);
bool succeededDele... |
SQL | UTF-8 | 670 | 3.265625 | 3 | [] | no_license | #针对某个库做授权
GRANT ALL ON ecshop.* TO study@'192.168.1.%'; #授权后show DATABASES可以看到ecshop
#查看user权限
SELECT * FROM user WHERE user='study';
#查看db库权限
SELECT * FROM db;
#收回库级别的权限
REVOKE ALL ON ecshop.* FROM study@'192.168.1.%';
#针对表级别授权
GRANT INSERT,UPDATE,SELECT ON ecshop.ecs_goods TO study@'192.168.1.%';
#查看表级别的权限
SELEC... |
Java | UTF-8 | 293 | 1.59375 | 2 | [] | no_license | package com.sdk.core;
import android.app.Application;
/**
* author xander on 2017/6/9.
* function 使用前可以先继承这个类
*/
public class AppHelper extends Application {
@Override
public void onCreate() {
super.onCreate();
InitSDK.init(this);
}
}
|
Java | UTF-8 | 6,875 | 1.789063 | 2 | [] | no_license | package kidzania.vehiclespuzzlegame;
import android.content.ClipData;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import kidzania.vehiclespuzzlegame.libClass.CountDownAnimation;
import kidzania.ve... |
Markdown | UTF-8 | 3,053 | 2.5625 | 3 | [] | no_license | # What does Webpack do?
* Compress
* Packaging
* Compile of files (Less, Sass...)
* Scaffold
* Generating...
# Set up Webpack
## Install Webpack
npm i webpack-cli -g
## Webpack file
webpack.config.js<br/>
This is the 'default'. But you can change it if you really want to.
## Run Webpack
webpack
# Webpack file
## mo... |
Java | UTF-8 | 6,171 | 2.125 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2013 International Health Terminology Standards Development Organisation.
*
* 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... |
Java | UTF-8 | 539 | 1.789063 | 2 | [
"Apache-2.0"
] | permissive | package pl.allegro.tech.hermes.tracker.frontend;
import java.util.Map;
public interface LogRepository {
void logPublished(String messageId, long timestamp, String topicName, String hostname, Map<String, String> extraRequestHeaders);
void logError(String messageId, long timestamp, String topicName, String re... |
Java | UTF-8 | 2,749 | 3.296875 | 3 | [] | no_license | package algo;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.StringTokenizer;
public class Main {
public static void main(String args[]) throws IOException {
new Task().run();
}
stat... |
Java | UTF-8 | 2,961 | 3.59375 | 4 | [] | no_license | package com.ganht.algorithm.leetcode;
import com.ganht.algorithm.base.BinaryTreeProblem;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Given a binary tree root. Split the binary tree into two subtrees by removing 1 edge such that the product of the sums
* ... |
Java | UTF-8 | 1,288 | 2.5 | 2 | [] | no_license | package exp45users;
public class users {
private String name;
private String pwd;
private String sex;
private String [] hobbies;
private String hobbies1;
private String hobbies2;
private String hobbies3;
private String hobbies4;
public String getHobbies1() {
return hobbies1;
... |
Java | UTF-8 | 758 | 2.359375 | 2 | [] | no_license | package lu.ftn.kpservice.model.dto;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
public class BitcoinPaymentDTO {
@NotNull
@NotBlank
private String token;
private String pairingCode;
public BitcoinPaymentDTO() {
}
public BitcoinPaymentDTO(@... |
C++ | UTF-8 | 1,063 | 2.546875 | 3 | [] | no_license | /*************************************************************************
> File Name: 1005-rooks.cpp
> Author: mengshangqi
> Mail: mengshangqi@gmail.com
> Created Time: 2014年03月14日 星期五 21时13分58秒
************************************************************************/
#include<iostream>
#include<cs... |
Python | UTF-8 | 705 | 2.609375 | 3 | [] | no_license | from keras.models import model_from_json
import numpy as np
class DiseaseDetectionModel(object):
RICEDISEASELIST = ["Blast", "Blight", "Brownspot", "Sheath Blight", "Tungro"]
def __init__(self, model_json_file, model_weight_file):
with open(model_json_file, "r") as json_file:
loa... |
C# | UTF-8 | 3,464 | 2.671875 | 3 | [] | no_license | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// Main author: Hugo Bailey
// Additional author: N/A
// Description: Used to store data about a quest
// Development window: Prototype phase
// Inherits from: ScriptableObject
[CreateAssetMenu(fileName = "Quest da... |
Python | UTF-8 | 6,628 | 2.71875 | 3 | [] | no_license | import re
import glob
import os
import logging
import os.path as op
import numpy as np
def last_checkpoint(prefixes, snapshot_interval=None, max_iter=None,
snapshot_ext=".solverstate", weights_ext=".caffemodel"):
"""Find the last checkpoints inside given prefix paths
Look at the paths in p... |
PHP | UTF-8 | 339 | 2.78125 | 3 | [] | no_license | <?php
namespace Awuxtron\Web3\Exceptions;
use Exception;
class HexException extends Exception
{
/**
* The exception value.
*/
protected mixed $value;
/**
* Set the exception value.
*/
public function setValue(mixed $value): static
{
$this->value = $value;
ret... |
Java | UTF-8 | 793 | 2.28125 | 2 | [] | no_license |
package de.christopherstock.lib.io.d3ds;
import de.christopherstock.lib.ui.*;
class LibMaxMaterial
{
public String name = null;
public LibColors color = null;
public float offsetU = 0.0f;
public float offsetV ... |
Markdown | UTF-8 | 9,053 | 3.234375 | 3 | [
"CC-BY-4.0"
] | permissive | ---
description: These techniques allow breaking large changes into chunks of smaller changes that don't break the system
last_modified: 2022-01-31T10:44:35.327Z
---
# Branch By Abstraction and application strangulation
## Contents
- [Branch by abstraction](#branch-by-abstraction)
- [Basic idea](#basic-idea)... |
Java | UTF-8 | 513 | 2.265625 | 2 | [] | no_license | package com.opensoft.motanx.proxy.support;
import com.opensoft.motanx.proxy.ProxyFactory;
import com.opensoft.motanx.rpc.Invoker;
/**
* Created by kangwei on 2016/8/28.
*/
public abstract class AbstractProxyFactory implements ProxyFactory {
@Override
public <T> T getProxy(Class<T> cls, Invoker<T> invoker) {... |
Python | UTF-8 | 1,227 | 2.84375 | 3 | [] | no_license | from DataLayer.OpenFile import *
from DataLayer.read_pastFlights import *
from ModelClasses.flightRoute import *
from LogicLayer.Date import *
from ModelClasses.Voyage import*
def voyageStatus(dep, ret, input_date, input_time):
inptDay = str(input_date[0:2])
inptMonth = str(input_date[3:5])
inptYear = str... |
TypeScript | UTF-8 | 3,961 | 2.53125 | 3 | [] | no_license | import {SessionCollection} from "../Collections/SessionCollection";
import {Session} from "../Sessions/Session";
import {SkatingEvent} from "../SkatingEvent";
import {SkatingEventCollection} from "../Collections/SkatingEventCollection";
import {SessionSchedule} from "./SessionSchedule";
import {ScheduledSession} from "... |
Java | UTF-8 | 3,543 | 2.421875 | 2 | [
"BSD-3-Clause"
] | permissive | /*
* Phys2D - a 2D physics engine based on the work of Erin Catto.
*
* This source is provided under the terms of the BSD License.
*
* Copyright (c) 2006, Phys2D
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or
* without modification, are permitted provided tha... |
Python | UTF-8 | 1,218 | 2.859375 | 3 | [] | no_license | from bs4 import BeautifulSoup
import requests
html_text = requests.get('https://www.worldometers.info/world-population/india-population/').text
info = BeautifulSoup(html_text,'lxml')
with open(f'population stats.text','w') as f:
country_name=info.find('div',id='maincounter-wrap').h1.text.split()[0]
f.write(f"... |
SQL | UTF-8 | 2,571 | 3.578125 | 4 | [] | no_license | DROP DATABASE IF EXISTS DB_ANTI_SOCIAL;
CREATE DATABASE DB_ANTI_SOCIAL;
USE DB_ANTI_SOCIAL;
CREATE TABLE TAS_ACCOUNT(
ACCOUNT_ID INTEGER NOT NULL AUTO_INCREMENT,
USER_NAME VARCHAR(64) NOT NULL,
PASSWORD VARCHAR(64) NOT NULL,
DATE_OF_BIRTH DATE NOT NULL,
FIRST_NAME VARCHAR(64) NOT ... |
Java | UTF-8 | 17,005 | 2.09375 | 2 | [
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | /**
* Copyright 2012 Facebook
*
* 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 in ... |
Markdown | UTF-8 | 1,957 | 2.796875 | 3 | [] | no_license | ---
title: Smashed Just Smashed the Lower East Side Burger Game
author: Brendan Doyle
date: 2021-05-08
hero: ./images/SmashedMac.jpeg
excerpt: I had a double cheeseburger lunch times 2, and felt great!
---
Smashed, a hip new Lower East Side burger joint, is dishing out ultra-thin, crispy patties that feel about as true... |
PHP | UTF-8 | 1,911 | 2.546875 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
namespace app\models;
use Yii;
use yii\behaviors\TimestampBehavior;
/**
* This is the model class for table "hs_bet".
*
* @property int $id
* @property int $game_id
* @property int $choosed_option
* @property int $user_id
* @property int $created_at
* @property int $updated_at
* @property int $status
... |
C# | UTF-8 | 823 | 2.515625 | 3 | [] | no_license | using UnityEngine;
using System.Collections;
public class ResourcesManager : Singleton<ResourcesManager>
{
public override void Initialize()
{
}
public override void UnInitialize()
{
}
public Object Load(string path)
{
return Resources.Load(path);
}
public T Load<T>(string path) ... |
Java | UTF-8 | 569 | 3.25 | 3 | [] | no_license | public class LPP{
public LPP(){
System.out.println(init());
}
public int init(){
int num;
int hNum = 0;
String string;
for(int i = 999; i > 0; i--){
for(int x = 999; x > 0; x--){
num = x * i;
if(num < hNum)
break;
string = Integer.toString(num);
for(int r = 0; r <= string.length() ... |
TypeScript | UTF-8 | 610 | 2.65625 | 3 | [] | no_license | import { Md5 } from 'ts-md5/dist/md5';
import { ResetPassword } from './reset-password';
/**
* ResetPasswordAPIRequestData
*/
export class ResetPasswordAPIRequestData {
public r: string; // reset code
public p: string; // password
public p2: string; // confirm password
public static fillResetPasswo... |
C++ | UTF-8 | 990 | 2.65625 | 3 | [] | no_license | #include<cstdio>
#include<algorithm>
#include<queue>
#include<vector>
const int maxn = 1010;
struct Mouse{
int weight,R;
};
int main(){
std::vector<Mouse> mouse;
int np,ng,order;
Mouse node;
scanf("%d %d",&np,&ng);
for(int i = 0;i<np;++i){
scanf("%d",&node.weight);
node.R = 0;
mouse.pu... |
Ruby | UTF-8 | 6,023 | 3.125 | 3 | [] | no_license | require "pry"
class Anfis
SIGMOIDAL_PARAMS = [:a, :b, :c, :d] # precondition params
OUT_PARAMS = [:p, :q, :r] # consequent params
PARAMS = SIGMOIDAL_PARAMS + OUT_PARAMS
attr_reader :errors, :rules
def initialize(num_of_rules) # m rules
@rules = Array.new(num_of_rules) do
{
a: { val: ra... |
Swift | UTF-8 | 5,069 | 2.734375 | 3 | [] | no_license | import UIKit
class ViewController3: UIViewController {
// MARK: - IBOutlet
@IBOutlet weak var ScrollView: UIScrollView!
@IBOutlet weak var ViewInScroll: UIView!
@IBOutlet weak var ImageFoodScroll: UIScrollView!
// Видимый UIView
@IBOutlet weak var ViewUp: UIView!
@IBOutlet weak va... |
JavaScript | UTF-8 | 523 | 2.640625 | 3 | [] | no_license | var url = "https://5d04064fd1471e00149bb174.mockapi.io/api/v1/blogs"
fetch(url)
.then(function(response){
if(response.ok) {
response.json()
.then(
function(data){
var blogWrapper = document.getElementById("demo");
var allPosts = data.map(item => {
... |
Java | UTF-8 | 125 | 1.703125 | 2 | [] | no_license | package com.luoyan.thread;
public interface QueryAction {
public void execute(Context context);
void execute();
}
|
Java | UTF-8 | 15,874 | 1.953125 | 2 | [] | no_license | package nebraska;
import java.awt.Color;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.F... |
C++ | UTF-8 | 2,050 | 2.703125 | 3 | [] | no_license | #include <cstdio>
#include <iostream>
#include <vector>
using namespace std;
struct item
{
int h, t, cnt;
item(int _h, int _t, int _cnt)
{
h = _h;
t = _t;
cnt = _cnt;
}
};
const int MAX_N = 1000, inf = 1000 * 1000 * 1000;
int f[MAX_N][MAX_N], A[MAX_N][2], B[MAX_N][2];
bool used[MAX_N][MAX_N], used1[MAX_N][... |
Java | UTF-8 | 526 | 1.757813 | 2 | [] | no_license | package com.microsoft.identity.common.internal.authorities;
public class AnyOrganizationalAccount
extends AzureActiveDirectoryAudience
{
public AnyOrganizationalAccount()
{
setTenantId("organizations");
}
public AnyOrganizationalAccount(String paramString)
{
setCloudUrl(paramString);
setTena... |
C# | UTF-8 | 9,111 | 3.078125 | 3 | [
"MIT"
] | permissive | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
namespace Nito.UniformResourceIdentifiers.Implementation
{
/// <summary>
/// Provides utility methods for parsing URIs.
/// </summary>
public static class Parser
{
/// <summary>
... |
Python | UTF-8 | 777 | 2.84375 | 3 | [] | no_license | class Solution(object):
def thirdMax(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
if len(nums) < 3:
return max(nums)
m_map = {}
for v in nums:
m_map[v] = m_map.get(v, 0) + 1
if len(m_map.keys()) < 3:
... |
Python | UTF-8 | 181 | 2.9375 | 3 | [] | no_license | screenSize = (900, 700)
print(screenSize[0])
testTuple = ('screen size', ) + screenSize
print(len(testTuple))
print("screen size" in testTuple)
for var in testTuple:
print(var) |
JavaScript | UTF-8 | 2,361 | 3.109375 | 3 | [] | no_license |
let arrayTask3 = [
{
"id": "37ad3865-ccce-48c0-ab78-ec16b5968f58",
"age": 31,
"firstName": "Elise",
"lastName": "Levine",
},
{
"id": "fc78e8af-c560-42bd-8a50-0bb73e241025",
"lastName": "Welch",
"gender": "male",
"email": "williamswelch@kangle.com"... |
SQL | UTF-8 | 2,051 | 2.953125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 08, 2019 at 06:09 AM
-- Server version: 10.3.16-MariaDB
-- PHP Version: 7.3.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @O... |
JavaScript | UTF-8 | 4,152 | 2.5625 | 3 | [] | no_license | var ahn_url = "https://geodata.nationaalgeoregister.nl/ahn2/wms?";
function getAhnFoto(minX, minY, maxX, maxY,size, onSucces) {
var url = ahn_url;
url += "bbox=" + minX + "," + minY + "," + maxX + "," + maxY;
url += "&service=wms";
url += "&VERSION=1.1.1";
url += "&REQUEST=GetMap";
url += "&LAYERS=ahn2_05m_ruw";... |
Markdown | UTF-8 | 3,112 | 2.90625 | 3 | [] | no_license | # Buidler Hackathon Boilerplate
This repository contains a sample project that you can use as the starting point
for your Ethereum project. It's also a great fit for learning the basics of
smart contract development.
This project is intended to be used with the
[Buidler Beginners Tutorial](http://buidler.dev/tutorial... |
Python | UTF-8 | 1,398 | 4.09375 | 4 | [] | no_license | from lib import assertion
def insertion_sort(l):
for i in range(1, len(l)):
current = l[i]
j = i
while j > 0 and current < l[j - 1]:
l[j] = l[j - 1]
j -= 1
l[j] = current
def main():
l1 = [2,5,3,4,1]
l2 = [5,4,3,2,1]
l3 = [1]
l4 = [5... |
C++ | UTF-8 | 561 | 2.9375 | 3 | [] | no_license | /**
* @file test_default_ctor.cpp
*
* Tests bigint default ctor.
*
* @author Michael John Decker, Ph.D. <mdecke@bsgu.edu>
*/
#include <iostream>
#include <cassert>
#include "bigint.hpp"
int main() {
{
// setup
bigint b(4);
bigint a;
// test
a = 4;
// verification
assert(b==a);
... |
Markdown | UTF-8 | 5,962 | 2.59375 | 3 | [] | no_license | 一八三
第十八章 不入虎穴
忆君小心翼翼,很缓慢地靠近这扇大铁门,从外形看来这扇铁门较前一扇更厚更重。表面油漆得光滑无比,在黑暗中发出那淡淡的亮光。
忆君轻轻推了推,竟是纹封未动,他不敢全力以赴,生怕自己的冒失,换来轻易的牺牲,因为他不敢讲,自己人洞以来,对方是否完全未曾发觉。
他再度举起了手往门上按去,掌上内力往外徐增,突然觉出门上冰凉得出奇,立刻猛将手掌撤回,细细一看掌上又没有什么异样。
“嘿!这模样那算得上天下第一奇人玄机子的传人!”忆君陡地豪气大发。气涌丹田,一蓬!蓬厂两掌直往铁门拍去——只闻铁门发出一阵刺耳的倾轧声,突地飞打开来——“叮当!叮当!”
一串铃声随着铁... |
Java | UTF-8 | 3,127 | 2.125 | 2 | [
"Apache-2.0"
] | permissive | package com.clakestudio.pc.everyday.password;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.LayoutInflater;
im... |
Swift | UTF-8 | 1,359 | 2.84375 | 3 | [] | no_license | //
// GameBodyView.swift
// Memorize
//
// Created by Chad Smith on 6/14/21.
//
import SwiftUI
struct GameBodyView: View {
@ObservedObject var game: EmojiMemoryGame
var namespace: Namespace.ID
var body: some View {
AspectVGrid(items: game.cards, aspectRatio: CardConstants.aspectRatio) { ca... |
Java | UTF-8 | 505 | 2.453125 | 2 | [] | no_license | /**
*
*/
package edu.sjsu.library.dto;
/**
* @author balex
*
*/
public class ItemContext {
private ItemState itemState ;
public ItemContext() {
setState(new ItemDelistedState());
}
// normally only called by classes implementing the State interface
public void setState(ItemState... |
JavaScript | UTF-8 | 2,148 | 2.53125 | 3 | [] | no_license | var Event = YAHOO.util.Event;
var Element = YAHOO.util.Element;
var Dom = YAHOO.util.Dom;
function getFormName( form ){
return form.className.split(' ')[0];
}
function useNullForThisField(field){
return Dom.hasClass(field, 'identifier') && field.value == '';
}
function toJSON( obj ){
return YAHOO.lang.JSON.strin... |
C++ | GB18030 | 747 | 3.140625 | 3 | [] | no_license | #include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
char str[25];
void Reverse(char s[])
{
int tail=0;
while(isdigit(s[tail])) tail++;
tail--;
int head=0;
while(s[tail]=='0'&&tail>0) tail--;//ȥ0
while(s[head]=='0'&&tail>0) ++head;//ȥǰ0
for(;tail>=head;--tail)
co... |
Java | UTF-8 | 414 | 2.171875 | 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 jmegame.networking;
/**
*
* @author campbell
*/
public interface IBulletSource {
void fireBullet(int damage);
void ... |
Java | UTF-8 | 1,445 | 2.375 | 2 | [] | no_license | /**
* 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 in writing, software
* dist... |
PHP | UTF-8 | 1,017 | 2.609375 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
namespace app\models;
use Yii;
/**
* This is the model class for table "medchart".
*
* @property string $id
* @property string $date_created
* @property string $date_updated
*/
class Medchart extends \yii\db\ActiveRecord
{
/**
* @inheritdoc
*/
public static function tableName()
{
... |
Markdown | UTF-8 | 3,487 | 3.6875 | 4 | [] | no_license | #### 什么叫柯里化?
> 维基百科:把接收多个参数的函数变换成接收一个单一参数(最初函数的第一个参数)的函数,并返回接受剩余的参数而且返回结果的新函数的技术。其由数学家Haskell Brooks Curry提出,并以curry命名。
> 个人理解:利用闭包,将一个具有多个参数的函数,拆分成多个只有一个参数的函数。
#### 柯里化用途?
1. 参数复用
> 假如一个函数有三个参数,第一个参数比较固定,其余两个参数不固定。可以用柯里化将第一题一个参数的调用当作缓存。
```
function uri(protocol, hostname, pathname){
return `${protocol}${hostna... |
PHP | UTF-8 | 634 | 2.59375 | 3 | [
"MIT"
] | permissive | <?php
namespace Joseki\Form;
use Joseki\Form\Controls\SubmitButton;
use Nextras\Forms\Controls\DatePicker;
class Container extends \Nette\Forms\Container
{
/**
* @param $name
* @param null $caption
* @return SubmitButton|\Nette\Forms\Controls\SubmitButton
*/
public function addSubmit($name, $caption = N... |
Markdown | UTF-8 | 1,000 | 2.53125 | 3 | [] | no_license | ---
layout: event
title: Planning Inspectorate Rainbow Network talks Bristol Pride
excerpt: "Join the Planning Inspectorate's LGBT+ Network for a talk on Bristol
Pride's history and relevance. "
date: 2023-05-22T08:35:58.158Z
event:
host: Planning Inspectorate Rainbow Network
start: 2023-06-15T13:00:58.211Z
en... |
Python | UTF-8 | 4,930 | 2.59375 | 3 | [] | no_license | import re
import os
home = os.path.expanduser("~") + "/"
#TODO get file link from arguments
main_tex_file = "%sDocuments/hiwi/funkeybox/00_documentation/2019-xx_FunkeyBox_Paper/Text/" % home
# RegExp Pattern
input_pattern = "\\input\{(.)*.tex\}"
cite_pattern = "\\cite\{[a-zA-Z0-9, ]*\}"
bibtex_pattern = "\\bibliogr... |
C++ | KOI8-R | 900 | 3.1875 | 3 | [] | no_license | #include<iostream>
#include<stack>
using namespace std;
const int r=10;
struct Pos
{
int X;
int Y;
Pos(int x,int y)
:X(x),
Y(y)
{}
Pos()
:X(0),Y(0)
{}
};
class Maze
{
public:
Maze(char (*maze)[10],int entryX,int entryY)
{
_maze = maze;
_entry.X = entryX;
_entry.Y = entryY;
_col = sizeof(_ma... |
Java | UTF-8 | 695 | 2.234375 | 2 | [
"MIT"
] | permissive | package page.objects;
import driver.manager.DriverManager;
import logger.manager.LoggerManager;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;
public class FishListPage {
//elements on side
@FindBy(css = "a[href='/jpetstore/ac... |
Java | UTF-8 | 704 | 2.265625 | 2 | [] | no_license | package com.example.dell.stripepaymentgateway.service;
import com.example.dell.stripepaymentgateway.Response.GetResponse;
import retrofit2.Response;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;
import rx.Observable;
/**
* The {@link retrofit2.Retrofit} interface th... |
PHP | UTF-8 | 8,091 | 2.78125 | 3 | [] | no_license | <?php
/**
* @group post
*/
class Tests_Post_Objects extends WP_UnitTestCase {
function test_get_post() {
$id = self::factory()->post->create();
$post = get_post( $id );
$this->assertInstanceOf( 'WP_Post', $post );
$this->assertSame( $id, $post->ID );
$this->assertTrue( isset( $post->ancestors ) );
$th... |
Java | UTF-8 | 1,635 | 2.390625 | 2 | [] | no_license | package com.oocl.ita.starkxiao.project2.admin.filter;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.ser... |
Markdown | UTF-8 | 4,035 | 2.875 | 3 | [] | no_license | #### 第三百七十三章 天主诞生玄无上 玄主法钦镇无边
天主归位
玄主归位
欢声雷动………………
而玄主,就是用这片天为基础立道的法成就。
天主就是这片天的主,的功法成就,为天主玄功。
天主身成就时候,注册,时候其他片天里有金身伸出手,挡住不准注册成道则,我一巴掌拍飞,直接护住,立马注册成功,道则诞生,其他片天格子世界里一阵哀嚎……
那个阻挡的,其他天世界金身,被我吞噬金身活吞吃下,消化……
二次考验类似中蛊术,手臂长出那些树苗嫩芽。,不断长,割下来,不断长割下来,有治疗,然后自己嗜血,想吃人,我不愿意,我叫那些人赶紧离开,醒来,考验通过。
晨时候通过考验就是得了这个,天主... |
Java | UTF-8 | 1,160 | 2.0625 | 2 | [
"Apache-2.0"
] | permissive | package com.baiyi.opscloud.event.listener;
import com.baiyi.opscloud.common.event.NoticeEvent;
import com.baiyi.opscloud.event.consumer.EventConsumerFactory;
import com.baiyi.opscloud.event.consumer.IEventConsumer;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationListener;
import org.spr... |
JavaScript | UTF-8 | 1,429 | 3.65625 | 4 | [] | no_license | // from data.js
var tableData = data;
console.log(tableData)
// selected tbody in html
var tbody = d3.select("tbody");
//built function to add data from data file to table
function tableBuild(data) {
//used to clear current data on table
tbody.html("");
//used forEach to itrate through each ro of data
... |
C++ | UTF-8 | 3,805 | 3.359375 | 3 | [] | no_license | // // // // // // // // // // //
//
//
// Dijkstra's algorithm by
// www.cedricve.me
//
//
// // // // // // // // // // //
#ifndef __DIJKSTRA__
#define __DIJKSTRA
#include "ggraaf.h"
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
// connection (struct)
// to keep from node, to node and ... |
C# | UTF-8 | 1,474 | 2.609375 | 3 | [
"MIT"
] | permissive | using NestedWorld.Classes.ElementsGame.Item;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.IO;
using System.Xml.Linq;
using Windows.Storage.Streams;
namespace NestedWorld.Classes.ElementsGame.Shop
{
public class Shop
{
publ... |
Java | UTF-8 | 2,538 | 3.046875 | 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 at.ac.fh_kufstein.uebung_2.Classes;
/**
*
* @author lessi
*/
public class Fahrzeug
{
private short reife... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.