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
575
1.773438
2
[]
no_license
public ServiceDescription describe() { ServiceDescription.Builder sd = new ServiceDescription.Builder(NAME, Validate.class.getCanonicalName()); sd.classname(this.getClass().getCanonicalName()); sd.description("Validation service based on PngCheck."); sd.author("Fabian Steeg"); ...
C
UTF-8
246
2.703125
3
[]
no_license
#include <stdio.h> #include <string.h> int main(void){ char s[25]; int x,i; scanf("%s",s); x=strlen(s); FILE* f=fopen("/tmp/arq.txt","w"); for(i=0;i<x;i++){ fputc(s[i],f); } fclose(f); return 0; }
PHP
UTF-8
864
2.578125
3
[]
no_license
<?php namespace App; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Facades\Auth; class Cart extends Model { // protected $fillable = [ 'user_id', 'total' ]; public function cartItems() { return $this->hasMany(CartItem::class, 'cart_id','id'); } publi...
Python
UTF-8
9,966
2.59375
3
[]
no_license
import Phase3Task5 import numpy as np from scipy.spatial import distance import heapq import os def getNeighboursFromBucket(binned_values,hash_table,no_layers,no_hashes): neighbours = set() for i in range(no_layers): hash_key_list = binned_values[0,i*no_hashes:(i+1)*no_hashes].tolist() hash_key_str = '...
C#
UTF-8
532
2.984375
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace PrOb3Music { class MusicPlayer { public List<Song> playlist = new List<Song>(); public void Add(Song song) { playlist.Add(song); } ...
C
GB18030
2,198
4
4
[]
no_license
/* ļ:ṹǶһָ ߣlqa ༭ʱ䣺20180125 */ #include <stdlib.h> #include <stdio.h> #include <string.h> typedef struct Teacher { char name[64]; char* alisname; int age; int id; }Teacher; /* ӡ */ void PrintTeacher(Teacher* array, int num) { for (int i = 0; i < 3; i++) { printf("age : %d \n", array[i].age); } } /* */ ...
Java
UTF-8
785
2.625
3
[]
no_license
package com.sattrak.rpi.serial; public class OrientationReadPacket extends SerialPacket { // =============================== // CONSTRUCTORS // =============================== public OrientationReadPacket() { setCommand(SerialCommand.READ_ORIENTATION); } public OrientationReadPacket(byte[] packetBytes) t...
C
UTF-8
1,959
2.953125
3
[]
no_license
// // Created by Dell on 2018/8/17. // #include "heuristic_func.h" #include "structure.h" struct activity min_sk(struct activity_set * set) { int min = INF; int index = 0; for (int i = 0; i < set->length; ++i) { int temp = set->queue[i].lft - set->queue[i].est - set->queue[i].durations; if...
Shell
UTF-8
403
3.296875
3
[]
no_license
#!/bin/sh echo "*****SYSTEM ENVIRONMENT PROFILE INFORMATION *****" internalDirectory=$directory cd $directory touch systemenvironment.txt echo "*****SYSTEM ENVIRONMENT PROFILE INFORMATION *****">>systemenvironment.txt var1=`cat /etc/profile` if [ "$var1" = "" ];then echo "Error Detected" else echo "The local sy...
Markdown
UTF-8
624
3.078125
3
[ "MIT" ]
permissive
# gitem ## A command for git workflow automation ### Usage ##### Just type the following command in your terminal to automatically push all changes in your git project to the currently checked out branch of your local and remote repositories. ```shell gitem '<your commit message>' ``` ### Installation ##### Add t...
PHP
UTF-8
9,810
2.515625
3
[]
no_license
<?php include 'engine.php'; $getDataCity = new getDataCity(); $reporting = new reporting(); if (isset($_POST['provincesId'])) { $decode = json_decode($_POST['provincesId'], true); $provincesId = $decode['post']['provincesId']; print_r($getDataCity->select($provincesId)); }elseif (i...
C#
UTF-8
1,767
2.765625
3
[]
no_license
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Net; using System.Net.Http; using System.Web; using System.Web.Http; using HOTELMANAGEMENTWEBAPI.Models; namespace HOTELMANAGEMENTWEBAPI.Controllers { public class ProductController : ApiController { Image...
Java
UTF-8
211
2.34375
2
[]
no_license
package package1; public class WrongLoginException extends RuntimeException { public WrongLoginException() { } public WrongLoginException(String message) { System.out.println(message); } }
Python
UTF-8
1,843
2.65625
3
[]
no_license
#!/usr/bin/env python import sys, glob allKeys = [] allVals = [] ignoreKeys = ["uid", "form_name"] if len(sys.argv) is 0: sys.exit(-1) def addVal(key, val): vals[key] = val.replace(",", "&#44;") try: allKeys.index(key) except ValueError: allKeys.append(key) def processFile(filename, ke...
Java
UTF-8
2,772
2.15625
2
[]
no_license
package bustracking.model; import java.sql.Date; public class BusRegistration { private String org_id; public BusRegistration(String org_name, String branch, String vechicle_reg_no, String device_imei_number, String driver_name, String driver_licence_no, String driver_licence_exp_date) { super(); this....
C++
SHIFT_JIS
33,883
2.609375
3
[]
no_license
/*! *@brief XLff[^B */ #include"fbstdafx.h" #include "SkinModelData.h" #include <iostream> #include <sstream> #include <iomanip> #include<shlwapi.h> //UINT g_NumBoneMatricesMax = 0; //D3DXMATRIXA16* g_pBoneMatrices = NULL; //CX^VOŕ`”\ȍő吔B const int MAX_INSTANCING_NUM = 100; name...
C
ISO-8859-1
29,340
3.015625
3
[]
no_license
#include <stdio.h> #include <stdlib.h> #include <locale.h> #include <conio.h> #include <conio2.h> #include <string.h> #include <ctype.h> // estruturas struct Login { char usuario[15]; char senha[15]; }; struct CadastroAluno { char RGA [12]; char nome [50]; char usuarioL [10]; ...
Markdown
UTF-8
2,450
2.96875
3
[]
no_license
# Lab 2 - Music Search ## Milestone 1 - Artists and Albums Demo: http://distracted-kirch-3f32c6.netlify.com/ Para este milestone debes crear una pagina para ver la información de un artista, y otra página para ver la información de un álbum. Las urls deben ser `/artists/:artistId` y `/albums/:albumId`, respectivamen...
Python
UTF-8
2,344
2.53125
3
[]
no_license
from src.features.build_features import * import pytest def test_can_check_raw_data(train_data_sample): assert set(train_data_sample.columns) == { 'age','ca','chol','cp','exang','fbs','oldpeak', 'restecg','sex','slope','target','thal','thalach','trestbps' } RawDataPreprocessor.check_raw_da...
JavaScript
UTF-8
3,213
4.75
5
[]
no_license
// Problem #1 // We are creating the motivation function that takes in 2 parameters firstname and lastname. Inside the motivation function we // have a message function that returns the welcome tex plus the firstname and the last name the ' ' are just being used for spacing function motivation(firstname, lastname...
PHP
UTF-8
31,196
2.6875
3
[]
no_license
<?php /** * @file * Class to work with Culturefeeds Entry API. */ class CultureFeed_EntryApi implements CultureFeed_EntryApi_IEntryApi { /** * Status code when an item has been succesfully created. * @var string */ const CODE_ITEM_CREATED = 'ItemCreated'; /** * Status code when an item has been...
PHP
UTF-8
1,508
2.765625
3
[]
no_license
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <link href="./buyagrade.css" type="text/css" rel="stylesheet" /> <?php $name = $_POST["name"]; $section = $_POST["section"]; $cardnumber = $_POST["cardnumber"]; $cardtype = $_POST["cardtype"]; $file = 'data.txt';...
Python
UTF-8
362
2.734375
3
[]
no_license
class Solution: def partitionLabels(self, S: str) -> List[int]: _map = {c: i for i, c in enumerate(S)} _max = prevIndex = 0 res = [] for i, c in enumerate(S): _max = max(_max, _map[c]) if _max == i: res.append(i - prevIndex + 1) ...
JavaScript
UTF-8
1,724
2.59375
3
[]
no_license
var player; var walls; var cursors; var wasd; var bullets; var fireRate = 400; var nextFire = 0; function create() { //game settings game.world.setBounds(-1000, -1000, 2000, 2000); game.physics.startSystem(Phaser.Physics.ARCADE); game.add.tileSprite(-1000, -1000, 2000, 2000, 'ground'); //walls ...
Markdown
UTF-8
416
2.78125
3
[]
no_license
# TicTacToe TicTacToe Game in Python! # Download Game .exe [Download Game](http://www.mediafire.com/file/opvxpul6v7nrpyy/TicTacToeGame.rar) # The positions you type is equal to the numpad of a keyboard for example: ![alt text](https://i.imgur.com/5sdNOeb.png) Every number is a position where you can place 'X' or '...
Java
UTF-8
2,895
2.453125
2
[]
no_license
package com.example.yunihafsari.fypversion3.ui.adapters; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.CheckBox; import android.widget.TextView; import com.example.yunihafsari.fypversion3.R; import com....
C
UTF-8
2,500
2.796875
3
[ "MIT-Modern-Variant", "LicenseRef-scancode-unknown-license-reference", "MIT" ]
permissive
#include "filesys/inode.h" #include <list.h> #include <debug.h> #include <round.h> #include <string.h> #include "filesys/filesys.h" #include "filesys/free-map.h" #include "threads/malloc.h" #include "filesys/cache.h" static struct cache_element cache[65]; static int clock; void cache_init() { int n; for(n = 0; n ...
Ruby
UTF-8
279
3.515625
4
[]
no_license
class Hand #class factory method to create a hand def self.make_hand(deck) Hand.new(deck.take(7)) end #initialize def initialize(cards) @hand = cards end def count @hand.length end #empty? def empty? return true if count == 0 end end
Markdown
UTF-8
3,212
3.28125
3
[]
no_license
# portfolio-template A test version of this app is deployed on https://mypyanywhere.pythonanywhere.com/ ## Table of Content 1. [Running The App](#running-the-project) 2. [Setting Up A Test User](#setting-up-a-test-user) 3. [Adding Documentation](#adding-documentation) 4. [Known Bugs](#known-bugs) ## Running the...
Java
UTF-8
1,063
3.4375
3
[]
no_license
package binarytree.middle; import binarytree.TreeNode; import binarytree.TreeNodeUtils; /** * @author hawk * @package binarytree.middle * @desc 814. 二叉树剪枝 * 给定二叉树根结点root,此外树的每个结点的值要么是 0,要么是 1。 * <p> * 返回移除了所有不包含 1 的子树的原二叉树。 * <p> * ( 节点 X 的子树为 X 本身,以及所有 X 的后代。) * <p> * 说明: * <p> * 给定的二叉树最多有 100 个节点。 * 每个...
C++
UTF-8
486
3.46875
3
[]
no_license
#include <iostream> #include <set> using namespace std; int main(){ set<char> goodnumbers; for(int i = 0; i < 8; ++i){ char c = char(i + 48); goodnumbers.insert(c); } string str; cin >> str; bool ok = true; if(str[0] == '0'){ ok= false; } else{ for(int i = 0; i < str.length(); ++i){ char c ...
Markdown
UTF-8
7,805
4.0625
4
[]
no_license
# Classes vs. Constructors With the unveiling of ES2015 (often referred to as ES6) syntax, JavaScript made its way toward becoming a class based, object-oriented programming language, at least on the surface. Behind the scenes is a new method to create constructors using the `class` syntax. Let's take a look at some...
C#
UTF-8
1,674
3.796875
4
[ "MIT" ]
permissive
//Problem 15. Prime numbers //Write a program that finds all prime numbers in the range //[1...10 000 000]. Use the Sieve of Eratosthenes algorithm. using System; using System.Collections.Generic; using System.IO; using System.Text; class PrimeNumbers { static void Main() { int n = 10000001; ...
Java
UTF-8
2,813
3.46875
3
[]
no_license
package com.cg.oopd.model; public class ComplexNumber { /* data members (or) fields */ private double realPart; // represent real part of the complex number private double imaginaryPart; // represent imaginary part /* default constructor */ public ComplexNumber() { realPart = -1; imaginaryPart =...
Python
UTF-8
3,789
3.0625
3
[]
no_license
import numpy as np from itertools import product def sinusoid_data_generation_1D(n_Phi, n_T, omega): """ Creates n_Phi sinusoidal signals with n_T points per signal each with angular frequency of omega. :param n_Phi: number of partitions of phase interval :param n_T: number of partitions of time in...
Ruby
UTF-8
3,124
4.1875
4
[]
no_license
Suits = ["Clubs","Hearts","Spades","Diamonds"] Ranks = ["1","2","3","4","5","6","7","8","9","10","11","12","13"] $d = [] class Card include Enumerable # class variables (private) @@suit_value = Hash[ Suits.each_with_index.to_a ] @@rank_value = Hash[ Ranks.each_with_index.to_a ] attr_reader :rank, ...
JavaScript
UTF-8
4,141
2.59375
3
[]
no_license
import logo from './logo.svg'; import './App.css'; import IdCard from './components/IdCard' import Greetings from './components/Greetings' import Random from './components/Random' import BoxColor from './components/BoxColor' import CreditCard from './components/CreditCard' import Rating from './components/Rating'; impo...
Python
UTF-8
1,734
2.59375
3
[ "MIT" ]
permissive
from flask import session, jsonify from flask_login import login_required, current_user from sixquiprend.models.game import Game from sixquiprend.models.user import User from sixquiprend.sixquiprend import app, admin_required @app.route('/games/<int:game_id>/columns') @login_required def get_game_columns(game_id): ...
Shell
UTF-8
808
3.078125
3
[]
no_license
#!/bin/bash set -e cd if [ -z "$SVNPOLY" ] then wget -q -O polyml5.5.1.tar.gz "http://downloads.sourceforge.net/project/polyml/polyml/5.5.1/polyml.5.5.1.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fpolyml%2Ffiles%2Fpolyml%2F5.5.1%2Fpolyml.5.5.1.tar.gz%2Fdownload&ts=1384728510&use_mirror=softlayer-dal" tar xz...
Java
UTF-8
2,031
2.59375
3
[]
no_license
package com.anurag.dao; import org.apache.log4j.Logger; import org.springframework.jdbc.core.support.JdbcDaoSupport; import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.TransactionDefinition; import org.springframework.transaction.TransactionStatus; import org.spri...
Python
UTF-8
973
3.109375
3
[]
no_license
def match(string) -> int: pattern = "place:" arr = z(pattern+"/0"+string) for i in range(len(arr)): if arr[i] == len(pattern):return i - (len(pattern) + 1) -1 return -1 def z(string: str) -> list: z_val = [0] * len(string) i = left = right = 1 while i < len(string): if right...
Java
UTF-8
30,816
1.640625
2
[]
no_license
package com.yzlm.cyl.cfragment.Communication.CommProtocol.Modbus.Rtu; import com.yzlm.cyl.cfragment.Communication.Communication; import com.yzlm.cyl.cfragment.Communication.Thread.SendManager; import com.yzlm.cyl.cfragment.Config.Component.CfgTool.History; import com.yzlm.cyl.cfragment.R; import com.yzlm.cyl.clibrary....
C#
UTF-8
5,652
3.203125
3
[]
no_license
 namespace ProjetoPaises.Servicos { using System; using System.Collections.Generic; using System.Data.SQLite; using System.IO; using System.Threading.Tasks; using ProjetoPaises.Modelos; public class SecondDataService { #region Atributos /// <summary> /// Atrib...
Java
UTF-8
27,683
1.90625
2
[]
no_license
package com.tripdazzle.daycation; import android.content.Context; import android.content.pm.PackageManager; import android.graphics.Bitmap; import android.os.AsyncTask; import com.google.android.gms.tasks.OnSuccessListener; import com.google.android.gms.tasks.Task; import com.google.android.gms.tasks.Tasks; import co...
Markdown
UTF-8
1,669
2.5625
3
[ "MIT" ]
permissive
# CustomerShippingContactsResponse Contains the detail of the shipping addresses that the client has active or has used in Conekta ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **phone** | **str** | | [optional] **receiver** | **str** | | [optional] *...
Markdown
UTF-8
3,700
3.03125
3
[]
no_license
+-- {: .rightHandSide} +-- {: .toc .clickDown tabindex="0"} ### Context #### Category theory +-- {: .hide} [[!include category theory - contents]] =-- =-- =-- #Contents# * table of contents {:toc} ## Definition An **absolute coequalizer** in a [[category]] $C$ is a [[coequalizer]] which is preserve...
C++
UTF-8
430
3.046875
3
[]
no_license
// queue.cpp : This file contains the 'main' function. Program execution begins and ends there. // #include "queue.h" #include <iostream> using namespace std; int main() { queue q; cout << "please enter your data to stop it enter a Negative number:\n"; int x=-1; cin >> x; while(x>0 && !q.isFull()) { q.push(x);...
C#
UTF-8
830
3.171875
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; namespace hlassistant { class Fileworks { public string ReadStr(string filename) { StreamReader sr = new StreamReader(filename); return sr.ReadToEnd().ToString(); ...
Java
UTF-8
7,182
1.84375
2
[]
no_license
package com.framework.webClient.schedulerTask; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import com.alibaba.fastjson.JSONObject; impo...
SQL
UTF-8
11,523
3.09375
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.6.5.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Jul 08, 2017 at 09:54 AM -- Server version: 10.1.21-MariaDB -- PHP Version: 5.6.30 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SE...
C#
UTF-8
3,391
2.53125
3
[ "FTL", "Zlib", "LGPL-2.0-or-later", "GPL-2.0-only", "LicenseRef-scancode-protobuf", "Apache-2.0", "LGPL-2.1-only", "LGPL-3.0-only", "MIT", "BSD-2-Clause", "GPL-3.0-only", "OFL-1.1" ]
permissive
using Fusee.Math.Core; using System.Collections.Generic; using Xunit; namespace Fusee.Tests.Math.Core { public class AABBfTest { [Fact] public void Constructor_MinMax() { var actual = new AABBf(new float3(0, 0, 0), new float3(1, 1, 1)); Assert.Equal(new float3(...
PHP
UTF-8
809
2.640625
3
[ "Apache-2.0" ]
permissive
<?php namespace app\common\library; /** * Created by PhpStorm. * User: wangcailin * Date: 2017/11/13 * Time: 下午3:43 */ use alidayu\Sms; class Alidayu { /** * 发送验证码 * @param $mobile 手机号 * @param $code 验证码 * @param $signName 短信模板 * @return bool */ public static func...
Java
UTF-8
2,270
2.203125
2
[]
no_license
package com.crm.service.imp; import java.util.List; import org.hibernate.criterion.DetachedCriteria; import com.crm.beans.Customer; import com.crm.beans.LinkMan; import com.crm.dao.CustomerDao; import com.crm.dao.LinkmanDao; import com.crm.service.LinkmanService; import com.crm.utils.PageBean; public c...
JavaScript
UTF-8
468
2.703125
3
[]
no_license
class App { constructor() { this.firestore = firebase.firestore(); this.auth = firebase.auth(); } authInstance() { return this.auth; } } let instance = new App(); let authObject; instance.authInstance().onAuthStateChanged(firebaseUser => { if (firebaseUser) { aut...
C++
UTF-8
593
2.59375
3
[]
no_license
#include<stdio.h> #include<algorithm> using namespace std; int ans[10010]; int n; int dfs(int k,int c) { if(k == 0) { return c; } if(c > 20) return 0; ans[c + 1] = 0; int len = dfs((k * 10) % n,c + 1); if(len) return len; ans[c + 1] = 1; len = dfs((k * 10 + 1) % n,c + 1); if(len) retu...
C#
UTF-8
1,306
2.5625
3
[]
no_license
public class FocusHighlightBehavior : Behavior<Path> { public FrameworkElement FocusElement { get { return (FrameworkElement)GetValue(FocusElementProperty); } set { SetValue(FocusElementProperty, value); } } // Using a DependencyProperty as the backing sto...
Java
UTF-8
2,064
3.46875
3
[]
no_license
import java.util.Random; public class EmpWageComputation{ public static final int IS_EMP_FULL_TIME = 1; public static final int IS_EMP_PART_TIME = 2; public static final int EMP_RATE_PER_HOUR = 10; public static final int WORKING_DAYS_IN_MONTH = 20; public static final int MAXIMUM_WORK_HOURS = 100; ...
Ruby
UTF-8
2,751
2.859375
3
[ "MIT", "LicenseRef-scancode-proprietary-license" ]
permissive
require 'active_support/all' require 'yaml' require 'csv' require 'securerandom' class Generator def initialize(question_file, base_path, cache_bust = 0) @questions = question_file['questions'] @base_path = base_path @cache_bust = cache_bust.to_i generate_possible_values generate_paths write...
Java
UTF-8
12,625
1.820313
2
[]
no_license
package com.sendish.api.web.controller.api.v1; import java.net.URI; import java.util.List; import javax.validation.Valid; import com.sendish.api.dto.*; import com.sendish.api.service.impl.PhotoServiceImpl; import com.sendish.api.web.controller.validator.ReportPhotoReplyValidator; import com.sendish.reposit...
C#
UTF-8
685
2.640625
3
[]
no_license
using System.Collections.Generic; namespace VendingMachine { public class PaymentEvent : IPaymentSubscriber, IPaymentNotifier { private List<IPaymentListener> paymentListeners = new List<IPaymentListener>(); public void Subscribe(IPaymentListener listeners) { paym...
C
UTF-8
716
2.84375
3
[]
no_license
/* * db.h */ #include <stdbool.h> //Structure for a log item typedef struct { int day; char message[140]; //tweet length } Log; //Structure for a single task typedef struct { char name[32]; int streak; //days consecutively completed bool active; int logc; //total amount of log items Log *logs; } Task; v...
Java
UTF-8
3,405
2.5625
3
[]
no_license
/* * Copyright (c) 2017 ICM Uniwersytet Warszawski All rights reserved. * See LICENCE.txt file for licensing information. */ package pl.edu.icm.unity.stdext.credential.pass; import java.nio.charset.StandardCharsets; import java.security.SecureRandom; import java.util.Map; import java.util.Random; import org.bouncy...
C++
UTF-8
829
2.546875
3
[]
no_license
#include"Header.h" SinhVien danhSachSV[1000]; int soSv=0; void docFile() { fstream file; file.open("data2.bin", ios::binary | ios::in); if (!file.is_open()) { cout << "ERROR!!!!!"; } else { file.seekg(soSv * sizeof(SinhVien), ios::beg); while (!file.eof()) { file.read(reinterpret_ca...
Java
UTF-8
2,829
2.0625
2
[]
no_license
package com.eol; import org.datanucleus.store.types.wrappers.ArrayList; import java.sql.*; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; public class MaxComputeLocal { private static final String D...
Java
UTF-8
490
2.21875
2
[]
no_license
package com.samAndDan.modTest.utils; import net.minecraft.util.text.translation.I18n; public class StringUtils { public static String localize(String string) { return I18n.translateToLocal(string); } public static boolean canLocalize(String string) { return I18n.canTranslate(string); ...
Python
UTF-8
2,978
2.71875
3
[]
no_license
""" POLL APP This module provides an interface into the poll and answer forms. Classes: PollAnswerForm Functions: n/a Created on 26 Mar 2013 @author: michael """ from django import forms from django.contrib import messages from django.conf import settings class PollAnswerForm(forms.Form): """Form fo...
C#
UTF-8
5,938
2.6875
3
[]
no_license
using System.Text; using Api.BusinessLogicLayer.Requests; using NUnit.Framework; namespace Api.BusinessLogicLayer.UnitTests.Requests { [TestFixture] public class RegisterRequestTests { private const string ValidEmail = "abc@gmail.com"; private const string ValidPassword = "Qwer111!"; ...
Go
UTF-8
303
3.1875
3
[]
no_license
package golang import "net/http" // RoundTripperFunc converts a function into a Transport. type RoundTripperFunc func(*http.Request) (*http.Response, error) // RoundTrip calls the underlying function func (rt RoundTripperFunc) RoundTrip(req *http.Request) (*http.Response, error) { return rt(req) }
PHP
UTF-8
7,762
2.53125
3
[ "Apache-2.0", "MIT" ]
permissive
<?php namespace Aws\Test\Arn\S3; use Aws\Arn\S3\AccessPointArn; use Aws\Arn\Exception\InvalidArnException; use Aws\Arn\S3\OutpostsAccessPointArn; use Aws\Arn\S3\OutpostsBucketArn; use PHPUnit\Framework\TestCase; /** * @covers \Aws\Arn\S3\OutpostsBucketArn */ class OutpostsBucketArnTest extends TestCase { /** ...
Java
UTF-8
4,158
2.046875
2
[]
no_license
package com.akul.chatzone; //Created by AkulSrivastava //May 2019 import android.content.Context; import android.content.Intent; import android.support.annotation.NonNull; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import...
PHP
UTF-8
4,416
2.515625
3
[]
no_license
<?php namespace App\Http\Controllers\Admin; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use App\Models\Work; use Illuminate\Support\Facades\Storage; class WorkController extends Controller { /** * Display a listing of the resource. * * @return \Illuminate\Http\Response *...
Java
UTF-8
459
2.546875
3
[]
no_license
package de.coiaf.footballprediction.sharedkernal.domain.model.buildingblocks; /** * An instance representing a DDD entity building block * @param <T> the entity type */ public interface Entity<T extends Entity<T>> { /** * * @param otherEntity the entity to be compared * @return <code>true</code>...
Python
UTF-8
2,204
2.78125
3
[]
no_license
import torch import torch.nn as nn import torch.optim as optim import torchvision.transforms as transforms import torchvision from torch.utils.data import DataLoader from customDataset import CharlieDataset device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') in_channel = 3 num_classes = 10 learning_...
C
UTF-8
2,053
2.9375
3
[]
no_license
#include <stdio.h> #include <stdlib.h> #include <assert.h> #include <stdbool.h> #include <string.h> #include "analyse_input_stream.h" #include "file.h" int findInstancesInFile(char* path, char* instance); int main(int argc, char* argv[]) { ssize_t numberOfChars = 0; size_t size = 0; FILE* f...
Java
UTF-8
933
2.78125
3
[]
no_license
package com.hfm.internationalization; import java.util.Locale; import java.util.ResourceBundle; /** * @author hfming2016@163.com * @version 1.01 2020-09-01 10:57 * @Description 国际化类的使用 * @date 2020/9/1 */ public class ResourceBundleTest { public static void main(String[] args) { // 调用 ResourceBundle ...
Markdown
UTF-8
931
2.640625
3
[]
no_license
## 7天无理由退款 如果您购买的云开发资源包未被使用,可在购买7天内申请退款,超出7天或已使用过的资源包(不论已用多少)不支持退款。 ## 退款规则 - 云开发资源包未被使用,可在购买7天内申请退款。 - 一经使用,概不退还。 - 如出现疑似异常或恶意退款,腾讯云有权拒绝您的退款申请。 - 符合7天无理由退款场景的订单,退款金额为购买时花费的全部消耗金额,包括现金账户金额、收益转入账户金额以及赠送账户金额。 >! > - 抵扣或代金券不予以退还。 > - 退还金额将全部原路退回到您的腾讯云账户。 ## 退款流程 进入 [云开发控制台](https://console.cloud.tencent.com/tcb/env/res...
C#
UTF-8
2,534
2.53125
3
[ "MIT" ]
permissive
using System; using System.Net; using System.Net.Http; using System.Security; using System.Threading; using System.Threading.Tasks; using Newtonsoft.Json; using TheWheel.ETL.Contracts; using TheWheel.ETL.Providers; namespace TheWheel.ETL.CyberArk { public class Credentials { private readonly Uri endpo...
C++
UTF-8
1,816
3.515625
4
[]
no_license
#include <cmath> #include <iostream> #include "vector.h" using namespace std; void Vector::set_mag() { mag = sqrt(x*x+y*y); } void Vector::set_ang() { if((x == 0)&&(y == 0)) angle = 0; else angle = atan2(y,x); } void Vector::set_x() { x = mag * cos(angle); } void Vector::set_y() { y = mag * sin(angle); }...
Markdown
UTF-8
3,125
3.25
3
[]
no_license
--- layout: post title: MySQL 中 Int 列插入字符串变为 '0' date: 2017-07-20 categories: Notes tags: [MySQL] --- 今天在听课过程中遇到了这样一个问题:`grade` 表中的 `gradeid` 字段为 `INT` 类型,但是在执行插入一个字符串时,只是出现了警告,但是插入成功,而且插入的结果为 `0` ```sql # 执行语句 INSERT INTO grade(gradeid) VALUES('test') # grade 表结果 # --------- # gradeid # 0 ``` 这是由于数据库的 SQL 模式导致的结...
Markdown
UTF-8
2,452
3.9375
4
[]
no_license
## ✅ 구조체 (a) 두 점의 좌표가 일치하면 1을 반환하고 그렇지 않으면 0을 반환 // 구조체 2개 ```C #include <stdio.h> int fun(struct point point1,struct point point2); struct point { int x; int y; }; int main(void) { struct point point1; struct point point2; scanf_s("%d %d %d %d", &point1.x, &point1.y, &point2.x, &point2.y); ...
PHP
UTF-8
3,840
2.671875
3
[]
no_license
<?php /** * Default implementation of user roles for ACL. * * Includes role for visitor, extending roles. * * @author Dmitry Kurinskiy * * @table o_acl_role * @field parent -has one {classnames/acl_role} -inverse childs * @field childs -has many {classnames/acl_role} -inverse parent * @field name v...
Java
UTF-8
2,539
2.140625
2
[]
no_license
package com.ai.yc.ucenter.constants.eunm; /** * Created by astraea on 2015/7/27. */ public final class Constants { private Constants() { // non } /** * 注册方式 * to UcMembersServiceAtomImpl.getUsername * @author Administrator * */ public final static class LoginWayCon...
Python
UTF-8
3,620
3.640625
4
[]
no_license
""" For sampling epoch data. General Notes -- Shirakawa introduces three sampling strategies: left, right, both. On the convention that we have two columns, U -> V, where U is the hyponym and V the hypernym: - left sampling considers all hyponyms, excluding those hyponyms of U. Overall it therefore considers al...
JavaScript
UTF-8
5,898
3.734375
4
[]
no_license
// 这里只讨论有序二叉树,如果无序,二叉树无法手动建立,并且只能通过轮询检索 class tree{ constructor(){ //初始化二叉树 this.tree = {}; } // 对二叉树插入节点 insert(data){ let root = this.tree; if(root.hasOwnProperty('value') == false || root.value == null){ this.root = data; return root.value = data; } var current = root; ...
C#
UTF-8
5,246
2.6875
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Http; using System.Web.Http; using System.Web; using E_CommerceDbFirst.Models; using System.Data.Entity; using System.IO; using System.Threading.Tasks; using System.Diagnostics; namespace E_CommerceDbFirst.Controller...
Java
UTF-8
1,232
1.960938
2
[ "Apache-2.0" ]
permissive
/** * Copyright (c) 2015, www.cubbery.com. All rights reserved. */ package com.cubbery.event.conf; public interface ConfigureKeys { /**总线消费者数量**/ String BUS_CONSUME_COUNT = "bus.consume.count"; /**总线分发者数量**/ String BUS_DISPATCH_COUNT = "bus.dispatch.count"; /**总线时间单位**/ Strin...
Java
UTF-8
483
2.15625
2
[]
no_license
package com.project.teamup.mapper; import com.project.teamup.dto.CompanyDTO; import com.project.teamup.model.Company; import org.mapstruct.Mapper; import java.util.List; @Mapper public abstract class CompanyMapper { public abstract Company toEntity(CompanyDTO dto); public abstract List<Company> toEntityList...
Java
UTF-8
2,462
2.5
2
[]
no_license
package com.loosu.sample.adapter.base.listview; import android.support.annotation.NonNull; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import com.loosu.sample.adapter.base.IAViewHolder; ...
JavaScript
UTF-8
656
3.515625
4
[ "MIT" ]
permissive
function mergeSort(arr){ if(arr.length===1){ return arr } let center=Math.round(arr.length/2) let left=arr.slice(0,center); let right=arr.slice(center); return merge(mergeSort(left),mergeSort(right)) } function merge(left,right){ let result=[]; while(left.length && rig...
Java
UTF-8
805
2.75
3
[]
no_license
package domain.datamappers; import domain.Eigenaar; import exceptions.eigenexcepties.DatabaseFoutException; import java.sql.*; public class EigenaarDataMapper { public Eigenaar mapResultSetToDomain(ResultSet resultSet) { if (resultSet != null) { try { while (resultSet.next()) { ...
Python
UTF-8
2,616
2.6875
3
[]
no_license
from steem import Steem from steem.post import Post from steem.amount import Amount from steem.account import Account from dateutil.parser import parse from datetime import timedelta, datetime steem = Steem() post = Post("@steempytutorials/part-12-how-to-estimate-curation-rewards") # Everything we need to calculate ...
JavaScript
UTF-8
1,393
3.15625
3
[]
no_license
const { sumArr } = require('../helper-methods/helper-methods'); const parsePsw = (inputString) => { const [occurString, letter, psw] = inputString.split(' '); const [firstCondition, secondCondition] = occurString.split('-'); return { firstCondition, secondCondition, letter: letter....
Markdown
UTF-8
824
3.109375
3
[]
no_license
# Personal Blog Tutorial This project is used in my [Make A Personal Blog](https://gitauharrison-blog.herokuapp.com/personal-blog) tutorial series. Intentionally, I embark on showing how building a personal blog can be a fun side project to learn Flask and web development in general. If you can build your own blog fro...
Java
UTF-8
3,373
2.734375
3
[]
no_license
package com.ex.dao; import java.sql.CallableStatement; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.ArrayList; import com.ex.pojos.Artist; import com.ex.util.ConnectionFactory; import oracle.jdbc.in...
C++
UTF-8
4,661
2.578125
3
[ "MIT" ]
permissive
#pragma once #include <polyfem/utils/Types.hpp> #include <polyfem/solver/forms/parametrization/Parametrization.hpp> #include <polyfem/solver/forms/adjoint_forms/AdjointForm.hpp> namespace polyfem { class State; } namespace polyfem::solver { class ParametrizationForm : public AdjointForm { public: Parametrizati...
C++
UTF-8
2,028
2.75
3
[]
no_license
#include <bits/stdc++.h> using namespace std; using edge = tuple<int, int, int>; const int oo { 2000000010 }; class UnionFind { vector<int> parent, rank; public: UnionFind(int N) : parent(N + 1), rank(N + 1, 0) { iota(parent.begin(), parent.end(), 0); } bool same_set(int i, int j) {...
Java
UTF-8
1,802
2.109375
2
[]
no_license
package com.device.business.equip.dao; import java.math.BigDecimal; import java.util.List; import java.util.Map; import org.apache.ibatis.session.RowBounds; import org.springframework.beans.factory.annotation.Autowired; import com.device.business.equip.bean.PperdeepBean; import com.device.business.equip.bean.Pperdee...
C++
UTF-8
818
3.09375
3
[]
no_license
#include <iostream> #include <iomanip> #include <cmath> using namespace std; int main() { double amount, principal, rate, compounded, interest; cout << "What's the principal? "; cin >> principal; cout << "What's the interest rate? "; cin >> rate; cout << "How many times is interest compounded? "; cin >> compoun...
Java
UTF-8
1,423
3.21875
3
[]
no_license
/* ID: Jaeshi LANG: JAVA TASK: beads */ import java.io.*; public class beads { public static void main(String[] args) throws IOException { BufferedReader in = new BufferedReader(new FileReader("beads.in")); PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("beads.out"))); ...
JavaScript
UTF-8
406
3.0625
3
[]
no_license
//Create a react app from scratch. //It should display a h1 heading. //It should display an unordered list (bullet points). //It should contain 3 list elements. var React = require("react"); var ReactDOM = require("react-dom"); ReactDOM.render( <div> <h1>Hello World</h1> <ul> <li>Food</li> <li>Mi...