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
525
2.140625
2
[]
no_license
package br.com.findposto.model; import java.io.Serializable; /** * Created by Fernando on 14/05/2017. */ public class TipoServico implements Serializable { private static final long serialVersionUID = 6601006766832473959L; public int id; public Login idLogin; public String nome; @Override p...
Markdown
UTF-8
351
2.65625
3
[]
no_license
# npm-flames An NPM module to calculate flames game relationship, given 2 names. const flames = require('npm-flames'); const result = flames('name1', 'name2'); console.log(result); example const flames = require('npm-flames'); const result = flames('jagadeep', 'chiradep'); console.log(result); output Affection se...
Java
UTF-8
5,522
2.046875
2
[]
no_license
package in.jploft.esevak.ui.components.fragments.orderHistory; import android.annotation.SuppressLint; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import androidx.appcompat.app.AppCompatActivity; import androidx.databinding.DataBindingUtil; imp...
Python
UTF-8
6,686
2.578125
3
[]
no_license
import numpy as np import pandas as pd import datetime #Open and read csv's, filter all non-robotic batch numbers from df1 and save as df3 ##FUTURE: Try open using relative directory positions not full dir path. datapath = r"C:\Users\BHSB\Dropbox\Programming\Python\Projects\MolGen\SeqSucess\data" df1 = pd.read_csv(dat...
Java
UTF-8
608
2
2
[]
no_license
package com.lankydan.cassandra.movie.repository; import com.lankydan.cassandra.movie.entity.MovieByGenre; import com.lankydan.cassandra.movie.entity.MovieByGenreKey; import org.springframework.data.cassandra.repository.CassandraRepository; import org.springframework.stereotype.Repository; import java.time.LocalDateTi...
C++
UTF-8
866
2.703125
3
[]
no_license
#include <cstdio> #include <vector> #include <queue> using namespace std; vector<int> adj[100005]; bool gomgom[100005]; queue<int> q; int main() { int N, M; scanf("%d %d", &N, &M); for (int m = 0; m < M; m++) { int u, v; scanf("%d %d", &u, &v); adj[u].push_back(v); } int...
Java
UTF-8
326
2.84375
3
[]
no_license
class CarriageReturn { public static void main(String[] args) throws Exception { System.out.println("Syed \r Moonis \n Haider \f Abdi"); //Carriage Return will only move the cursor back to the beginning of the current line for(int i=0;i<=10;i++) { System.out.print(i+"\r"); Thread.sleep(250); } ...
Java
UTF-8
1,563
2.609375
3
[]
no_license
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package br.edu.ifpb.psd.lovymetal.DAO.managers; import br.edu.ifpb.psd.lovymetal.DAO.DAOFactory; import br.edu.ifpb.psd.lovymetal.DAO....
C++
UTF-8
601
2.8125
3
[ "MIT" ]
permissive
/* * SortTree.h * 二叉排序树 * Created on: 2014年5月19日 * Author: Jayin Ton */ #ifndef SORTTREE_H_ #define SORTTREE_H_ #include <iostream> using namespace std; #ifndef struct_node #define struct_node typedef struct _Node { int data; _Node *lchild, *rchild; } Node; #endif class SortTree { ...
Java
UTF-8
904
2.96875
3
[ "MIT" ]
permissive
/* * Copyright (c) 2014, Lukas Tenbrink. * http://lukas.axxim.net */ package ivorius.pandorasbox.random; import java.util.Random; /** * Created by lukas on 04.04.14. */ public class ValueHelper { public static int[] getValueRange(IValue value, Random random) { int[] result = new int[2]; ...
Python
UTF-8
2,474
3.609375
4
[ "MIT" ]
permissive
import abc from typing import Callable, Generic, Sequence, Tuple, TypeVar class State: def __init__(self, terminal: bool): self.terminal = terminal TState = TypeVar("TState", bound=State) TAction = TypeVar("TAction") class PSFAEnvironment(abc.ABC, Generic[TState, TAction]): """An environment with ...
PHP
UTF-8
2,756
3.3125
3
[]
no_license
<?php //plik z definicjami klas potrzebnymi do projektu //dane do polaczenia require('../conection.php'); class User { private $id; private $username; private $hashPass; private $email; public function __construct() { $this->id = -1; $this->username = ""; $this->hashPa...
C++
UTF-8
809
3.5625
4
[]
no_license
/* * @lc app=leetcode id=172 lang=cpp * * [172] Factorial Trailing Zeroes */ // 由2和5的数量决定 // 这种复杂度高 class Solution1 { public: int trailingZeroes(int n) { int two=0,five=0; for (int i = 1; i <= n; i++) { int number = i; while (number%2==0 && number>0) {...
Java
UTF-8
1,147
2.828125
3
[]
no_license
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package moving.logic; import java.util.ArrayList; import java.util.List; import moving.domain.Box; import moving.domain.Th...
Python
UTF-8
1,764
3.546875
4
[ "MIT" ]
permissive
"""630. Knight Shortest Path II """ DIRECTIONS = [(-1, -2), (1, -2), (-2, -1), (2, -1)] class Solution: """ @param grid: a chessboard included 0 and 1 @return: the shortest path """ def shortestPath2(self, grid): # write your code here ### m = len(grid) n = len(grid[0...
Python
UTF-8
2,441
2.859375
3
[]
no_license
#!/usr/bin/env python # coding: utf-8 # In[1]: import numpy as np # In[2]: import pandas as pd df = pd.read_csv('liver.csv') # In[3]: df # In[4]: train_data = df.drop(['Selector'],axis='columns') train_label = pd.DataFrame(df['Selector']) # In[5]: #split the data into 70% training and 30% testing fro...
Java
UTF-8
7,487
1.890625
2
[ "Apache-2.0" ]
permissive
/* * Copyright (c) 2017-2018 Runtime Inc. * Copyright (c) Intellinium SAS, 2014-present * * SPDX-License-Identifier: Apache-2.0 */ package io.runtime.mcumgr.managers; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.util.Date; import java.util.HashMap; import java...
Java
UTF-8
446
2.5625
3
[]
no_license
package ch.zhaw.exercise.le04a.task1; import java.io.Serializable; public class Fahrzeug implements Serializable { public static final long serialVersionUID = 1L; private String nummer; public Fahrzeug() { } public Fahrzeug(String nummer) { this.nummer = nummer; } public String...
Java
UTF-8
6,131
2.140625
2
[ "MIT" ]
permissive
package elasticsearchtest17; import static org.junit.Assert.*; import org.junit.*; import java.util.*; import java.io.*; import org.elasticsearch.action.bulk.*; import org.elasticsearch.common.transport.*; import org.elasticsearch.client.transport.*; import org.elasticsearch.common.settings.*; import org.elasticsea...
JavaScript
UTF-8
6,548
2.765625
3
[]
no_license
const messageService = require('../services/message') const {StatusCodes: HttpStatusCode} = require('http-status-codes'); const responseFormatter = require("../utils/response"); const { canConvertToPositiveInteger } = require('../utils/stringHelper'); const { isValidObjectId } = require("../utils/validator"); const deb...
Java
UTF-8
18,877
2.640625
3
[ "Apache-2.0" ]
permissive
package file.util; import com.yanghui.learn.common.IOUtils; import lombok.extern.slf4j.Slf4j; import javax.servlet.http.HttpServletResponse; import java.io.*; import java.net.URLEncoder; import java.nio.ByteBuffer; import java.nio.channels.Channels; import java.nio.channels.FileChannel; import java.nio.channels.Writa...
C#
UTF-8
2,997
2.640625
3
[]
no_license
using DataContextNamespace.Models; using DataServices; using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Http; using System.Web.Http; namespace MyTerm.Api.Controllers { public class SubCategoryController : ApiController { // GET api/<controller> ...
Java
UTF-8
1,443
2.46875
2
[]
no_license
package com.szboanda.iot.hub.handler; import io.netty.channel.ChannelHandler.*; import com.szboanda.iot.hub.tools.ServerContext; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelInboundHandlerAdapter; /** * Server运行时channel连接和断开事件捕获 * @author 康庆 * */ @Sharable public class ChannelS...
Markdown
UTF-8
13,659
3.03125
3
[ "MIT" ]
permissive
--- title: 한국어 격조사 category: Korean Linguistics tag: syntax --- 이번 글에서는 한국어의 격조사에 대해 살펴보도록 하겠습니다. 이번 글은 고려대 정연주 선생님 강의를 정리했음을 먼저 밝힙니다. 그럼 시작하겠습니다. ## 조사 조사란 주로 [명사구](https://ratsgo.github.io/korean%20linguistics/2017/07/13/syntax/) 뒤에 나타나서 선행하는 명사구가 다른 말과 맺는 문법적 관계를 나타내거나, 선행하는 명사구에 일정한 의미를 더하는 기능을 하는 말입니다. 예문을 ...
Java
UTF-8
4,397
2.5
2
[]
no_license
/******************************************************************************* * Copyright (c) 2014 Derigible Enterprises. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Derigible Public License v1.0 * which accompanies this distribution, and is avai...
Python
UTF-8
2,919
3.15625
3
[]
no_license
import pandas as pd import numpy as np # read full data raw_data = pd.read_csv("accepted_2007_to_2017.csv") # make a subset of data by randomly sampling (to work on it) # subset = raw_data.sample(n=int(len(raw_data)/100)) # pre-processing steps # 1 - find out null values # raw_data.isnull().sum() raw_data.info(verb...
Java
UTF-8
563
2.65625
3
[]
no_license
package epam.com.java.module1.collection.maintask.vegetables; import epam.com.java.module1.collection.maintask.vegetables.categories.RootVegetables; public class BeetRoot extends RootVegetables { private static final int KCAL_PER_100G = 47; public BeetRoot(){ super(VegetableName.BEET_ROOT, KCAL_PER_1...
Java
UTF-8
9,638
2.953125
3
[]
no_license
package com.comeaqui.eduardorodriguez.comeaqui.utilities; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.TimeZone; import java.util.concurrent.TimeUnit; import static com.comeaqui.eduardorodriguez.come...
Shell
UTF-8
2,890
4.34375
4
[]
no_license
#!/usr/bin/env bash declare -r NAGIOS_SUCCESS=0 NAGIOS_WARNING=1 NAGIOS_CRITICAL=2 NAGIOS_UNKNOWN=3 declare -r NEW_LINE=$(echo -e '\n') usage() { echo "Usage: $0 [ OPTIONS ] <domain.tld> Options -d debug -v verbosely print test steps (for testing only) " exit $NAGIOS_UNKNOWN } resolve_rec...
C++
UTF-8
949
2.765625
3
[]
no_license
/* * dataset obtained from https://pjreddie.com/projects/mnist-in-csv/ * Author: Shuhao Lai * Date: 12/27/2018 * Main.cpp */ #include <iostream> #include <ctime> #include "DigitClassifier.h" int main() { clock_t begin = clock(); std::vector<int> conditions = {784, 30, 10}; DigitClassifier test(conditions); s...
TypeScript
UTF-8
1,646
2.59375
3
[]
no_license
import { checker } from "./checker" import { observer } from "./observer" import { render } from "./render" export class validation{ private config:{"query":string} = { "query": "input" }; private chk: checker; private obsrv: observer; private r: render; constructor(config:any = {}){ if (config['...
Java
UTF-8
4,163
1.789063
2
[]
no_license
import java.util.List; import java.util.Random; public class bng extends bnn { private boolean a; public bng() {} public bng(bnk var1, int var2, Random var3, bjb var4, ej var5) { super(var1, var2); this.m = var5; this.l = var4; this.a = var3.nextBoolean(); } protected void a...
PHP
UTF-8
2,340
3.0625
3
[]
no_license
<?php //Form Init $title = ''; $email = ''; $ingredients = ''; //validation $errors = array('email'=>'', 'title'=>'', 'ingredients'=>''); if(isset($_POST['submit'])) { if(empty($_POST['email'])) { $errors['email'] = 'An Email is Required'; } else { $email = $_POST['email']; ...
Python
UTF-8
7,927
2.71875
3
[]
no_license
import os, datetime, json class PresetFile: def __init__(self, pathToFile): self.lineDic = {} self.maxTemp = 0 self.maxForce = 0 self.runTimeS = 0 self.minPressure = 99 self.lastAccess = '' self.runTime = '' self.loadFile(pathToFile) def loadFil...
TypeScript
UTF-8
1,053
3.21875
3
[ "MIT" ]
permissive
module Utils.Measurements { export class Size{ constructor (public width: number, public height: number){} } export class Dimensions { static fitRect(width1: number, height1: number, width2: number, height2: number): Size { var ratio1 = height1 / width1; var ratio2 ...
Python
UTF-8
605
2.828125
3
[]
no_license
from tools.tools_module import * from pyautogui import * import webbrowser query ="" def google_search(inputType,self): speak('Now Google is ready. Please tell me, What do you want to search?') global query if inputType in ['userInput']: query = prompt(text='Search Query', title='Say So...
C++
UTF-8
4,556
2.515625
3
[]
no_license
#include "MQ_SQNodes.hpp" #include "MQException.hpp" #include "MQT.hpp" namespace Galaxy { namespace AMQ { void CSQNode::Init() { _Next = 0L; _PageLKTB = 0L; _Length = 0U; } PBYTE CSQNode::NearPtr() const { return ((PBYTE)this)+ sizeof(*this); } void CSQNode::Next(const CSQNode *_TheNode) const { CSQNode *_Th...
C++
UTF-8
664
3.328125
3
[]
no_license
#ifndef Sofa_h #define Sofa_h #include <iostream> #include "Mebel.h" class Sofa : virtual public Mebel { public: friend std::ostream & operator<<(std::ostream &buffer, const Sofa &furniture) { furniture.print(buffer); return buffer; } Sofa(int w, int h, int l, int s) : Mebel(w, h, l), sedentary(s) {} //...
JavaScript
UTF-8
1,094
2.734375
3
[]
no_license
let express = require('express'); let router = express.Router(); let User = require('../models/user'); router.get('/form', ((req,res) =>{ res.render('form') })); // Register User router.post('/form', function(req, res){ let firstName = req.body.firstName; let lastName = req.body.lastName; let email = re...
Python
UTF-8
1,095
2.796875
3
[]
no_license
import sys import random from PyQt5.QtGui import QPainter, QColor from PyQt5.QtWidgets import QApplication, QMainWindow, QPushButton class MyWidget(QMainWindow): def __init__(self): super().__init__() self.setGeometry(300, 300, 420, 400) self.btn = QPushButton(self) self.btn.move...
Java
IBM852
472
2.484375
2
[]
no_license
package store.wine.model.dto; /** * Classe que recebe os dados do servio REST de atualizar status do pedido * @author eduardo * @version 1.0 * */ public class OrderStateDTO { private Integer orderId; private String state; public Integer getOrderId() { return orderId; } public void setOrderId(Integer ord...
C#
UTF-8
2,507
2.53125
3
[]
no_license
using System.Collections; using System.Collections.Generic; using UnityEngine; public class Brain : MonoBehaviour { public float speed = 8 //Bale pos no voy a decir nada, me gusta la idea pero kcyo dejame esta bien T.T , acceleration = 12 , jumpForce = 10 , currentSpeed , pla...
Java
UTF-8
1,805
2.296875
2
[]
no_license
package com.appsnipp.loginsamples; import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Button; import android.widget.ImageView; import android.widget.TextView; import static com.appsnipp.loginsamples.R.id.img_back; ...
Java
UTF-8
572
4.40625
4
[ "MIT" ]
permissive
// You are given a pointer to the root of a binary tree; print the values in inorder traversal. // Print the values on a single line separated by space. /* you only have to complete the function given below. * Node is defined as * * class Node { * int data; * Node left; * Node right; * } */ ...
TypeScript
UTF-8
2,116
2.8125
3
[ "MIT", "LicenseRef-scancode-generic-cla" ]
permissive
// Copyright (c) Microsoft Corporation. // Licensed under the MIT license. import { makeTextAnalyticsSuccessResult, TextAnalyticsSuccessResult, TextAnalyticsErrorResult, makeTextAnalyticsErrorResult } from "./textAnalyticsResult"; import { TextAnalyticsError, ExtractedDocumentSummary, ExtractedSummarySen...
C++
UTF-8
1,104
3.453125
3
[]
no_license
#include <iostream> #include <stdlib.h> //<cstdlib> #include <time.h> //<ctime> using namespace std; int main() { srand(time(NULL)); int myInt; myInt = rand() % 5 + 1; cout << myInt << endl; switch (myInt) { case 1: case 2: case 3: cout << "Oxen didn't like you, go to jail." << endl; break; cas...
Rust
UTF-8
2,985
3.1875
3
[]
no_license
/// From pythonesque use list::Node; mod list { use std::mem; #[derive(Show)] pub struct Node<T> { pub data: T, prev: Option<Box<Node<T>>>, next: Option<Box<Node<T>>> } impl<T> Node<T> { pub fn new(data: T) -> Node<T> { Node { data: data, prev: None, ...
C#
UTF-8
1,213
2.5625
3
[]
no_license
using UnityEngine; using UnityEngine.UI; public class ScoreBoard : MonoBehaviour { public static int scoreValue = 0; Text score; private void Start() { score = GetComponent<Text>(); } private void Update() { score.text = "SCORE: " + scoreValue; } } ...
C++
UTF-8
5,386
2.90625
3
[ "Apache-2.0" ]
permissive
// Copyright (c) 2015 Andrew Sutton // All rights reserved #include "beaker/graph.hpp" #include "beaker/type.hpp" #include "beaker/expr.hpp" #include "beaker/decl.hpp" #include "beaker/stmt.hpp" #include "beaker/unit.hpp" namespace beaker { namespace { using Id_map = std::unordered_map<Expr const*, int>; int put_...
Java
ISO-8859-1
1,500
3.171875
3
[]
no_license
import java.util.ArrayList; public class Pedidos { //ATRIBUTOS ArrayList<Produto> produtos = new ArrayList <Produto>(); //ACESSORES public ArrayList<Produto> getProdutos() { return produtos; } public Produto getProdutos(int i) { return produtos.get(i); } public void setProdutos(ArrayList...
Java
UTF-8
14,605
2
2
[]
no_license
package com.example.bebo2.publisher_news; import android.Manifest; import android.app.ProgressDialog; import android.content.Intent; import android.content.pm.PackageManager; import android.net.Uri; import android.support.annotation.NonNull; import android.support.v4.app.ActivityCompat; import android.support.v7.app....
Java
UTF-8
829
2.40625
2
[]
no_license
package com.souratech.beans; import java.io.File; import org.apache.log4j.Logger; import org.apache.log4j.PropertyConfigurator; public class PropertyFileLoggingRepotConfiguration { //Creating Logger Object private static Logger logger=Logger.getLogger(PropertyFileLoggingRepotConfiguration.class); public static v...
Go
UTF-8
1,519
2.9375
3
[]
no_license
package mycontainer import ( "fmt" "os" "os/exec" "syscall" //"github.com/sirupsen/logrus" ) //pid mount隔离 已经很像一个完整的系统了 //执行go run main.go run sh 发现系统彻底独立出来了 func MyPid() { if len(os.Args) < 2 { fmt.Printf("missing commands") return } switch os.Args[1] { case "run": run3() case "child": child3() de...
Java
UTF-8
1,025
3.203125
3
[]
no_license
package com.epam.test.automation.java.practice6; import java.math.BigDecimal; public class Company { private Employee[] staff; public Company(Employee[] employees) { this.staff = employees; } public void giveEverybodyBonus(BigDecimal companyBonus) { for (Employee item: staff){ ...
C#
UTF-8
2,252
2.828125
3
[]
no_license
using System.Globalization; using System.Threading; using System.Windows; using System.Windows.Controls; namespace MemoryGame { /// <summary> /// Lógica de interacción para Settings.xaml /// </summary> public partial class Settings : Window { private string _selectedTag; /...
Python
UTF-8
2,984
2.6875
3
[]
no_license
import sys import numpy as np import keras from keras.datasets import cifar10 from keras.preprocessing.image import ImageDataGenerator import matplotlib.pyplot as plt figsize = [10, 10] seed = 0 if len(sys.argv) == 1 else int(sys.argv[1]) (x_train, y_train), (x_test, y_test) = cifar10.load_data() y_train = keras.utils...
Python
UTF-8
548
3.234375
3
[]
no_license
import urllib2 from bs4 import BeautifulSoup quote_page = ‘http://www.bloomberg.com/quote/SPX:IND' # gets the html code of that url page = urllib2.urlopen(quote_page) # parse the html with BeautifulSoup soup = BeautifulSoup(page, ‘html.parser’) #because <h1 class = 'name'> S&P 500 Index </h1> name_box = soup.find(...
Python
UTF-8
2,678
2.71875
3
[]
no_license
# Example parameters. # * COPY THIS TO params.py TO USE * CALENDARS_TO_SCRAPE = [ "mfranzs123@gmail.com", ] # Time is broken down hierarchically. A tree is defined below. # Each item is either: # - A dictionary of sub-tasks # (ex. "Working" has sub-tasks" "Classes", "Learning", "Thinking", etc.) # - A specif...
Markdown
UTF-8
1,810
3.421875
3
[]
no_license
# Quickstart using Docker *** !!! attention This guide assumes that docker and docker-compose are already installed on your system. ([click here to download Docker](https://docs.docker.com/get-docker/)) ## Installing The following commands will initialise the file structure used by the Engine. Run the commands in...
Python
UTF-8
1,288
2.9375
3
[]
no_license
import sys sys.stdin = open('mine.txt','r') def IsSafe(y,x): if x>=0 and y>=0 and x<N and y<N: return True def mine_check(y,x): mine_count = 0 for dir in range(8): n_y = y + dy[dir] n_x = x + dx[dir] if IsSafe(n_y,n_x) and field[n_y][n_x] == '*': mine_count += ...
Java
UTF-8
29,425
2
2
[]
no_license
package core.entity.warrior.base; import api.core.Owner; import api.entity.stuff.Artifact; import api.enums.OwnerTypeEnum; import api.enums.TargetTypeEnum; import api.game.ability.Influencer; import api.core.Result; import api.game.ability.Ability; import api.game.ability.Modifier; import api.entity.warrior.*; import ...
PHP
UTF-8
1,627
2.515625
3
[]
no_license
<?php namespace Tests; use App\Models\User; use Facebook\WebDriver\Chrome\ChromeOptions; use Facebook\WebDriver\Remote\DesiredCapabilities; use Facebook\WebDriver\Remote\RemoteWebDriver; use Laravel\Dusk\TestCase as BaseTestCase; abstract class DuskTestCase extends BaseTestCase { use CreatesApplication; /**...
JavaScript
UTF-8
704
2.765625
3
[]
no_license
// Export model functions as a module const sha256 = require('js-sha256'); module.exports = (dbPoolInstance) => { // `dbPoolInstance` is accessible within this function scope const registerAccount = (name, password, callback) => { //const hashedPassword = sha256(password); const queryString = `INSERT I...
C#
UTF-8
1,959
3.734375
4
[]
no_license
using System; namespace Exercises { class Program { static void Main(string[] args) { Console.OutputEncoding = System.Text.Encoding.UTF8; Exercise2(); } static void Exercise1() { const double MilimetersInOneInch = 25.4; C...
Python
UTF-8
7,076
2.703125
3
[]
no_license
# import the necessary packages from imutils.perspective import four_point_transform from imutils import contours import numpy as np import imutils import cv2 from cnn_load_inference import process_letter_field, process_digit_field def rescale_frame(frame, percent=50): width = int(frame.shape[1] * percent / 100) ...
PHP
UTF-8
1,615
2.90625
3
[]
no_license
<?php require_once 'DatabaseHelper.php'; class Weather extends DatabaseHelper{ public function __construct() { parent::__construct(); } public function getWeather($town) { $results = array(); if(empty($town)){ //Return an empty array return ...
TypeScript
UTF-8
1,366
2.625
3
[]
no_license
import { Controller } from './controller'; import { TimeUtil } from '@util'; import * as moment from 'moment'; export abstract class RuleResponse { Id: string; RuleGroupId: string; IsActive: boolean; DisplayName?: string; } export abstract class Rule { Id: string; RuleGroupId: string; IsActive = true; ...
Java
UTF-8
1,555
2.375
2
[]
no_license
package cr.ac.ucr.kabekuritechstore.form; import javax.validation.constraints.Min; public class ProductForm { private int id; @Min(2) private int unitsOnStock; private int idCategory; private String name, description, image_url; private float price; ...
Python
UTF-8
1,804
2.78125
3
[]
no_license
# -*- coding:utf-8 -*- import unittest import json class TestDictCompare(unittest.TestCase): def test_json_same_keys(self): self.maxDiff = None oldJson = json.loads('{"hello":"world","success":true}') newJson = json.loads('{"hello":"world","success":true}') self.assertDictEqual(old...
Java
UTF-8
351
2.828125
3
[]
no_license
package com.teamtter.simpleclient; import com.teamtter.simpleservice.SimpleService; public class SimpleClient { public static void main(String args[]) { System.out.println("SimpleClient running"); SimpleService service = new SimpleService(); int result = service.computePlus(2, 3); System.out.println("Simple...
C++
UTF-8
1,272
3.578125
4
[]
no_license
class Solution { public: bool canPermutePalindrome(string s) { int num[128] = {0}; for(char c : s) { num[c]++; } bool odd = false; for(int n = 0; n < 128; ++n) { if(num[n] % 2 == 1) { if(!odd) ...
C#
UTF-8
1,446
2.609375
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using DAL; using Model; namespace BLL { public class ProductServices { ProductManager pm = new ProductManager(); public int Add(Product product) { return pm.A...
Java
UTF-8
454
1.914063
2
[ "Apache-2.0" ]
permissive
package com.researchspace.figshare.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; /** * Either name or id can be set. * @author rspace * */ @Data @NoArgs...
C++
UTF-8
211
2.796875
3
[]
no_license
#include <iostream> #include <string> using namespace std; int main(){ cout<<"Please enter your first name:"<<endl; string name; cin >> name; cout<<"Your name is" << name << " " << endl; return 0; }
Python
UTF-8
11,164
2.828125
3
[]
no_license
#importation de toutes nos classes import pygame from bouton import* from menu import* from player import* from ennemi import* from sol import* from random import* from score import* from gameover import* from malus import * from bonus import * class Jeu: def __init__(self,ecran,menu): se...
Python
UTF-8
1,627
3.234375
3
[]
no_license
''' Created on Dec 5, 2016 @author: Yovela ''' ''' this is the main function for assignment9 ''' import sys import pandas as pd import numpy as np import matplotlib.pyplot as plt from classes import * from functions import * # load the countries.csv file into a pandas DataFrame and name this data set "countries" co...
C
UTF-8
2,561
3.0625
3
[]
no_license
#include<stdio.h> int source, V, E, time, visited[20], G[20][20]; void DFS(int i) { int j; visited[i]= 1; printf("%d -> ", i+1); for(j=0;j<V;j++) { if(G[i][j] == 1 && visited[j] == 0) DFS(j); } } int main() { int i,j,v1, v2; printf("\t\t\tGraphs \n"); printf("Enter the number of edges: \...
Markdown
UTF-8
696
2.65625
3
[ "MIT" ]
permissive
## PhotoPay SDK size report This SDK size report is for all supported ABIs. We use the Android official [**apkanalyzer**](https://developer.android.com/studio/command-line/apkanalyzer) command line tool to calculate the sizes. **NOTE**: Presented APK sizes are sums of the `base APK size` + `size of our SDK`. Roughly,...
Java
UTF-8
240
1.539063
2
[ "Apache-2.0" ]
permissive
package io.github.r2d2project.core.dao; import io.github.r2d2project.core.dto.api.logs.GetRequest; import io.github.r2d2project.core.dto.api.logs.GetResponse; public interface LogReadDao { GetResponse readAdvance(GetRequest request); }
C++
UTF-8
4,153
3.046875
3
[]
no_license
#pragma once #include <vector> #include <string> #include <unordered_map> #include <exception> #include <stdexcept> #include <iostream> #include <fstream> #include <limits> #include <boost/lexical_cast.hpp> #include <boost/algorithm/string.hpp> #include <boost/algorithm/string/split.hpp> #include <boost/algorithm/str...
JavaScript
UTF-8
3,116
4.71875
5
[]
no_license
/* 1. Declare uma variável de nome weight R: var weight */ //----------------------------------------------------------------------------------- // 2. Que tipo de dado é a variavel acima? //console.log(typeof weight) //----------------------------------------------------------------------------------- /* 3. Decla...
C++
UTF-8
257
2.6875
3
[]
no_license
//16. Program to print stars Sequence1. //* //** //*** //**** //***** #include<iostream> using namespace std; int main() { for(int i=0;i<=5;i++) { for(int j=0;j<i;j++) { cout<<"*"; } cout<<" \n "; } return 0; }
Python
UTF-8
3,869
3
3
[]
no_license
import functools import numpy as np TILE_SIZE = 8 PUZZLE_SIZE = 12 ACTIONS = [ lambda tile: tile, lambda tile: np.rot90(tile), lambda tile: np.rot90(tile), lambda tile: np.rot90(tile), lambda tile: np.flip(tile, axis=0), lambda tile: np.rot90(tile), lambda tile: np.rot90(tile), lambda...
Shell
UTF-8
265
2.515625
3
[]
no_license
#!/bin/bash # Terminate already running bar instances killall -q polybar # Wait until the processes have been shut down while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done # Launch bar polybar bar --config=/home/chew/.config/i3/bar/polybar/config_bottom
Java
UTF-8
763
2.65625
3
[]
no_license
package learn.how2j.io; import com.sun.org.apache.xpath.internal.SourceTree; import java.io.File; import java.io.IOException; /** * Created by qqins on 2017/12/3 16:46 */ public class Test { public static void main(String[] args) throws IOException { File f1 = new File("d:/111"); if(!f1.exists(...
Python
UTF-8
819
2.71875
3
[ "MIT" ]
permissive
import os import mayaunittest from maya import cmds import omtk class NomenclatureTestCase(mayaunittest.TestCase): def test(self): from omtk.core.className import BaseName # Construct a naming from scratch n = BaseName(tokens=['eye', 'jnt'], side=BaseName.SIDE_L) self.assertEqual(...
C++
UTF-8
1,466
2.765625
3
[]
no_license
/** \file Declaration of class erhic::VirtualEvent. \author Thomas Burton \date 2011-08-19 \copyright 2011 Brookhaven National Lab */ #ifndef INCLUDE_EICSMEAR_ERHIC_VIRTUALEVENT_H_ #define INCLUDE_EICSMEAR_ERHIC_VIRTUALEVENT_H_ #include <TObject.h> #include <vector> namespace erhic { class VirtualP...
JavaScript
UTF-8
621
3.09375
3
[ "Apache-2.0" ]
permissive
import complement from './complement' describe('complement', () => { test('complements a given function', () => { const isEven = (value) => value % 2 === 0 const isOdd = complement(isEven) expect(isOdd(1)).toBe(true) }) test('throws an error if complement does not receive a function', () => { ex...
Java
UTF-8
509
2.21875
2
[ "WTFPL" ]
permissive
package error998.tutor.items; import net.minecraft.item.Item; import net.minecraft.item.ItemFood; import error998.tutor.Reference; import error998.tutor.Tutor; public class ItemCheeseCracker extends ItemFood { public ItemCheeseCracker() { // Hunger bar, saturation, isWolfFood super(3, 0.5f, true); setUnlo...
C++
UTF-8
3,616
2.71875
3
[]
no_license
#include <iostream> #include <sstream> #include <string> #include "vertex.h" #include <vector> #include "prim.h" #include <map> #include <algorithm> using namespace std; bool comparator(vertex &a, vertex &b){ if(a.x==b.x) return a.y<b.y; else return a.x<b.x; } void prim::cre...
JavaScript
UTF-8
17,494
3.203125
3
[ "MIT" ]
permissive
'use strict'; /** * The constructor for CSV.parse(); copies the syntax for JSON.parse() * @constructor * @param {stringResolvable} str - The raw CSV string to be parsed to a JavaScript object * @param {[ParseOptions]} options - set of optional parameters to specify custom input data or change format of output data...
SQL
UTF-8
3,031
3.234375
3
[ "MIT" ]
permissive
-- phpMyAdmin SQL Dump -- version 4.9.1 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Creation time: 03. Dez 2019 um 16:28 -- Server version: 10.4.8-MariaDB -- PHP version: 7.3.11 -- Made by QuickWrite for the php-login-system generated by phpMyAdmin SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = ...
Java
UTF-8
4,199
1.789063
2
[]
no_license
package org.jboss.tools.bpmn2.ui.bot.complex.test.testcase; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import java.util.Arrays; import org.jboss.tools.bpmn2.reddeer.editor.ConnectionType; import org.jboss.tools.bpmn2.reddeer.editor.ElementType; import org.jboss.tools.bpm...
C++
UHC
1,346
3.421875
3
[ "MIT" ]
permissive
#include "Shop.h" Shop::Shop(int *energy) :curEnergy(energy), itemNum(0) { for (int idx = 0; idx < ITEM_NUM; idx++) { itemCountList[idx] = 0; } } Item* Shop::sell(int idx) { Item* tempItem = NULL; if (0 <= idx && idx < itemNum) { tempItem = itemList[idx]; } else { return NULL; } // ȮѴ. if (*curEn...
Shell
UTF-8
393
3.03125
3
[ "MIT" ]
permissive
#!/usr/bin/env bash set -e DOWNLOAD_URL='http://registrationcenter-download.intel.com/akdlm/irc_nas/tec/16533/l_mkl_2020.1.217.tgz' echo Installing Intel MKL 2020 Update 1 apt-get update && apt-get install -y \ build-essential cpio gcc g++ cmake doxygen echo 'Downloading Intel MKL source code' wget -O intel-mkl.zi...
JavaScript
UTF-8
527
2.578125
3
[]
no_license
const customExpress = require("./config/configExpress"); const db = require("./config/configPostgreSQL") const port = 3001; db.connect(err => { if (err) { console.log(err) } else { db.query("SELECT * from NOW()", (err, res) => { if (err) { console.log(err) } else{ ...
Python
UTF-8
1,918
3.671875
4
[]
no_license
#!/usr/bin/python # -*- coding: utf-8 -*- ''' Задание 15.4a Создать функцию convert_to_dict, которая ожидает два аргумента: * список с названиями полей * список кортежей с результатами отработки функции parse_sh_ip_int_br из задания 15.4 Функция возвращает результат в виде списка словарей (порядок полей может быть др...
Java
UTF-8
1,777
2.921875
3
[]
no_license
package practicestring; import java.text.DateFormat; import java.text.NumberFormat; import java.util.Date; import java.util.Locale; public class LocaleDemo { public static void main(String[] args) { Locale locale = new Locale("ru", "RU"); double lamboPrice = 180000.99; NumberFormat numb...
Java
UTF-8
11,114
2.0625
2
[]
no_license
package com.els.romenext.api.preferences; import javax.ws.rs.Consumes; import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.PUT; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.ResponseBuilde...
Shell
UTF-8
1,133
3.9375
4
[]
no_license
#!/bin/sh # __ _ _ # / _(_) | ___ ___ # | |_| | |/ _ \/ __| # _| _| | | __/\__ \ # (_)_| |_|_|\___||___/ # set -e set -u is_available() { which "$1" >/dev/null 2>&1 return $? } if [ -z "${DOTPATH:-}" ]; then DOTPATH=~/.dotfiles; export DOTPATH fi DOTGIT="https://github.com/nobuyo/dotfiles.git"; ...