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
6,721
2.9375
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Drawing; namespace 魔王的试炼 { /// <summary> /// 可携带道具类,为背包类提供数据单元 /// </summary> abstract class Property { /// <summary> /// 以道具名称创建道具的实例 /// </summary> /// <param name="...
Python
UTF-8
1,451
3.3125
3
[]
no_license
#!/usr/bin/env python """ _Counter_ Conditional with a Maximum Counter. When the conditional is run, it compares a counter parameter in the ControlPoint to a maximum value stored in the conditional attributes """ from ShREEK.ControlPoints.Conditional import Conditional import ShREEK.ControlPoints.ControlPointFactory...
Java
UTF-8
7,402
2
2
[]
no_license
package com.ultrapower.baozouqiwen.adapter; import java.util.ArrayList; import java.util.List; import org.json.JSONObject; import com.android.volley.RequestQueue; import com.android.volley.Response.ErrorListener; import com.android.volley.Response.Listener; import com.android.volley.VolleyError; import com.android.v...
Java
UTF-8
720
2.78125
3
[]
no_license
package items; import java.util.ArrayList; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.Sprite; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import logicClasses.Item; public class LitCandle extends Item { String itemName = "litcandle"; ...
Python
UTF-8
1,670
2.90625
3
[ "MIT" ]
permissive
import numpy as np import neighbourlist import system import numba as nb @nb.jit(nopython = True) def LJ_potential_ij(r, sigmaii, epsilonii, sigmajj, epsilonjj, r_c, r_s): sigmaij = 0.5 * (sigmaii + sigmajj) # Lorentz-Berthelot: https://en.wikipedia.org/wiki/Combining_rules epsilonij = np.sqrt(epsilonii *...
Java
UTF-8
1,358
2.390625
2
[]
no_license
package Module.Team; import Module.FilterEntity; import Module.User.UserModel; import javax.persistence.Entity; import javax.persistence.Table; import javax.persistence.criteria.CriteriaBuilder; import javax.persistence.criteria.CriteriaQuery; import javax.persistence.criteria.Predicate; import javax.persistence.crit...
Python
UTF-8
19,964
2.859375
3
[ "MIT" ]
permissive
# -*- mode: python; coding: utf-8 -*- # Copyright 2017-2018 Peter Williams and collaborators. # Licensed under the MIT License. """Train and use artificial neural network approximations ("regressions") of synchrotron radiative transfer coefficients as a function of various physical input parameters. The meat of the n...
Markdown
UTF-8
6,610
2.953125
3
[]
no_license
Dreckig OS development has halted. It has been reincarnated as <a href="https://github.com/WizardOfHaas/d264b">d264b</a> in glorious 64 bit! If anyone wants to take the reigns and go down the road Dreckig OS was on let me know and I'll set you up. <pre> ________________________ =====|Dreckig OS User Manual|== ...
Shell
UTF-8
983
3.359375
3
[]
no_license
#!/usr/bin/bash #set -e # keep track of the last executed command #trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG # echo an error message before exiting #trap 'echo "\"${last_command}\" command failed with exit code $?." >&2' EXIT bin_dir="/local/datasets" inputFile=$1 outputDir=$2 DATABAS...
C++
UTF-8
6,585
3.1875
3
[]
no_license
#include <gtest/gtest.h> #include <iostream> #include "utils.h" #include "command_buffer.h" TEST(CommandBuffer, Simple) { std::ostringstream result; CommandBuffer buf(3, [&result](const Bulk& bulk) { result << bulk << "\n"; }); for (int i = 0; i < 3; i++) buf.pushCommand("1"); ASSERT_EQ(buf....
C
UTF-8
842
3.21875
3
[]
no_license
/*Yansen Sheng*/ #include <stdio.h> int main() { char *h="Hello"; char *g="Goodbye"; char *c[]={ "/*Yansen Sheng*/%c", "#include <stdio.h>%c", "int main() {%c", " char *h=%cHello%c;%c", " char *g=%cGoodbye%c;%c", " char *c[]={%c", " %c%s%c%c%c", " };%c", " puts(h);%c", " for(int i=0;i<6...
JavaScript
UTF-8
1,049
2.734375
3
[ "MIT" ]
permissive
$(document).ready(function() { $("#formOne").submit(function(event) { var blanks = ["animal", "food", "number", "adjective", "nounplural", "noun", "partofbody"]; blanks.forEach(function(blank) { var userInput = $("input#" + blank).val(); $("." + blank).text(userInput); }); // Old code fr...
C#
UTF-8
1,458
2.6875
3
[]
no_license
using AlienCompadre_DAL.Connection; using AlienCompadre_Entities; using System.Data; using System.Data.SqlClient; namespace AlienCompadre_DAL.Handler { public class ClsHandlerDAL { /// <summary> /// Inserta las estadisticas de la partida en la base de datos. /// </summary> /// <param ...
Python
UTF-8
443
2.734375
3
[]
no_license
import requests # cookies # requests.get("http://httpbin.org/cookies/set/number/123456789") # r = requests.get("http://httpbin.org/cookies") # print(r.text) #session s = requests.session() s.get("http://httpbin.org/cookies/set/number/123456789") r = s.get("http://httpbin.org/cookies") print(r.text) # 利用session可以做到模拟...
Python
UTF-8
321
3.234375
3
[]
no_license
class Ex(Exception): pass def foo(): print("foo") raise RuntimeError try: foo() except Ex: print("Exception detected") except ZeroDivisionError: print("durch 0 geteilt, welt explodiert") except RuntimeError as er: print("RuntimeError", er) else: print("keine exception") print("weiter"...
Rust
UTF-8
882
3.515625
4
[]
no_license
extern crate tap; use tap::*; #[test] fn filter_map() { let values: &[Result<i32, &str>] = &[Ok(3), Err("foo"), Err("bar"), Ok(8)]; let _ = values.iter().filter_map(|result| { // It is especially useful in filter maps, allowing error information to // be logged/printed before the information i...
Java
UTF-8
774
3.46875
3
[]
no_license
class myNewThread implements Runnable{ Thread t; public void run(){ try{ for(int m = 0; m < 5 ; m++){ System.out.println("Child Thread: " + m); Thread.sleep(1000); //t.join(); } }catch(Exception e){ e.printStackTrace(); } System.out.println("Exiting Child Thread"); } } pub...
Python
UTF-8
711
3.734375
4
[]
no_license
""" http://rosalind.info/problems/tree/ Given: A positive integer n (n≤1000) and an adjacency list corresponding to a graph on n nodes that contains no cycles. Return: The minimum number of edges that can be added to the graph to produce a tree. >>> problem(10, [(1, 2), (2, 8), (4, 10), (5, 9), (6, 10), (7, 9)]) 3 "...
Java
UTF-8
2,206
2.140625
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 br.solutio.licita.filtros; import java.io.IOException; import java.util.logging.Level; import java.util.logging.Logge...
Java
UTF-8
1,110
2.53125
3
[]
no_license
package simplehl7.model; import java.util.ArrayList; import java.util.List; import java.util.regex.Pattern; import org.apache.commons.lang3.StringUtils; import simplehl7.parser.HL7Parser; public class HL7Component { private final List<String> subComponents = new ArrayList<String>(); private final HL7MessageConfi...
Python
UTF-8
1,090
2.671875
3
[]
no_license
import csv from bs4 import BeautifulSoup from selenium import webdriver from webdriver_manager.chrome import ChromeDriverManager # for chrome # driver = webdriver.Chrome("C:\Users\Admin\Desktop\chromedriver.exe") driver = webdriver.Chrome(ChromeDriverManager().install()) # ur...
Python
UTF-8
370
3.4375
3
[]
no_license
from bs4 import BeautifulSoup markup = "<h2 style='color:red'>Topics</h2><ul><li>Requests</li><li>Beautiful Soup</li></ul>" bs = BeautifulSoup(markup, "html.parser") print(bs.h2.text) print(bs.h2['style']) print("Using find_all() attribute") for li in bs.find_all("li"): print(li.text) print("Using children attrib...
Java
UTF-8
1,369
2.671875
3
[]
no_license
Naive custom TrustManager (empty checkServerTrusted) SSLContext sslContext = SSLContext.getInstance("SSL"); TrustManager trustManagerNaive = new X509TrustManager(){ @Override public void checkClientTrusted( X509Certificate[] chain, String authType) thr...
C#
UTF-8
1,060
2.6875
3
[]
no_license
using Game1.Sprite; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System.Runtime.Serialization; namespace Game1.Particle { class ShieldDeflect : IParticle { private ISprite sprite; private Vector2 position; private const int existFrames = 2; priv...
Java
UTF-8
4,413
3.28125
3
[]
no_license
package exercise6registerapp; import java.util.ArrayList; import java.util.List; public class Main { public static void main(String[] args) { List<Double> marks1 = new ArrayList<>(); marks1.add(4d); marks1.add(3d); marks1.add(4.5d); Student student1 = new Student(marks1, "...
Python
UTF-8
564
4.3125
4
[]
no_license
import tkinter # Let's create the Tkinter window window = tkinter.Tk() window.title("GUI") # In order to display the image in a GUI, you will use the 'PhotoImage' method of Tkinter. It will an image from the directory (specified path) and store the image in a variable. icon = tkinter.PhotoImage(file = "Ax1.png") # F...
Java
UTF-8
4,520
2.875
3
[]
no_license
package ru.yandex.C; import java.io.*; import java.util.ArrayList; import java.util.List; import java.util.StringTokenizer; public class Main { public static void main(String[] args) { InputStream inputStream = System.in; OutputStream outputStream = System.out; InputReader in = new InputRe...
Markdown
UTF-8
2,923
2.765625
3
[]
no_license
--- date: 2017-04-01 17:03 status: public title: 'BZOJ 1001 [BeiJing2006]狼抓兔子' --- [题目链接] (http://www.lydsy.com/JudgeOnline/problem.php?id=1001) # Solution 平面图转对偶图 平面图最小割 = 对偶图最短路 ``` c++ #include <stdio.h> #include <string.h> #include <algorithm> #include <functional> using namespace std; inline char getc()...
Java
UTF-8
2,283
2.203125
2
[]
no_license
package com.dp.ggomjirak.my.dao; import java.util.HashMap; import java.util.Map; import javax.inject.Inject; import org.apache.ibatis.session.SqlSession; import org.springframework.stereotype.Repository; @Repository public class LikeBookmarkDaoImpl implements LikeBookmarkDao { private static final String NAMESPAC...
C++
UTF-8
2,233
3.25
3
[]
no_license
#include "stdafx.h" #include "Directory.h" #include <iostream> Directory::Directory(const std::string& dirName, const Directory *parentDir) : Entity(!dirName.empty() ? dirName : throw std::invalid_argument("Directory name cannot be empty"), parentDir) {} Directory::~Directory() { for (EntType::iterator iter = entit...
Java
UTF-8
903
2
2
[]
no_license
package br.com.mind5.paymentPartner.partnerPagarme.orderPagarme.model.checker; import br.com.mind5.model.checker.ModelChecker; import br.com.mind5.model.checker.ModelCheckerOption; import br.com.mind5.model.checker.ModelCheckerTemplateForward; import br.com.mind5.payment.setupPartner.info.SetuparInfo; import br.com.mi...
C++
UTF-8
644
2.984375
3
[]
no_license
#include <string> #include <iostream> #include <algorithm> using namespace std; string solve(string a, string b) { string ret = ""; bool carry = 0; bool first_non_zero = 0; for (size_t i = 0, j = 0; i<a.size() || j<b.size(); i++, j++) { int aa = i<a.size()?a[i]-'0':0; int bb = j<b.size()?b[j]-'0':0; int sum ...
Java
UTF-8
567
3.015625
3
[]
no_license
package team.six.youth.luowang.problem67; public class Solution { public String addBinary(String a, String b) { if(a==null || b==null) return null; int iA = a.length()-1; int iB = b.length()-1; int sum = 0; StringBuilder sb = new StringBuilder(); while(iA >= 0 || i...
C++
SHIFT_JIS
1,204
2.625
3
[]
no_license
#ifndef DTR_ELEMENT_DICTIONARY_ITEM_HPP #define DTR_ELEMENT_DICTIONARY_ITEM_HPP #include <string> namespace dtr { //! f[^vf^O̍ class Element_Dictionary_Item { public: //! \z explicit Element_Dictionary_Item( const std::string& name, const std::string& vr, const...
TypeScript
UTF-8
7,225
2.890625
3
[]
no_license
import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; // We can use this for any-to-any component communication through the use of the Services. // BehaviorSubject // * Is a type of subject (which is a type of Observable) // * Can be subscribed to // * Subscribers can receive up...
TypeScript
UTF-8
1,533
2.59375
3
[]
no_license
import { Action } from 'redux'; import { ThunkAction, ThunkDispatch, } from 'redux-thunk'; import { getRides, addRide, deleteRide } from './rides/actions' import { AppState } from '.' import axios from "axios"; const config = { headers: { "Content-Type": "application/json" } }; export const thunkGetRi...
Python
UTF-8
433
3.484375
3
[ "MIT" ]
permissive
import math # y = 11 # x = 13 # y1 = 1 # y2 = 0 # x1 = 1 # x2 = 0 # radius = 10 # # m = (y1 - y2) / (x1 - x2) # b = y1 - m * x1 # temp_x = (y-b)/m # print ("x", temp_x ) # print ("y", m * temp_x + b) # print ((y-b)/m, m * (y-b)/m + b) # temp_y = m * x + b # print ("y", temp_y ) # print ("x", (temp_y - b)/m) # print ((...
Markdown
UTF-8
2,181
2.546875
3
[]
no_license
### [2013-05-14](/news/2013/05/14/index.md) # Several boats carrying over 100 Rohingya Muslims away from an oncoming cyclone capsize off the coast of Myanmar leaving only 42 survivors. ### Source: 1. [Wall Street Journal](http://online.wsj.com/article/SB10001424127887324216004578482850082867838.html) ### Relate...
Markdown
UTF-8
2,208
2.859375
3
[]
no_license
# Debugging Debugging is a technique of finding and resolving of defects that prevent correct operations of software systems In the early days of computing, debugging was cumbersome but now debugging is more seamless because of various tools called debuggers. We can use debuggers in various languages and various I...
Markdown
UTF-8
763
3.15625
3
[]
no_license
## Overview This Flask application contains the basic user management functionality (register, login, logout) to demonstrate the use of py.test. ## Motivation After reading Brian Okken's book (Python Testing with py.test), I was convinced that I should learn about py.test and then figure out how to use it to test Fl...
PHP
UTF-8
767
2.875
3
[ "BSD-3-Clause" ]
permissive
<?php declare(strict_types = 1); namespace PharIo\Phive; use PharIo\Version\Version; class UnsupportedRelease implements Release { /** @var string */ private $name; /** @var Version */ private $version; /** @var string */ private $reason; public function __construct(string $name, Versi...
Swift
UTF-8
3,211
2.875
3
[]
no_license
// // TimeCircuitsViewController.swift // OutaTime // // Created by Michael on 12/18/19. // Copyright © 2019 Michael. All rights reserved. // import UIKit class TimeCircuitsViewController: UIViewController { @IBOutlet weak var destinationTimeLabel: UILabel! @IBOutlet weak var presentTimeLabel: UILabel! ...
Python
UTF-8
946
2.65625
3
[]
no_license
# docker 설치 및 사용하기 # docker install # window pro 일때는 docker for windows # window pro 외 docker toolbox # 실행후 docker run hello-world를 이용하여 설치 확인 # docker pull continuumio/miniconda3 이미지 다운 # docker run -i -t continuumio/miniconda3 /bin/bash # python3 -c "print(3*5)" 컨테이너에 담아 실행 # 빠져 나올때 exit # 컨테이너 상태를 설정하기 위해서 (pi...
Python
UTF-8
639
2.515625
3
[]
no_license
from solution import Solution from eval_module import quality import json TRAIN_DIR = 'train/txts/' if __name__ == "__main__": train = [] with open("train/gold_labels.txt", "r") as read_file: for doc_info in read_file.readlines(): doc_dict = json.loads(doc_info) docname = TRAI...
Go
UTF-8
3,002
2.75
3
[ "MIT" ]
permissive
package xweb import ( "FishChatServer2/common/net/trace" "FishChatServer2/common/net/xweb/context" ctx "golang.org/x/net/context" "net/http" ) const ( _family = "go_http_server" ) // web http pattern router type Router struct { mux *http.ServeMux pattern string } // NewRouter new a router. func NewRouter...
Go
UTF-8
10,261
2.703125
3
[ "MIT", "BSD-3-Clause", "Apache-2.0" ]
permissive
package bitQuery import ( "github.com/edendoron/bit-framework/configs/rafael.com/bina/bit" query "github.com/edendoron/bit-framework/internal/bitQuery" "github.com/edendoron/bit-framework/internal/models" "google.golang.org/protobuf/types/known/timestamppb" "reflect" "testing" "time" ) // test filterBitStatus ...
Java
UTF-8
344
1.921875
2
[]
no_license
package com.gdn.pickup; import com.gdn.request.PickupChoiceRequest; import com.gdn.response.PickupChoiceResponse; import com.gdn.response.WebResponse; import javax.mail.MessagingException; public interface PickupService { WebResponse<PickupChoiceResponse> savePickup(PickupChoiceRequest pickupChoiceRequest) throw...
Python
UTF-8
11,035
2.5625
3
[ "MIT" ]
permissive
""" This module implements the LLE_SMOTE method. """ import numpy as np from numpy.linalg import LinAlgError from sklearn.manifold import LocallyLinearEmbedding from ..base import coalesce, coalesce_dict from ..base import NearestNeighborsWithMetricTensor from ..base import OverSamplingSimplex from .._...
C++
UTF-8
2,292
3.46875
3
[]
no_license
#include <vector> #include "gtest/gtest.h" #include <iostream> using namespace std; class Solution { public: Solution() : pattern_length(0), repeats(0), arr(0) {} bool containsPattern(vector<int> &arr, int m, int k) { this->arr = arr; pattern_length = m; repeats = k; for ...
Java
UTF-8
784
1.890625
2
[]
no_license
package com.valor.model.web.response; import java.util.Set; /** * @author Kemp.Cheng * created on: 2019/11/19 * Copyright Valoroso Ltd. (c) 2019. All rights reserved. */ public class UpmsDetailsResponse { private SysUserResponse upmsUserResponse; private Set<SysAuthorityResponse> upmsAuthResponses; ...
C++
UTF-8
9,354
2.84375
3
[]
no_license
#include <MicroView.h> #include <Servo.h> #include <EEPROM.h> // This pin is for "up" button const byte pin_up_button = 6; // This pin is for "down"button const byte pin_down_button = 5; // Default gear byte current_gear = 4; // Pin for enable "tuning" mode // (during which we can change the "gears" array's values) ...
C
GB18030
844
3.734375
4
[]
no_license
/****************************** (C) COPYRIGHT 2016 ******************************* * ܣָָȽϴС * Ҫ㣺ָʹãעָ뺯ͺָ * ********************************************************************************/ #include <stdio.h> #include <stdlib.h> int min(int a, int b); /************************************************* ...
SQL
UTF-8
2,781
3.140625
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.5.1 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Apr 20, 2017 at 07:22 PM -- Server version: 10.1.16-MariaDB -- PHP Version: 5.6.24 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CL...
C++
UTF-8
923
3.046875
3
[]
no_license
// [49191] 순위 : https://programmers.co.kr/learn/courses/30/lessons/49191 #include <string> #include <vector> using namespace std; bool map[101][101]; //플로이드 와샬 void solve(int n) { //k: 거쳐가는 지점, i: 출발 지점, j: 도착 지점 for(int k = 1; k <= n; k++) { for(int i = 1; i <= n; i++) { for(int j = 1; j ...
Java
UTF-8
362
1.804688
2
[]
no_license
package com.baizhi.service; import com.baizhi.entity.Banner; import java.util.List; /** * Created by Administrator on 2018/8/29. */ public interface BannerService { //查询所有 List<Banner> queryAll(); //添加 void add(Banner banner); //修改状态 void update(Banner banner); //删除 void delete(B...
C++
UTF-8
276
3.671875
4
[]
no_license
#include<stdio.h> int power(int n) { if(n==0) return 1;//if n=0,return 1 else return 2*power(n-1);//else return n*2^(n-1) } int main() { int a; printf("Please input the exponent of 2:\n"); scanf("%d",&a); printf("2 to the power of %d is %d\n",a,power(a)); return 0; }
C++
UTF-8
993
3.421875
3
[ "Apache-2.0" ]
permissive
#include "Test.hpp" TEST(NameOfTheFirstTest, "This text indicates what's tested") { ASSERT_THROW(throw std::exception(), std::exception, "This test checks that an exception gets raised"); ASSERT_PASS(; , "This test checks that no exception gets raised"); }; TEST(NameOfTheSecondTest, "The tests can be splitted in m...
C++
UTF-8
2,982
3.265625
3
[]
no_license
#include "provided.h" #include <string> #include <vector> #include <iostream> #include <istream> using namespace std; class GenomeImpl { public: GenomeImpl(const string& nm, const string& sequence); static bool load(istream& genomeSource, vector<Genome>& genomes); int length() const; string name() con...
JavaScript
UTF-8
2,953
2.875
3
[]
no_license
/** * detect IE * returns version of IE or false, if browser is not Internet Explorer */ function detectIE() { var ua = window.navigator.userAgent; // Test values; Uncomment to check result … // IE 10 // ua = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)'; // IE 11 // ua = 'Mozil...
Markdown
UTF-8
2,533
2.625
3
[ "MIT", "Artistic-2.0", "ISC", "Apache-2.0" ]
permissive
--- lang: en title: 'Migrating components contributing Models' keywords: LoopBack 4, LoopBack 3, Migration, Extensions, Components, Models sidebar: lb4_sidebar permalink: /doc/en/lb4/migration-extensions-models.html --- Please review the content in [Migrating models](../models/overview.md) first. Going forward, we ass...
C++
UTF-8
3,657
2.96875
3
[]
no_license
// // main.cpp // Codeforces // // Created by loyinglin. // Copyright loyinglin. All rights reserved. /************************** 题解 ********************** [题目链接](https://codeforces.com/contest/1828/problem/B) **题目大意:** 有1到n的n个整数数组a,现在这n个整数是unsort的状态,也就是至少存在一个整数a[i] ≠ i; 可以选择一个整数k,对于数组中任意两个整数a[i]和a[j],只要满足i-j=...
JavaScript
UTF-8
265
2.5625
3
[ "MIT" ]
permissive
$(function(){ $("form").on("submit", function(event) { var args = $(this).find("#args").val() //- $(this).find("#args").val('') $.getJSON("/run?args="+args, function(output){ $("#output").text(output) }) return false }) })
Markdown
UTF-8
5,679
2.796875
3
[]
no_license
## About Bootstrap Material Design is a project done by [FezVrasta](http://fezvrasta.github.io/). It is a theme compatible for [bootstrap 3](http://getbootstrap.com/) and it's really a nice theme that everyone can work with [Laravel 5](https://laravel.com/). You can read more about in this [here](http://fezvrasta.githu...
C#
UTF-8
1,439
2.609375
3
[ "MIT" ]
permissive
using TensorShader; using TensorShader.Layers; using static TensorShader.Field; namespace MNIST { public static class Model { public static Field CNN(Field x, int classes) { Convolution2D conv1 = new( inchannels: 1, outchannels: 4, kwidth...
Java
UTF-8
391
2.21875
2
[]
no_license
package br.com.anteros.bean.validation.constraints.validators; import java.util.function.Function; import br.com.anteros.bean.validation.constraints.Numeric; import br.com.anteros.core.utils.StringUtils; public class NumericValidator extends GenericStringValidator<Numeric> { @Override public Function<String,...
Java
UTF-8
5,401
2.75
3
[]
no_license
import Exceptions.NegativeParameterException; import Model.PhysicalRunway; import Model.Runway; import junit.framework.TestCase; import org.junit.Before; import org.junit.Test; /** Used the values from the scenarios to test if the calculations are done correctly. Runways used for testing are 09L and 27R. */ public cl...
Markdown
UTF-8
1,576
3.234375
3
[]
no_license
## Welcome to Command Line Hangman! ### Hello! Thanks for checking this out. Here I have created a command line version of hangman using node.js and a the [inquirer](https://www.npmjs.com/package/inquirer) and [random-word](https://www.npmjs.com/package/random-word) packages from [npm](https://www.npmjs.com). ### Th...
PHP
UTF-8
600
2.703125
3
[]
no_license
<?php namespace App\Models; use Carbon\Carbon; use Illuminate\Database\Eloquent\Model; class Visitor extends Model { protected $table = 'visitors'; protected $fillable = ['url', 'ip', 'hits', 'meta']; public function log() { $ip = request()->ip(); $url = url()->full(); $visitor = $this->where(['ip' =>...
Markdown
UTF-8
458
2.828125
3
[]
no_license
#Contents# * table of contents {:toc} ## Definition A _bisimplicial object_ in a [[category]] $C$ is a [[functor]] $$ F : \Delta^{op} \times \Delta^{op} \to C $$ where $\Delta$ is the [[simplex category]]. This is the same as a [[simplicial object]] in the [[category]] of [[simplicial object]]s in $C$. ## Exa...
C#
UTF-8
641
3.296875
3
[]
no_license
using System; namespace BankOfKurtovoKonare { public class Deposit : Account { public Deposit(Customer customer, decimal balance, decimal interest) : base(customer, balance, interest) { } public override decimal CalculateInterest(int months) { i...
Python
UTF-8
3,851
3.296875
3
[]
no_license
# imports the file that serves the website & for creating objects from class Movie import movie_zone import media toy_story = media.Movie("Toy story", "Woody (Tom Hanks), a good-hearted cowboy doll who" " belongs to a young boy named Andy (John Morris)," ...
C#
UTF-8
2,104
2.671875
3
[]
no_license
using System.Windows; using System.Windows.Controls; using Presentation.Contexts; using Presentation.PasswordEdit; using Presentation.Validation; namespace UI { /// <summary> /// Interaction logic for PasswordEditDialog.xaml /// </summary> public partial class PasswordEditDialog : IPasswordEditView ...
Python
UTF-8
260
3.265625
3
[]
no_license
import tkinter top = tkinter.Tk() # button = tkinter.Button(top, text ='Click me', ) # button.pack() c = tkinter.Canvas(top, bg='yellow', height=500, width=500) img = tkinter.PhotoImage(file='1.gif') c.create_image(150, 150, image=img) c.pack() top.mainloop()
Java
UTF-8
1,360
2.15625
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 com.dutchconnected.fruithuis; import org.hibernate.Session; import org.hibernate.cfg.Configuration; import org.hibernate.Sessi...
C++
UTF-8
1,080
2.984375
3
[]
no_license
// // unknown_type_handling.hpp // cpp_xcode // // Created by Lin on 4/11/17. // Copyright © 2017 Runskey. All rights reserved. // #ifndef unknown_type_handling_hpp #define unknown_type_handling_hpp //#include <stdio.h> // Note that in C++14 you don't need the decltype, templates can deduce an auto return type /...
Java
UTF-8
666
2.59375
3
[]
no_license
package com.cwtcn.kmlib.protocol; /** * 3.45获取佩戴对象图像 * * @author Allen */ public class WearerAvatarGetReq extends Packet { public static final String CMD = "G_WEARER_AVATAR"; private String wearID; public WearerAvatarGetReq() { super(CMD); } public WearerAvatarGetReq(String wearId) {...
C#
UTF-8
3,224
2.859375
3
[ "Unlicense" ]
permissive
using System; using System.Collections.Generic; using System.Data; using System.Data.SqlClient; using System.Linq; using System.Reflection; namespace Buruku { public class BulkService : IBulkService { private String tableName; private String connectionString; private SqlConnecti...
Shell
UTF-8
4,171
2.703125
3
[]
no_license
#!/bin/bash build_trilinos() { export TRILINOS=/opt/deal.II/Trilinos/11.4.3 cd /mnt if [ -d trilinos-11.4.3-Source ] ; then rm -rf trilinos-11.4.3-Source fi tar xf trilinos-11.4.3-Source.tar.bz2 cd trilinos-11.4.3-Source mkdir build && cd build cmake \ -DTPL_ENABLE_MKL=ON \...
PHP
UTF-8
6,911
3.140625
3
[]
no_license
<?php require_once 'dbCredentials.php'; /** * Class SkiModel handles all ski related queries to the database. */ class SkiModel { protected $db; public function __construct() { $this->db = new PDO('mysql:host='.DB_HOST.';dbname='.DB_NAME.';charset=utf8', DB_USER, DB_PWD, ...
Java
UTF-8
414
2.359375
2
[]
no_license
package com.fairbit.App; import com.google.gson.Gson; /** * Created by fatih.kose on 18.08.2017. */ public class Main { /** * Entry point * @param args */ public static void main(String[] args) { Person person = new Person(); person.setId(500); person.setName("John Wa...
Java
UTF-8
4,358
1.898438
2
[]
no_license
package com.meuapttestemobile.presentation.Shot; import android.os.Bundle; import android.os.Parcelable; import android.support.annotation.Nullable; import android.support.v4.widget.SwipeRefreshLayout; import android.support.v7.widget.DividerItemDecoration; import android.support.v7.widget.LinearLayoutManager; import ...
Python
UTF-8
256
3.234375
3
[]
no_license
class Debito: def debitar(self, valor, tipo): if (tipo == 'poupanca'): print('Debitar poupanca') elif (tipo == 'conta corrente'): print('Debitar conta corrente') conta = Debito() conta.debitar(100, 'poupanca')
Python
UTF-8
1,969
2.875
3
[]
no_license
""" Stitches all normal tissue into one using only the given immune genes """ import csv import sqlite3 from os import listdir from os.path import isfile, join #Variables Src = "./Data/Transposed Gene Expression" Destination = "./Data/Normal Immune Genes/NormalTissue_Combined.tsv" Genes = "./Data/Trajanoski...
Markdown
UTF-8
313
2.828125
3
[]
no_license
# 2021-Sep-2 https://leetcode.com/problems/happy-number/ ## Notes Javascript Hints: The implementation of the logic is pretty easy, I use % to get digits and calculte the result until it hits 1. The tricky part is to get out of an infinity loop, the idea is to use a set and store the results we have calculated.
Python
UTF-8
1,108
2.9375
3
[ "MIT" ]
permissive
import os from Code.ItemTable import ItemTable class WikifierOutputData: def __init__(self): self.file_location = None self.item_table = None def get_file_location(self) -> str: """ This function return the file location :return: """ return self.file_location def get_item_table(self) -> ItemTable: ...
JavaScript
UTF-8
1,285
2.515625
3
[]
no_license
import React, { Component } from "react"; import { Form, Button, Row } from "react-bootstrap"; export default class EditItem extends Component { state = { name: this.props.item.name, picture: this.props.item.picture, text: this.props.item.text, }; changeHandler = (e) => { console.log("I am editi...
C++
UTF-8
1,098
2.765625
3
[]
no_license
#pragma once #include <CGAL/Exact_predicates_inexact_constructions_kernel.h> #include <CGAL/convex_hull_3.h> #include <CGAL/Polyhedron_3.h> #include <vector> #include <CGAL/draw_polyhedron.h> typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef K::Point_3 Point_3; typedef std::vector<Point_3> Points;...
Python
UTF-8
257
2.84375
3
[ "MIT" ]
permissive
from test_patterns import test_patterns test_patterns( 'This is some text -- with punctuation.', [('[^-. ]+', 'sequences without -, ., or space')], ) #This pattern finds all of the # substrings that do not contain the characters -, ., or a space.
C++
UTF-8
11,333
2.5625
3
[ "MIT" ]
permissive
/* * 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. */ /* * File: lasso_entropy_scoring_function.h * Author: nilu * * Created on June 7, 2017, 5:06 AM */ #include "lasso_entropy_sc...
Ruby
UTF-8
1,094
2.921875
3
[]
no_license
class Neuronio AT=0.5 attr_accessor :sigma, :sinapses, :v, :y, :e, :x_atual, :id def initialize sinapses = [] @sinapses = sinapses end def calcular_v vetor_x @x_atual = vetor_x @x_atual sum = 0 @x_atual.each_with_index do |x, i| sum += @sinapses[i] * x end @v = s...
Java
UTF-8
409
3.546875
4
[]
no_license
//Use various access modifiers class Check { private int a=3; //declare variables with various access modifiers public int b=10; protected int c=5; int d=15; void disp() { //display private instance member System.out.println(getA()); } } public class CheckDemo { public static void main(String[] args) { ...
PHP
UTF-8
899
2.78125
3
[]
no_license
<?php declare(strict_types=1); namespace Codewars\Kata\Tests\kyu5; use Codewars\Kata\kyu5\TrainMergedStringChecker; use PHPUnit\Framework\TestCase; class TrainMergedStringCheckerTest extends TestCase { public function testSampleTestCase() { $sut = new TrainMergedStringChecker(); $this->assertEqua...
Java
UTF-8
4,271
2.046875
2
[ "MIT", "LicenseRef-scancode-free-unknown", "LicenseRef-scancode-unknown-license-reference" ]
permissive
package com.faforever.client.filter; import com.faforever.client.i18n.I18n; import com.faforever.client.test.PlatformTest; import org.apache.commons.lang3.Range; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.InjectMocks; import org.mockito.Mock; import static org.junit...
C++
GB18030
6,132
2.6875
3
[]
no_license
#include "itemwindow.h" #include "ui_itemwindow.h" itemWindow::itemWindow(QWidget *parent) : QDialog(parent), ui(new Ui::itemWindow) { ui->setupUi(this); if(false == itemDelButtonFlag) { ui->pushButton_7->hide(); //ɾť ui->pushButton_8->hide(); //水ť ui->lineEdit->clear(); ...
Python
UTF-8
1,178
3.109375
3
[]
no_license
interest_rate=float(input("rate of growth for fund:")) principal=float(input("amount invested in SIP per month:")) duration=float(input("Duration of SIP in year:")) fd_interest=float(input("interest rate of Debt:")) def sipcalculator(principal,interest_rate,duration): """ takes interset ,principal and duration...
Rust
UTF-8
7,182
2.515625
3
[]
no_license
peg::parser!( pub grammar parser() for str { use fazic::enums::*; use fazic::nodes::*; pub rule parse_all() -> Entry = i:integer() _ a:(all() ++ ":") { entry_node(&Some(i), a) } / a:(all() ++ ":") { entry_node(&None, a) } / i:integer() _ { entry_node(&So...
JavaScript
UTF-8
3,257
3.4375
3
[]
no_license
var identity = function(x) { return x; }; function add(x,y) { return x+y; } function mul(x,y) { return x*y; } var identityf = function(x) { return identity(x); }; console.log(identityf(1)); var addf = function(x) { return function(y){ return x+y; }; }; console.log(addf(3)(4)); va...
TypeScript
UTF-8
1,244
2.734375
3
[ "MIT" ]
permissive
import { convertArrayToCSV } from '../csv' describe('utils/csv', () => { it('converts to a valid CSV', () => { const obj = [ { exampleCol: 'test', exampleCol2: 'test2', __typename: 'example' }, { exampleCol: 'test4', exampleCol2: 'test3', __typename: 'example' }, ] expect(convertArrayToCSV(ob...
PHP
UTF-8
1,339
2.578125
3
[ "MIT" ]
permissive
<?php namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; /** * * @OA\Schema( * @OA\Xml(name="Requisition"), * @OA\Property(property="id", type="integer", example="05"), * @OA\Property(property="user_id", type="integer", example="05"), * @OA\Pr...
Java
UTF-8
516
2.328125
2
[]
no_license
package rnsr.rag.grammar.interfaces; import rnsr.rag.grammar.VariableSet; import rnsr.rag.grammar.exception.VariableNotBoundException; import rnsr.rag.grammar.exception.VariableNotFoundException; /** * Indicates that this term may contain variables which can be resolved */ public interface IResolvable<T> { /** ...