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,104
2.65625
3
[]
no_license
#include "FieldBonus.h" #include "Direction.h" #include "CoordPair.h" #include "Player.h" //------------------------------------------------------------------------------ FieldBonus::FieldBonus(int bonus) : Field('a' - 1 + (char) bonus), bonus_(bonus) { } //----------------------------------------------------------...
Java
UTF-8
404
2.09375
2
[]
no_license
package project.hrms.business.abstracts; import java.util.*; import project.hrms.core.utilities.results.DataResult; import project.hrms.core.utilities.results.Result; import project.hrms.entities.concretes.Skill; public interface SkillService { Result add(Skill skill); Result update(Skill skill); Result dele...
PHP
UTF-8
4,706
2.53125
3
[ "BSD-3-Clause", "MIT" ]
permissive
<?php namespace AppBundle\Repository; use AppBundle\Entity\User; /** * SutartisRepository * * This class was generated by the Doctrine ORM. Add your own custom * repository methods below. */ class SutartisRepository extends \Doctrine\ORM\EntityRepository { public function getYearlySum(User $user = null, \Dat...
C++
UTF-8
5,502
2.578125
3
[ "Apache-2.0", "BSD-3-Clause", "ICU", "Zlib", "GPL-1.0-or-later", "OpenSSL", "ISC", "LicenseRef-scancode-gutenberg-2020", "MIT", "GPL-2.0-only", "CC0-1.0", "BSL-1.0", "LicenseRef-scancode-autoconf-simple-exception", "LicenseRef-scancode-pcre", "Bison-exception-2.2", "LicenseRef-scancode...
permissive
// Copyright 2014 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef V8_UTILS_OSTREAMS_H_ #define V8_UTILS_OSTREAMS_H_ #include <cstddef> #include <cstdio> #include <cstring> #include <ostream> // NOLINT #includ...
Java
UTF-8
1,099
1.609375
2
[]
no_license
import com.tencent.mobileqq.richstatus.ActionInfo; import com.tencent.mobileqq.richstatus.EditActivity; import com.tencent.mobileqq.richstatus.IActionListener; import com.tencent.mobileqq.richstatus.RichStatus; import com.tencent.mobileqq.richstatus.StatusManager; public class ggq implements IActionListener ...
JavaScript
UTF-8
1,453
2.53125
3
[]
no_license
import { cleanEnv, str } from 'envalid'; import Crawler from 'crawler'; /** * @typedef {import('./types.js').ScrapedData} ScrapedData */ /** * @return {Promise<ScrapedData>} */ export default function scrape() { const env = cleanEnv(process.env, { CONTENT_URL: str() }); const crawler = new Crawler(); ...
JavaScript
UTF-8
1,390
4.09375
4
[]
no_license
// Rotate a matrix by 90 degrees // Solution that requires O(N) memory var rotateMatrix = function(matrix) { var newMatrix = []; for (var i = 0; i < matrix.length; i++) { for (var j = 0; j < matrix[i].length; j++) { newMatrix[j] = newMatrix[j] || []; newMatrix[j].unshift(matrix[i][j]); } } return newMatr...
TypeScript
UTF-8
2,820
2.609375
3
[ "Apache-2.0" ]
permissive
import { BrowserTestCase } from '@atlaskit/webdriver-runner/runner'; import { fullpage, quickInsert, hoverResizeHandler } from '../_helpers'; import { clickFirstCell, getSelectorForTableCell, } from '../../__helpers/page-objects/_table'; import { goToEditorTestingWDExample, mountEditor, } from '../../__helpers/...
Java
UTF-8
570
3.4375
3
[]
no_license
import java.util.Scanner; public class CharacterInRange { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); char first= scanner.nextLine().charAt(0); char last = scanner.nextLine().charAt(0); if (first > last) { printSymbol(last, first);...
Markdown
UTF-8
938
3.140625
3
[]
no_license
## Bridge Pattern O Bridge é usado quando precisamos separar uma abstração de sua implementação para que os dois possam variar independentemente. Esse tipo de padrão de projeto vem sob padrão estrutural, pois esse padrão separa a classe de implementação e a classe abstrata, fornecendo uma estrutura de ponte entre ela...
Java
UTF-8
1,460
2.25
2
[]
no_license
package view; import javax.faces.bean.ManagedBean; import javax.faces.bean.SessionScoped; import javax.inject.Inject; import model.BroadBandController; import dto.BroadBandRequestDTO; @ManagedBean @SessionScoped public class BroadBandBean { @Inject BroadBandController controller; private String...
Shell
UTF-8
1,026
3.765625
4
[ "MIT" ]
permissive
#!/bin/sh # installs a Visual Studio Code extension by downloading and unzipping to $HOME/.vscode/extensions/ # requires curl and unzip if [ "$#" -ne 3 ]; then echo "3 parameters required, but given $#" exit 1 fi publisher=$1 extension=$2 version=$3 echo "downloading $publisher.$extension-$version.vsix" statuscode=...
Java
UTF-8
1,480
2.140625
2
[ "Apache-2.0" ]
permissive
package stsc.distributed.hadoop.grid; import java.io.IOException; import java.util.ArrayList; import java.util.List; import org.apache.hadoop.io.LongWritable; import org.apache.hadoop.mapreduce.InputFormat; import org.apache.hadoop.mapreduce.InputSplit; import org.apache.hadoop.mapreduce.JobContext; import org.apache...
Markdown
UTF-8
2,350
2.65625
3
[ "BSD-3-Clause" ]
permissive
SolidusUserGuides ================= Provides a user guide for each page on admin for quick referencing & easier onboarding of admin users. Adding/Editing User Guides -------------------------- The user guide text lives in `Rails.configuration.user_guides`. The entries are contextual, based on controller_name and act...
C++
UTF-8
1,115
3.03125
3
[]
no_license
#include <iostream> int main(){ int int_Top=0; std::cin>>int_Top; for(int int_Line=1;int_Line<=(int_Top+1)/2;int_Line++){ for(int int_Space=((int_Top+1)/2)-int_Line;int_Space>0;int_Space--){ std::cout<<" "; } for(int int_Star=1;int_Star<=(2*int_Line)-1;int_Star+...
Java
UTF-8
847
3.78125
4
[]
no_license
/* * Author: Mark Diez * Date: 21 December 2015 * Ex. 6.27 * finds the greatest common divisor */ import java.util.Scanner; public class GCD { public static void main(String[] args) { Scanner scn = new Scanner(System.in); System.out.print("Enter two integers: "); int dig1 = scn.nextInt...
SQL
UTF-8
836
3.5
4
[]
no_license
CREATE DATABASE todo; CREATE TABLE user(id int auto_increment NOT NULL, username varchar(32) NOT NULL, email varchar(320) NOT NULL, password varchar(255) NOT NULL, PRIMARY KEY(id)) CREATE TABLE tasks(id int auto_increment NOT NULL, title varchar(300) NOT NULL, date_added timestamp, date_due datetime NOT NULL, categor...
Markdown
UTF-8
9,467
3.125
3
[ "Apache-2.0" ]
permissive
--- title: Sign an image description: Learn how to sign the images you push to Docker Trusted Registry. keywords: registry, sign, trust redirect_from: - /ee/dtr/user/manage-images/sign-images/delegate-image-signing/ - /ee/dtr/user/manage-images/sign-images/manage-trusted-repositories/ --- Two key components of the Doc...
Java
UTF-8
12,002
3.09375
3
[]
no_license
package aed.recursion; import java.util.Iterator; import es.upm.aedlib.Position; import es.upm.aedlib.indexedlist.ArrayIndexedList; import es.upm.aedlib.indexedlist.IndexedList; import es.upm.aedlib.positionlist.NodePositionList; import es.upm.aedlib.positionlist.PositionList; public class NumerosRecusion ...
C++
UTF-8
906
3.015625
3
[]
no_license
#include<bits/stdc++.h> using namespace std; string s; struct node{ char data; node *left; node *right; }; typedef node *tree;//k tao node *createNode(char x){ // tao nut node *p=new node; p->data=x; p->left=p->right=NULL; return p; } bool isOP(char x){ if(x=='+'||x=='-'||x=='*'||x=='/'...
Markdown
UTF-8
1,244
2.90625
3
[ "MIT" ]
permissive
#grunt-html-index:创建索引页面 该插件可以快速生成索引页面,方便预览效果。 安装(需先安装grunt):npm install grunt-html-index ###使用方法:在Gruntfile.js中添加配置 grunt.loadNpmTasks('grunt-html-index'); htmlindex:{ dist:{ cwd: 'test/', expand: true, src: ['html/**/*'], ...
Java
UTF-8
247
1.554688
2
[]
no_license
package com.yzxie.easy.log.web.dao.entity; import lombok.Data; /** * @author xieyizun * @date 7/11/2018 18:07 * @description: */ @Data public class UserRole { private Integer id; private Integer userId; private Integer roleId; }
C
UTF-8
252
3.3125
3
[]
no_license
#include <unistd.h> #include <stdio.h> int main(void) { int a; int *ptr; a = 100; ptr = &a; printf("a:\t%i\n", a); printf("&a:\t%p\n", &a); printf("ptr:\t%p\n", ptr); printf("*ptr:\t%i\n", *ptr); printf("&ptr:\t%p\n", &ptr); return (0); }
Python
UTF-8
4,564
2.515625
3
[]
no_license
import re import argparse import sys import csv from nltk.tag import hmm from base_lstm import define_model from data import DataLoader from tester import evaluate_f1 from tester import evaluate_hmm from nltk.probability import * from tester import hmm_sequences # embedding_size, tag_size, input_length, embedding = F...
PHP
UTF-8
673
3.21875
3
[]
no_license
<?php class Session { /** * Affect asked value to asked SuperGlobal $_SESSION * * @param string $key * @param $value * */ public static function put(string $key, $value) { return $_SESSION[$key] = $value; } /** * Return asked SuperGlobal $_SESSION value * * @param string key * */ publi...
Python
UTF-8
211
2.671875
3
[]
no_license
from abc import ABC, abstractmethod class templateRelatorio(ABC): def relatorio(self, dados): print(self.geraRelatorio(dados)) @abstractmethod def geraRelatorio(self, dados): pass
Java
UTF-8
169
1.828125
2
[]
no_license
package com.jbrisbin.riak.pbc; import com.google.protobuf.Message; /** * @author Jon Brisbin <jon@jbrisbin.com> */ public interface Buildable<T extends Message> { T build(); }
Java
UTF-8
13,901
1.929688
2
[]
no_license
package com.redsqirl.workflow.server.connect.hcat; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.rmi.RemoteException; import java.util.Arrays; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java....
Shell
UTF-8
434
3.5625
4
[]
no_license
#!/bin/bash station=$1 timeout=$2 suffix=$(date +%Y-%m-%d+%a) outfile="$3.$suffix.aac" echo "$(date) Called with arguments $station for station, $timeout for timeout in seconds, and output file \"$outfile\"" url=$(cat "/opt/radio/sources/$station") echo "$(date) The URL being targeted is $url" echo "$(date) Starting r...
Java
UTF-8
2,714
2.421875
2
[]
no_license
package cn.eli486.controller; import cn.eli486.config.ScheduledConfig; import cn.eli486.dao.CustomerDao; import cn.eli486.entity.Customer; import cn.eli486.task.DailyTask; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Mode...
Markdown
UTF-8
1,203
4.1875
4
[]
no_license
Python中提供了**Enum**来实现枚举: ```py from enum import Enum Week = Enum('Week',('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturdat')) ``` 这样就定义了**Week**类型的枚举类,可以直接使`Week.Sunday`来引用一个常量,或者使用for...in枚举出所有成员: ```py for name, member in Week.__members__.items(): print(name, ':', member, ',', member.v...
PHP
UTF-8
3,222
2.578125
3
[ "MIT" ]
permissive
<?php namespace Florin\MyApp\Controllers; use Florin\MyApp\Models; use ZenoFramework\Controllers\DummyController; use ZenoFramework\Views\BaseView; use ZenoFramework\Views\PNGView; use ZenoFramework\Adapters\InclusionMode; class UsersController extends DummyController { public function __construct() { ...
C++
UTF-8
2,508
3.78125
4
[]
no_license
// 4.5 Implement a function to check if a binary tree is a binary search tree. #include <iostream> #include <vector> #include <queue> #include <climits> using namespace std; class node { public: char value; node *left; node *right; public: node(char v); }; static vector<node *> gc; // garbage collector nod...
Java
UTF-8
351
2.296875
2
[]
no_license
package me.williamhester.reddit.models.imgur; /** * Created by william on 6/21/14. */ public class ImgurResponseWrapper<T> { private T data; private boolean success; private int status; public boolean isSuccess() { return success; } public T getData() { return data; } public int getStatus...
Java
UTF-8
360
1.734375
2
[ "MIT" ]
permissive
package pl.edu.pwr.student.satellitemanager; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class SatellitemanagerApplication { public static void main(String[] args) { SpringApplication.run(Satellitema...
Java
UTF-8
1,652
2.03125
2
[]
no_license
package qa.automation.mobile.definition.components.itemTransfer; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import cucumber.api.Scenario; import cucumber.api.java.After; import cucumber.api.java.Before; import cucumber.api.java.en.Then; import qa.automation.mobile.flow.Bas...
C
UTF-8
8,657
2.78125
3
[]
no_license
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <Windows.h> /* Ryan Whyte (1800715) Daniel Wright (1806169) Marvin Arnett (1701403) Operating System Group Programming Project */ FILE *fptr; int main() { storeRec(); int i=0, n=5, r, value; int P...
Swift
UTF-8
6,634
2.921875
3
[]
no_license
// // TextViewController.swift // DetectWord // // Created by Confident Macbook on 2021/2/20. // import UIKit import SwiftUI struct TextWrapper: UIViewControllerRepresentable { func makeUIViewController(context: Context) -> some UIViewController { let viewController = TextViewController() return...
Rust
UTF-8
682
2.59375
3
[]
no_license
use std::fmt::{Display, Formatter, Result as FmtResult}; use serde_json::{json, to_string_pretty}; use std::io; use serde::{Deserialize, Serialize}; /// USER--Generic Json SUCCESS RESPONSE #[derive(Debug, Serialize)] pub struct GenericJsonSuccessResponse<T> { pub custom_status: String, pub message: String, p...
Markdown
UTF-8
3,266
2.609375
3
[ "MIT" ]
permissive
--- layout: post title: 做一个小程序 date: 2020-04-19 12:00:00 +0800 categories: 拙作 tag: --- * content {:toc} 迫于浙江工业大学的`容大后勤服务`仅提供了宿舍剩余电量查询,却没有余额过低时主动提醒的功能,就整了个小程序方便一下。 ## 先放图 ![小程序码]({{ '/styles/images/zjutMpTool/qrCode.png' | prepend: site.baseurl }}) ![宿舍低电提醒]({{ '/styles/images/zjutMpTool/watchEl.jpg' | prepend...
C++
UTF-8
623
2.734375
3
[ "Apache-2.0" ]
permissive
//Compute points and weights for normal scores quadrature of given order. //Order is n. #include<armadillo> #define STATS_ENABLE_ARMA_WRAPPERS #include "stats.hpp" using namespace arma; struct pw { vec points; vec weights; }; pw qnormpw(const int & n) { double x,xn; int i; pw pws; pws.points.set...
C
UTF-8
953
2.84375
3
[ "Apache-2.0" ]
permissive
/* * Arquivo : signals.c * Contém a implementacao de signals.h. * * Esse arquivo faz parte de uma implementacao basica de um SHELL Unix, parte dos * dos trabalhos de disciplina de Sistemas Operacionais II (SSC 0141) * * Autores: * Ubiratan Soares * Ulisses Soares * Vinicius Grippa * * Data : 16/12/2009 ...
TypeScript
UTF-8
10,698
2.8125
3
[ "MIT" ]
permissive
import {Client, MessageEmbed} from 'discord.js'; import {CommandInfo} from '../commands/help'; import {Event} from '../cache/conversation-manager'; const pads = (s: number): string => { return s < 10 ? `0${s}` : `${s}`; }; const gold = '#FFD700'; export default class MessageDecorator { public static fieldsEmoji ...
Python
UTF-8
1,083
3.8125
4
[]
no_license
from homework1.task2.fibonacci.task02 import check_fibonacci def test_complete_sequence(): """Tests if true sequence starting from [0, 1, 1, ... ] passes the check""" test_data = [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] assert check_fibonacci(test_data) def test_sequence_fragment(): """Tests if tru...
C++
UTF-8
656
2.609375
3
[]
no_license
#ifndef FINAL_DMG_LCD_CONTROLLER_H__ #define FINAL_DMG_LCD_CONTROLLER_H__ #include <cstdint> #include "bus/BusDevice.h" namespace FinalDMG { class LcdController : public BusDevice { public: enum Mode { LCD_MODE_0, LCD_MODE_1, LCD_MODE_2, LCD_MODE_3 }; LcdController() : m_slee...
Markdown
UTF-8
884
3.703125
4
[]
no_license
## 110. Balanced Binary Tree ### Solution ```Python # Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right class Solution: def isBalanced(self, root: TreeNode) -> bool: i...
JavaScript
UTF-8
2,053
2.765625
3
[]
no_license
import { tippel, rosszTippek, getAllapot } from "./allapot.js"; // Elemek const szoDiv = document.querySelector('#szo') const betukDiv = document.querySelector('#betuk') const szamDiv = document.querySelector('#eredmeny') const svg = document.querySelector('svg') function genSzo() { const { szo, tippek, allapot }...
Shell
UTF-8
459
2.625
3
[]
no_license
#!/bin/bash JOBID=jobtest POOLID=ilastik az batch job create --id $JOBID --pool-id $POOLID --account-endpoint https://ilastikb.westeurope.batch.azure.com --account-name ilastikb # for k in {1..2} do echo "starting task_$k ..." az batch task create --job-id $JOBID --task-id "task_$k" --command-line "/mnt/...
Python
UTF-8
864
4.65625
5
[]
no_license
# Floating point numbers # Format: %n1.n2f , where # n1 = total minimum number of digits the string should contain # n2 = how many digits to show past the decimal point print "Num: %1.2f" %(13.114) print "Num: %1.0f" %(13.114) print "Num: %1.5f" %(13.114) print "Num: %10.2f" %(13.114) print "Num: %25.2f" %(13.114) # ...
Java
UTF-8
4,527
3.28125
3
[]
no_license
package cesure.trash; import cesure.network.training.NetworkAndError; import cesure.network.CesureMusic; class GeneticAnnealing { private static class FamilyCreator extends Thread { private final NetworkAndError parent; private final int generations; private final CesureMusi...
TypeScript
UTF-8
686
3.40625
3
[]
no_license
export interface IngredientJson { name: string; amount: number; unit: string; } export class Ingredient { constructor( private _name: string, private _amount: number, private _unit: string ) {} static fromJSON(json: IngredientJson): Ingredient { const amount = typeof json.amount === '...
C#
UTF-8
8,984
2.6875
3
[]
no_license
using Microsoft.Xaml.Behaviors; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Input; // 参考 // http://yujiro15.net/blog/index.php?id=151 namespace TextConvert { ///...
Markdown
UTF-8
4,902
3.109375
3
[]
no_license
--- title: Kryptonøtt author: Arve Seljebu translator: Stein Olav Romslo language: nn --- # Introduksjon {.intro} Kryptering har vore i bruk i kommunikasjon lenge. Faktisk brukte dei det for nesten 4000 år sidan! I tillegg er det artig å sende hemmelege meldingar. Før du startar på denne oppgåva anbefalar me at du h...
Python
UTF-8
4,315
2.578125
3
[]
no_license
import TicTacToeRL as ttt import ExpBuffer import QNet import numpy as np import tensorflow as tf import tensorflow.contrib.slim as slim import os import matplotlib.pyplot as plt #Update Target Netw with primary values def updateTargetGraph(tfVars, tau): totalVars = len(tfVars) opHolder = [] for idx,var i...
Java
UTF-8
1,160
3.703125
4
[]
no_license
package com.sepi.testclasses; /** * @author Ananth-SePi * Class to print the maximum delivery possible with the given 'k' resource. * order is the list of items to be delivered. * k is the items available. * @created on 02/06/2020 */ import java.util.ArrayList; import java.util.Comparator; import java.util.List...
C#
UTF-8
561
3.375
3
[]
no_license
using System; namespace QuickSharp { public class Tabla{ private int n; public Tabla(int n){ this.n = n; } public void mostarTb(){ for(int i= 0 ;i<11;i++){ int r = n*i; Console.WriteLine(i+"*"+n+" = "+r); } ...
Java
UTF-8
7,388
2.125
2
[]
no_license
package com.newvery.web.action; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.PrintWriter; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Random; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; impo...
JavaScript
UTF-8
1,325
3.015625
3
[]
no_license
'use strict'; module.exports = { linkage: { average: function (source, target) { return ( (source.linkage * source.count) + (target.linkage * target.count) ) / (source.count + target.count); }, single: function (source, target) { if (source.linkage < target.linkage) { ...
Markdown
UTF-8
2,185
3.015625
3
[]
no_license
+++ title = "Tree-like Shapes Distance Using the Elastic Shape Analysis Framework" summary = "" highlight = true external_link = "" image = "" date = "2013-01-27T10:32:37+01:00" tags = ["applied_math"] math = false image_preview = "tree_shapes_prev.jpg" +++ <p style='text-align: justify;'> The analysis and comparison ...
C#
UTF-8
900
2.640625
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace PureGame { public class DamageData { private string damageMakerName; private string damagedPlayerName; private int damage; private BaseWeapo...
C++
UTF-8
8,782
2.59375
3
[]
no_license
#ifdef AVR #include <arduino.h> #endif #include <stdio.h> #include "tutils.h" #include "tparser.h" #include "tobject.h" TObject *parse_value(char **code); char char_escape(const char ch) { switch(ch) { case 't': return TAB; break; case 'n': return LF; break; case 'r': return CR; break; ...
Python
UTF-8
1,522
2.578125
3
[]
no_license
from add_cust import add, a from update import update_stat, c from viewplans import viewplans, d from planewise import plan_wise, e import pyodbc as mc cnx = mc.connect("Driver={SQL Server};" "Server=DESKTOP-SFPRKLP\SQLEXPRESS;" "Database=postpaid;" ) cur = cnx.cursor(...
PHP
UTF-8
1,437
2.78125
3
[]
no_license
<?php class Controller { private $controller; private $action; private $view; protected $viewdata; public function __construct() { $this->viewdata = new ViewData(); } public function __set($name, $value) { $allowedSetters = ['controller', 'action', 'view']; if(!in_array($name, $allowedSetters)) { ...
Python
UTF-8
1,418
4.5
4
[]
no_license
""" 参考:https://www.runoob.com/python3/python3-function.html Python 函数装饰器(Decorators) : '@' 用做函数的修饰符,一个修饰符就是一个函数,它将被修饰的函数作为参数,并返回修饰后的同名函数或其他可调用的东西; python装饰器本质上就是一个函数,它可以让其他函数在不需要做任何代码变动的前提下增加额外的功能,装饰器的返回值也是一个函数对象(函数的指针) 参考: https://www.cnblogs.com/wangjian1226/p/10531702.html https://www.cnblogs.com/xiaojianliu/articl...
Java
UTF-8
6,836
4.21875
4
[]
no_license
package _2_LanguageBasic.ControlFlowStatem; /** * Оператор break имеет две формы: помеченный и немаркированный. * Можно использовать break без метки для завершения цикла * for, while или do-while, как показано в следующей программе: */ public class BranchingStatements { } class BreakDemo { public static void ...
Python
UTF-8
19,694
2.8125
3
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
permissive
import abc from typing import List from typing import Tuple from typing import Union import numpy as np import tensorflow as tf from ...tensor.factory import AbstractConstant from ...tensor.factory import AbstractTensor from ...tensor.factory import AbstractVariable from ..protocol import TFEPrivateTensor from ..prot...
C++
UTF-8
2,574
2.515625
3
[ "MIT" ]
permissive
/********************************************* File Name: IMRegisterWidget.h Author: jet.F.R Date: 2014.3.14 Description: 客户端注册界面 Changes: ********************************************/ #ifndef IMREGISTERWIDGET_H #define IMREGISTERWIDGET_H #include <QWidget> #include "model/IMConstant.h" class QPushButton; class QLabel...
Markdown
UTF-8
3,387
3.015625
3
[ "MIT" ]
permissive
--- layout: project type: project image: images/ghg.png title: GHG Tracker permalink: projects/project5 # All dates must be YYYY-MM-DD format! date: 2021-05-11 labels: - Group Project - Meteor - Javascript - Agile Project Management summary: A web application designed for Hawaiian Electectric Industries to help...
Java
UTF-8
1,463
2.859375
3
[]
no_license
import org.json.simple.JSONObject; import org.json.simple.parser.JSONParser; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import parsers.Employee; import java.util.ArrayList; import java.util.List; public class Parser_JUnitTest { private final String inputTestFileName = "output_data...
PHP
UTF-8
1,255
2.546875
3
[]
no_license
<?php if(isset($_POST['submit']) && !empty($_POST['submit'])) { try { updateProjectCategory($_GET['idEditProjectCategory'], $_POST['title'], $_POST['longCategoryLabel']); } catch(Exception $e) { echo 'Message: ' .$e->getMessage(); } header('Location:...
TypeScript
UTF-8
1,662
2.578125
3
[]
no_license
import { Component, OnInit } from '@angular/core'; import { AuthenticationsService } from '../authentications.service'; import { UsersService } from '../users.service'; import { Router } from '@angular/router'; @Component({ selector: 'app-register', templateUrl: './register.component.html', styleUrls: ['./regi...
Java
UTF-8
1,687
2.390625
2
[ "Apache-2.0" ]
permissive
package com.yaconfig.core; import java.lang.reflect.Field; import java.lang.reflect.Method; import com.yaconfig.core.annotation.Anchor; import com.yaconfig.core.annotation.SetValue; import com.yaconfig.core.annotation.Use; import net.sf.cglib.proxy.MethodInterceptor; import net.sf.cglib.proxy.MethodProxy; public cl...
JavaScript
UTF-8
9,312
2.796875
3
[]
no_license
let id = ["box1", "box2", "box3", "box4", "box5", "box6", "box7", "box8", "box9", "box10", "box11", "box12", "box13", "box14", "box15", "box16", "box17", "box18", "box19", "box20", "box21", "box22", "box23", "box24", "box25"]; let classname = ["green", "green", "green", "green", "blue", "blue", "blue", "blue", "orange...
Markdown
UTF-8
902
2.921875
3
[]
no_license
--- title: 文字版猜词语 date: 2019-01-16 19:19:40 tags: [妄想] categories: 想法 --- #### 介绍 在元旦的时候和朋友玩了一下,做动作猜词语的游戏。游戏很简单,就是出一个词语让第一个人做动作,然后第二个人跟着做...一直到最后一个人猜这个词语是什么。我就想可不可以只是文字然后传递的游戏,这样不就可以做到线上玩猜词语的游戏了。 #### 思路 我是这样想的,线上的话,动作肯定是控制不了的了。那么就在文字上做手脚,首先出一个两个字词语,然后第二个人根据这两个字找出相近的四字的词语(一段话,成语都可以),然后第三个就6个字,就这样一直到最后一个人猜一开始的词语是什么。当然...
C
UTF-8
3,996
2.53125
3
[]
no_license
// // Packet_Wrappers.h // CSCI311 Project // // Created by Daniel Watt on 5/04/2015. // Copyright (c) 2015 Daniel Watt. All rights reserved. // #ifndef __CSCI311_Project__Packets__ #define __CSCI311_Project__Packets__ #include <stdio.h> //Several Types of Packets are needed to differentiate between requests and ...
C#
UTF-8
548
3.3125
3
[]
no_license
using System; using System.Collections.Generic; using System.Text; namespace Test11 { class Program { static void Main(string[] args) { int F1 = 18; //声明整型变量F1 int F2 = 8; //声明整型变量F2 bool result; //声明bool型变量result //使r...
Java
UTF-8
854
2.046875
2
[]
no_license
package cn.framework.core.event; import cn.framework.core.container.Context; import cn.framework.core.container.InitProvider; import com.google.common.eventbus.AsyncEventBus; import com.google.common.eventbus.EventBus; import org.springframework.stereotype.Service; import java.util.concurrent.Executors; import java.u...
Python
UTF-8
28,061
3.234375
3
[]
no_license
# -*- coding: utf-8 -*- """ Created on Sat Sep 30 09:44:43 2017 @author: James """ def NN_Deep_Doc(): """ Implements a fully-connected Deep Neural network. NOTE: Generally, the use of Adam Optimization and Mini-Batches requires smaller learning rate..... Incorporates L2...
Java
UTF-8
560
2.875
3
[]
no_license
import java.awt.Rectangle; public class Plank { int x = 0; //initial position x int y = 0; //initial pisition y int width; int height; int xSpeed = 0; int ySpeed =0; public Coordinates getCoordinates() { // TODO Auto-generated method stub return null; } public void i...
PHP
UTF-8
10,583
2.65625
3
[]
no_license
<?php //проверка на спам if(!empty($_POST['name'])) { //неудачная проверка на спам } else { //удачная проверка на спам if ($_SERVER["REQUEST_METHOD"] == "POST") { //техническое задание //$url = '<br><br>'.$_SERVER['HTTP_REFERER'].''; $date = date('d.m.Y G:i:s').'<br>'; if (!empty($_POST['tid'])) {$tid = ...
C++
UTF-8
1,137
2.65625
3
[ "FTL", "MIT", "LicenseRef-scancode-warranty-disclaimer", "Zlib", "LicenseRef-scancode-unknown-license-reference", "curl", "Libpng" ]
permissive
#include <Bibim/Config.h> #if (defined(BIBIM_PLATFORM_UNIX)) #include <Bibim/Thread.Unix.h> #include <unistd.h> namespace Bibim { // bool Thread::IsInitialized = false; struct Thread::Internal { static void* Procedure(void* parameters) { static_cast<Thread*>(parame...
JavaScript
UTF-8
664
4.15625
4
[ "MIT" ]
permissive
// let li = function lichee(){ // console.log("this is lichee"); // }() // // li() // // lichee() // // + - ~ ! void // void function haw(){ // console.log("this is haw"); // }() // ! 表否定,h2不是一个函数,void不返回值 // let h2=!function(){ // console.log("this is h2"); // return 0; // // }() // // h2() // co...
C
UTF-8
1,265
3.28125
3
[]
no_license
#include <sys/types.h> #include <stdio.h> #include <sys/wait.h> #include <unistd.h> #include <string.h> #include <stdlib.h> #include <errno.h> int main(){ int pid; int child_pid; int status; int ret; pid=fork(); switch(pid){ case -1://fork fail ...
C
UTF-8
9,490
3.578125
4
[]
no_license
/*Elias Tandel Barrionovo 1010270 3WA*/ /*João Pedro Fabris Campos 1010273 3WA*/ #include "utft.h" #include <stdio.h> #include <string.h> // macros for errors; though EOF is system dependent, // it is defined as negative, so all errors are < 0. #define ERR_READ EOF-1 // probably -2 #define ERR_WRITE EOF-2 // probab...
Python
UTF-8
2,011
2.53125
3
[]
no_license
import re import os #废弃,并没有使用 data_dir = r'./lin_txt_annotated' write_file = r'./result.txt' error_file = r'./error.txt' ref_pattern = '@+(?:R|r)eferences(.*?)$' def divide_ref(text,pre_list): word_list = re.split(r'\s+',text) ready_info ='' temp_list = [] word_flag = False spilt_flag = False ...
JavaScript
UTF-8
936
2.96875
3
[]
no_license
function GameView(game, ctx) { this.game = game; this.ctx = ctx; } GameView.DIRS = { w: [0, -1], a: [-1, 0], s: [0, 1], d: [1, 0] }; GameView.prototype.start = function() { this.bindKeyHandlers(); this.lastTime = Date.now(); requestAnimationFrame(() => { this.animate.call(this, Date.now()); }...
Python
UTF-8
829
2.890625
3
[]
no_license
import numpy as np A2 = np.array([[0.5, 0.1, 0.4], [0.3, 0.5, 0.2], [0.2, 0.2, 0.6]]) B2 = np.array([[0.5, 0.5], [0.4, 0.6], [0.7, 0.3]]) pi2 = np.array([0.2, 0.3, 0.5]) Object2 = np.array([0, 1, 0, 0, 1, 0, 1, 1]) alpha = np.zeros((8,3 )) alpha[0] = np.array(pi2) * B2[:, 0 ] for i in rang...
Python
UTF-8
4,442
3.5
4
[]
no_license
#Andrew Lang import numpy as np # -1 is a no spam email and 1 is a spam email #converts the strings within the files into integer arrays, one for their label, one for their feature vector def convertDataSet(dataset): #pass it the file that you wish to read values from stringTraining = [] with open(d...
TypeScript
UTF-8
1,842
2.609375
3
[ "Apache-2.0" ]
permissive
import * as assert from "assert"; import * as builder from "../../src/builders/nugetPushArgBuilder"; describe("push Argument Builder", () => { it("should return an empty array if nothing is passed in", () => { assert.deepEqual(builder.default(null as any), []); }); it("should return an empty array if ...
PHP
UTF-8
3,894
2.515625
3
[]
no_license
<?php App::uses('ShopAppModel', 'Shop.Model'); /** * Property Model * * @property ProductMeta $ProductMeta * @property PropertyValue $PropertyValue */ class Property extends ShopAppModel { private $__existPropertyValuesIds = array(); //The Associations below have been created with all possible keys, those t...
C++
UTF-8
1,624
3.75
4
[]
no_license
#include <bits/stdc++.h> using namespace std; /* Teacher.h */ class Teacher { private: string name; int age; public: Teacher(string name = "", int age = 0); ~Teacher(); friend ostream &operator<<(ostream &out, const Teacher &t); }; /* Teacher.cpp */ Teacher::Teacher(string name, int age) : name(...
C++
UTF-8
1,083
2.796875
3
[]
no_license
#ifndef CONTROL_OBJETIVOS_H #define CONTROL_OBJETIVOS_H #include <map> /*El control de objetivos guarda las cantidades de bonus totales y pendientes.*/ class Control_objetivos { /**************** Definiciones ****************/ public: enum tipos {T_TESORO, T_COFRE, /*T_LLAVE,*/ T_MAX}; enum mensajes {M_LLAVE...
Markdown
UTF-8
7,403
2.609375
3
[]
no_license
--- published: true organization_id: '2016133' year_submitted: 2019 category: play body_class: strawberry project_id: '9102072' challenge_url: 'https://challenge.la2050.org/2019/play/los-angeles-audubon-society/' title: LA Audubon Urban Nature Network project_summary: >- Urban Nature Network will connect students, fa...
PHP
UTF-8
892
2.78125
3
[]
no_license
<?php $server="localhost"; $username='root'; $password=''; $database='blueprint1'; $db=mysqli_connect("$server","$username","$password"); mysqli_select_db($db,$database); $get_the=mysqli_query($db,"CALL test()"); $fist=$second=$third=array(); while($fetch=mysqli_fetch_assoc($get_the)){ $fist[]=$fetch[...
Java
UTF-8
1,133
1.9375
2
[]
no_license
package com.example.ppbprojectakhir; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.fragment.app.DialogFragment; public class ...
Markdown
UTF-8
1,688
2.75
3
[]
no_license
# Read   Shanghai: Car rentals(租赁) are becoming increasingly popular as an inexpensive way of taking to the roads. Business people, foreigners and families alike are taking advantage of the growing industry.   The first car rental firm opened in Shanghai in 1992 and now 12 car rental players are in the game, with more...
Java
UTF-8
264
3.140625
3
[]
no_license
public class G { static int doStuff(int i) { i++;// 6 try { i++;//7 return i++;// 8 } catch (Exception e) { i++; } finally { return i++;//9 } } public static void main(String[] args) { int r = doStuff(6); System.out.println(r); } }
Python
UTF-8
761
2.875
3
[ "MIT" ]
permissive
# Functions to call in intermediate code from .executeShow import executeShowDatabases import os, json class IntermediateFunctions: memory = [] def showDatabases(self): executeShowDatabases(self.memory[0]) self.memory.pop(0) def writeMemory(self, item): IntermediateFunctions.mem...
Markdown
UTF-8
3,774
3.046875
3
[]
no_license
--- title: "Writing a simple file monitor in Java using Commons IO" date: "2012-06-30" excerpt: "Monitor file changes using Commons IO" classes: wide categories: - "java" tags: - "apache" - "commons" - "commons-io" - "commonsio" - "file" - "filealterationlistener" - "filealterationlisteneradaptor" -...
C++
UTF-8
1,685
3.375
3
[ "MIT" ]
permissive
/* 解决方法: 动态规范方法 + 时间记忆法 动态规划状态转移法 1. 建立状态转移方程 2. 缓存并存储以往结果 3. 按照顺序往后(大)计算 分析:(1) (2) [P] a b * c a b * c a b * c [S] a c a b b c a b c 状态表示 f[i][j] 便是 p(j ...) , s(i, ...) p 从j位置开始 去匹配s 从i 开始 状态转移 如果p[j] 是正常字符 f[i][j] = p[j] == s[i] && f[i + 1][j + 1] 如...