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 | 1,015 | 3.234375 | 3 | [] | no_license | package com.example.demo;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
public class StringReader {
public String x;
public String StringReader(String str){
Map<Character,Integer> ContadordeChars = new HashMap<>();
for(Character c :... |
Java | UTF-8 | 373 | 2.609375 | 3 | [
"BSD-3-Clause"
] | permissive | // .result=COMPILE_PASS
import java.io.EOFException;
import java.io.IOException;
import java.util.*;
public class Test {
public interface A {
int m();
}
public interface B {
default int m() {
return 5;
}
}
public class Inner extends Test implements B {
public int m() {
return 3;
}
public... |
C | UTF-8 | 194 | 3.046875 | 3 | [] | no_license | #include <stdio.h>
#include <pwd.h>
int main(int argc, char **argv){
struct passwd *u;
while( (u = getpwent()) != NULL) {
if (u->pw_uid >=1000)
printf("%s\n", u->pw_name);
}
}
|
TypeScript | UTF-8 | 506 | 2.53125 | 3 | [] | no_license | import { PipeTransform, Pipe } from '@angular/core';
import { ITableviews } from './tableviews';
@Pipe({
name: 'tableviewsFilterPipe'
})
export class tableviewsFilterPipe implements PipeTransform {
transform(value: ITableviews[], filterBy: string): ITableviews[] {
filterBy = filterBy ? filterBy.toLoc... |
TypeScript | UTF-8 | 6,490 | 2.734375 | 3 | [
"MIT"
] | permissive | import { asyncScheduler, merge, of, VirtualTimeScheduler } from 'rxjs';
import { delay, observeOn, subscribeOn } from 'rxjs/operators';
import { createModule } from '../../src/createModule';
import { Epic } from '../../src/Epic';
import { Deps } from '../../src/types';
async function runEpic<T = any[]>(
sourceEpic: ... |
Java | UTF-8 | 3,479 | 2.25 | 2 | [] | no_license | package com.example.book_search;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Pr... |
TypeScript | UTF-8 | 707 | 2.53125 | 3 | [] | no_license | import { Document } from 'mongoose';
import { ITeamDocument } from './teams.types';
export function isTeamCreator(this: ITeamDocument, userID: string): boolean {
return this.createdBy === userID;
}
export async function deleteTeam(this: ITeamDocument): Promise<void> {
await this.remove();
return;
}
export asyn... |
C | UTF-8 | 396 | 2.765625 | 3 | [] | no_license | #ifndef _D_LIST_STACK_H_
#define _D_LIST_STACK_H_
#define MAX_STACK_SIZE 100
#define STACK_INCREMENT 10
#define ERROR -1
#define OK 0
typedef int ElemType;
typedef struct
{
ElemType *bottom;
ElemType *top;
int stacksize;
}SqStack;
int init_stack(SqStack *S);
int push(SqStack *S,ElemT... |
JavaScript | UTF-8 | 533 | 2.796875 | 3 | [] | no_license | const testimonial = [...document.querySelectorAll('.testimonial')];
const leftArrows = [...document.querySelectorAll('.left-button')];
const rightArrows = [...document.querySelectorAll('.right-button')];
function newSlide(e){
testimonial.forEach((slide) => {
slide.classList.toggle('hide');
sl... |
Python | UTF-8 | 230 | 2.625 | 3 | [] | no_license | from PIL import Image
import numpy as np
image = Image.open('test03.png')
img_resized = image.resize((96,96))
F_image = image.convert(mode='L')
F_image= F_image.save("test03_bw.png")
arr=np.asarray(F_image)
print(arr)
|
Java | UTF-8 | 211 | 1.6875 | 2 | [] | no_license | package com.psycorp.security;
/**
* @author Vitaliy Proskura
*/
public class SecurityConstant {
public static final String ACCESS_TOKEN_PREFIX = "Bearer";
public static final String JWT_TOKEN_PREFIX = "Jwt";
}
|
JavaScript | UTF-8 | 1,086 | 4.21875 | 4 | [] | no_license | // In this kata you are required to, given a string, replace every letter with its position in the alphabet.
// If anything in the text isn't a letter, ignore it and don't return it.
// "a" = 1, "b" = 2, etc.
//use charCodeAt to have the ASCII code of each letter
//since alphabet starts at 97 in ASCII (a=97) and end... |
Markdown | UTF-8 | 7,764 | 2.515625 | 3 | [] | no_license | ## ssh综合练习(本项目可见ssh-practice的仓库)
### jar包导入
### 包的建立
### 注解环境搭建
struts2的bug,在action上面@Controller没用,因为在spring去创建action的时候,beanname是由struts传过去的,不管有没有controller(有没有将action纳入spring的管理),spring都能根据beanname这个类名去运用反射创建action
注意:
spring整合struts和hibernate,在applicationContext.xml中的三点配置
1. spring注解开发中,要在applicationContext里面配置<c... |
Java | UTF-8 | 560 | 2.1875 | 2 | [] | no_license | package com.wisdom.contactus.utils;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.springframework.jdbc.core.RowMapper;
import com.wisdom.common.model.Attachment;
import com.wisdom.common.model.ContactUs;
public class ContactUsMapper implements RowMapper<ContactUs> {
public ContactUs mapRow(Re... |
Python | UTF-8 | 3,724 | 2.609375 | 3 | [] | no_license | from discord.ext import commands
import discord
import Prefix
class utility(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command()
@commands.has_permissions(manage_roles=True)
async def mute(self, ctx, member : discord.Member, *, reason):
if memeber == None:
... |
PHP | UTF-8 | 940 | 3.109375 | 3 | [] | no_license | <?php
require_once __DIR__ . "/User.php";
class Customer extends User {
private $country;
private $city;
private $zipCode;
private $address;
private $age;
private $delivery;
function __construct($username, $password, $mail, $country, $city, $... |
Java | UTF-8 | 4,710 | 2.25 | 2 | [
"BSD-3-Clause"
] | permissive | package com.openxc.ford.mHealth.demo.tasks;
import java.util.ArrayList;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import android.os.AsyncTask;
import com.openxc.ford.mHealth.demo.AppLog;
import com.openxc.ford.mHealth.demo.Constants;
import com.openxc.ford.mHealth.demo.mo... |
Java | UTF-8 | 1,094 | 2.71875 | 3 | [] | no_license | import javax.servlet.*;
import javax.servlet.http.*; // расширение javax.servlet для http
import java.io.*;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Enumeration;
public class Bbb extends HttpServlet implements Servlet {
protected void service(HttpServletRequest req, HttpServletRes... |
Java | UTF-8 | 14,079 | 2.15625 | 2 | [
"Apache-2.0"
] | permissive | package org.gbif.occurrence.processor.interpreting;
import org.gbif.api.model.occurrence.Occurrence;
import org.gbif.api.model.occurrence.VerbatimOccurrence;
import org.gbif.api.vocabulary.OccurrenceIssue;
import org.gbif.common.parsers.core.ParseResult;
import org.gbif.dwc.terms.DcTerm;
import org.gbif.dwc.terms.DwcT... |
C# | UTF-8 | 3,430 | 3.03125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
namespace Chessington.GameEngine.Pieces
{
public class Pawn : Piece
{
public Pawn(Player player)
: base(player) { }
public Square Position { get; set; }
public override IEnumerable<Square> GetAvailableMoves... |
PHP | UTF-8 | 2,897 | 2.625 | 3 | [
"LicenseRef-scancode-other-permissive"
] | permissive | <?php
$student_id = $_POST['student_id'];
$student_name = $_POST['student_name'];
$student_fname = $_POST['student_fname'];
$student_mname = $_POST['student_mname'];
$gender = $_POST['gender'];
$address = $_POST['address'];
$mobile = $_POST['mobile'];
$email = $_POST['email'];
$class = $_POST['class'];
$roll ... |
JavaScript | UTF-8 | 6,169 | 2.59375 | 3 | [] | no_license | let isProcessPending = false; // for stopping multiple request simultaneously
let recordsPerPage = 2; // you can set as you want to get data per ajax request
let recordsOffset = 0; // get data from given no
let recordsTotal = 0; // store total number of record
let tweets_list = [];
//get first time article as page load... |
Java | UTF-8 | 179 | 2.890625 | 3 | [] | no_license |
public class Compra {
protected double valorCompra;
public Compra(Double valor) {
this.valorCompra += valor;
}
public double total() {
return this.valorCompra;
}
}
|
JavaScript | UTF-8 | 6,436 | 2.515625 | 3 | [] | no_license | /*
* This file holds all the redirections services
*
*/
var baseURL; // holds the base url of the website
$(document).ready(function(){
//First choice for local host, Second choice for remote Server
baseURL = window.location.protocol + "//" + window.location.host + "/" + window.location.pathname.split('/')[1];... |
Python | UTF-8 | 338 | 3.03125 | 3 | [] | no_license | class Solution(object):
def maxProfit(self, prices):
"""
:type prices: List[int]
:rtype: int
"""
res = 0
cur = 0
for i in range(1, len(prices)):
cur = cur + prices[i] - prices[i - 1]
cur = max(0, cur)
res = max(res, cur)
... |
Java | UTF-8 | 1,726 | 2.484375 | 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 JPA1;
import javafx.stage.Stage;
import static org.testng.Assert.*;
import org.testng.annotations.AfterClass;
import... |
C++ | UTF-8 | 14,231 | 2.546875 | 3 | [] | no_license | #include "sensirion_sf04.h"
//===========================================================================
// Default constructor
SF04::SF04(I2C &i2c, int i2cAddress, int calField, int resolution) : i2c(i2c), mi2cAddress(i2cAddress << 1)
//===========================================================================... |
Markdown | UTF-8 | 63,210 | 3.71875 | 4 | [] | no_license |
#### 第 5 章
<J7T]
### 语句
内容
........................ 178
..................................................................................................................178
和大多数语言一样,C++提供了条件执行语句、重复执行相同代码的循环语句和用于 中断当前控制流的跳转语句。本章将详细介绍 C++语言所支持的这些语句。
Ht2> 通常情况下,语句是顺序执行的。但除非是最简单的程序,否则仅有顺序执行远远不
够。因此,C++语言提供了一... |
Java | UTF-8 | 679 | 2.515625 | 3 | [] | no_license | package com.example.leaderboard;
public class Form {
private String email;
private String firstName;
private String lastName;
private String linkToGithub;
public Form( String firstName, String lastName, String email, String linkToGithub) {
this.email = email;
this.firstName = firs... |
JavaScript | UTF-8 | 794 | 2.578125 | 3 | [] | no_license | const express = require('express');
const axios = require('axios');
const cheerio = require('cheerio');
const app = express();
const PORT = 5000;
const url = 'https://en.wikipedia.org/wiki/List_of_United_States_military_bases'
axios(url)
.then(res => {
const html = res.data
// console.log(html)... |
Java | UTF-8 | 3,215 | 2.65625 | 3 | [] | no_license | package edu.ucdavis.ucdh.stu.core.manager.impl;
import java.util.Date;
import java.util.List;
import edu.ucdavis.ucdh.stu.core.beans.BatchJobInstance;
import edu.ucdavis.ucdh.stu.core.dao.BatchJobInstanceDao;
import edu.ucdavis.ucdh.stu.core.manager.BatchJobInstanceManager;
/**
* <p>Concrete implementatio... |
Swift | UTF-8 | 2,317 | 2.578125 | 3 | [] | no_license | //
// Driver.swift
// Project Recycle
//
// Created by Students on 11/29/16.
// Copyright © 2016 Lee Yik Sheng. All rights reserved.
//
import Foundation
import FirebaseAuth
import FirebaseDatabase
import UIKit
class Driver{
var name: String
var email: String
var phoneNumber: String
var profile... |
Python | UTF-8 | 1,869 | 2.6875 | 3 | [] | no_license | from argparse import ArgumentParser
parser = ArgumentParser()
parser.add_argument('dir', help='Processed power data directory.')
parser.add_argument(
'file', nargs='?', default=None,
help="""Resampled power NetCDF save file.
(default: {dir}/pwr_resampled@{t0}--{t1}.nc)""",
)
parser.add_argument(
... |
Java | UTF-8 | 279 | 2.546875 | 3 | [] | no_license |
public class SubjectTest {
public static void main(String[] args) {
Subject sbj1 = new Subject();
sbj1.name = "자바프로그래밍";
// sbj1.score = -100;
sbj1.setScore(-100);
System.out.println(sbj1.getScore());
// System.out.println(sbj1.name + sbj1.score);
}
}
|
Java | UTF-8 | 813 | 1.867188 | 2 | [] | no_license | package kodlamaio.hrmsdemo.entities.dtos;
import kodlamaio.hrmsdemo.entities.concretes.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.CreationTimestamp;
import javax.persistence.*;
import java.sql.Date;
import java.time.LocalDateTime;
import ... |
Java | UTF-8 | 1,482 | 2.609375 | 3 | [] | no_license | package net.fenton.core.command;
import net.fenton.core.player.FentonPlayer;
import net.fenton.core.player.FentonPlayerHandler;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
/**
* Creat... |
Java | UTF-8 | 131 | 1.859375 | 2 | [
"Apache-2.0"
] | permissive | package io.github.dondragon2.spring.nonblocking.callbacks;
public interface VoidCallback {
void process() throws Exception;
}
|
Shell | UTF-8 | 445 | 3.125 | 3 | [] | no_license | #!/bin/sh
if [[ "${SKIP_INSTALL}" == "YES" || "${WK_PLATFORM_NAME}" == maccatalyst || "${WK_PLATFORM_NAME}" == iosmac ]]; then
exit 0;
fi
for (( i = 0; i < ${SCRIPT_INPUT_FILE_COUNT}; i++ )); do
eval SRC_PLIST=\${SCRIPT_INPUT_FILE_${i}}
eval DST_PLIST=\${SCRIPT_OUTPUT_FILE_${i}}
DST_PLIST_DIR=$(dirnam... |
Java | UTF-8 | 421 | 2.6875 | 3 | [] | no_license | package com.example.gofp.head_first.sol.behavioral.strategy.classes;
import com.example.gofp.binding.Systems;
public class DecoyDuck extends Duck {
public DecoyDuck() {
this.quackBehaviour = new Squeak();
this.flyBehaviour = new NoFly();
this.swimBehaviour = new NoSwim();
}
... |
Java | UTF-8 | 204 | 1.726563 | 2 | [] | no_license | package com.cchao.simplelib.ui.interfaces;
/**
* Description: 加载View
*
* @author cchao
* @version 2017/8/4
*/
public interface ILoadingView {
void showLoading();
void hideLoading();
}
|
Java | UTF-8 | 1,278 | 2.96875 | 3 | [] | no_license | package com.wangdong.multithreadprogram.shizhanzhinan.chapterthree;
import lombok.extern.slf4j.Slf4j;
import java.util.HashMap;
import java.util.Map;
/**
* @description: 3-26
* @author wangdong
*/
@Slf4j
public class StaticVisibilityExample {
private static Map<String, String> taskConfig;
static {
... |
C++ | UTF-8 | 277 | 2.84375 | 3 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
#define REP(i, n) for(int i = 0; i < (int)(n); i++ )
int main()
{
string o, e;
cin >> o >> e;
REP(i, e.length())
cout << o[i] << e[i];
if(o.length() - e.length() == 1) cout << o.back();
cout << endl;
}
|
Python | UTF-8 | 828 | 2.65625 | 3 | [] | no_license | from ADT.ADTNode import ADTNode
class SequenceNode(ADTNode):
def accept(self, visitor):
return visitor.visit_sequence(self)
CDTNameAsBlock = "c.CASTCompoundStatement"
CDTNameAsExpression = "c.CASTExpressionList"
def __init__(self, id, nodes, resolverUtil):
super().__init__(id)
... |
C++ | UTF-8 | 5,367 | 3.28125 | 3 | [] | no_license | #define BUMPER_L_LED 12 // the pin for the left bumper LED
#define BUMPER_C_LED 9 // the pin for the centre bumper LED
#define BUMPER_R_LED 4 // the pin for the right bumper LED
#define SPEED_LED1 8 // the pin for the LED
#define SPEED_LED2 7 // the pin for the LED
#define SPEED_LED3 6 // the pin for t... |
Java | WINDOWS-1250 | 2,728 | 3.25 | 3 | [] | no_license | package prima3;
/**
*
* @author alex
*
*/
public class Prima3 {
public Prima3() {};
/***
* Permite verificar si una persona es apta para reduccion de pago de PRIMA
* @param puntos puntos de la licencia
* @param puntosQuePuedePerder, cantidad de puntos que puede perder
* @return boolean
*/
... |
Markdown | UTF-8 | 448 | 2.828125 | 3 | [] | no_license | * 100% (1 lb, 453g) Cheese
* 100% (1 lb, 453g) Milk or other fluid
* 4% (18.12g) Sodium Citrate
* 1.33% (6g) Salt
* 0.5% (2.3g) Sodium Hexametaphosphate
**Sous vide**
1. Cube cheese, and seal everything in a bag.
1. Sous vide at 75c for 15 minutes.
1. Blend until smooth.
**Sauce Pan**
1. In medium saucepan, combine c... |
Python | UTF-8 | 2,606 | 2.65625 | 3 | [
"Apache-2.0"
] | permissive | import abc
from pypika.terms import Function
from pypika.utils import format_alias_sql
class _AbstractSearchString(Function, metaclass=abc.ABCMeta):
def __init__(self, name, pattern: str, alias: str = None):
super(_AbstractSearchString, self).__init__(self.clickhouse_function(), name, alias=alias)
... |
Java | UTF-8 | 224 | 2.3125 | 2 | [] | no_license | package com.bridgelabz.practiceProblem.CabInvoiceGenerator;
public class Ride {
public double distance;
public double time;
public Ride(double distance,double time)
{
this.distance=distance;
this.time=time;
}
}
|
Python | UTF-8 | 4,940 | 2.71875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
__author__ = 'Wyben Gu'
'''
Models for user,blog,comment.
'''
from app import db
from datetime import datetime
def dump_datetime(value):
"""Deserialize datetime object into string form for JSON processing."""
if value is None:
return None
return value.strftime("%Y-%m-%d %... |
C | UTF-8 | 10,354 | 2.9375 | 3 | [] | no_license |
#include <sys/types.h>
#include <ctype.h>
#include <stdlib.h>
#include <assert.h>
#include <regex.h>
#include "finder.h"
#include "pattern.h"
/*----------------------------------------------------------------------
* private types
*----------------------------------------------------------------------*/
#define ST... |
Java | UHC | 741 | 3.109375 | 3 | [] | no_license | package day08; //Ŭ̾Ʈ Ӱ ʿϴ.SimpleServer Ŭ
import java.io.InputStream;
import java.net.Socket;
import java.util.Arrays;
public class SocketTest {
public static void main(String[] args)throws Exception {
// TODO Auto-generated method stub
Socket socket = new Socket("localhost", 8888);
System.out.pr... |
C++ | UTF-8 | 490 | 2.703125 | 3 | [] | no_license | class Solution {
public:
int wiggleMaxLength(vector<int>& nums) {
int n = nums.size();
if(n<2)
{
return n;
}
int prediff = nums[1]-nums[0];
int ret = prediff!=0?2:1;
for(int i=2;i<n;++i)
{
int diff = nums[i]-nums[i-1];
... |
Java | UTF-8 | 1,453 | 2.265625 | 2 | [] | no_license | package ma.gfi.leap.api.LEAPAPI.core.services;
import ma.gfi.leap.api.LEAPAPI.core.dao.models.RevisionProjet;
import ma.gfi.leap.api.LEAPAPI.core.dao.repositories.RevisionProjetRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.A... |
Java | UTF-8 | 424 | 1.554688 | 2 | [] | no_license | package org.chock.shop.dto;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.util.List;
/**
* @auther: zhuohuahe
* @date: 2019/11/12 09:27
* @description:
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class AddOrderDto {... |
C++ | UTF-8 | 391 | 2.765625 | 3 | [] | no_license | #pragma once
#include <string>
using namespace std;
class Book
{
public:
bool lessThan(Book otherBook); // a.lessThan(b)
bool operator <(Book otherBook);// a<b
friend class Library;
friend bool compareByAuthor(Book &, Book &);
friend bool compareByName(Book &, Book &);
private:
string name;
string author;
s... |
Python | UTF-8 | 249 | 3.484375 | 3 | [] | no_license | n1 = input()
def odd_even(n):
odd = 0
even = 0
for i in n:
if int(i) % 2 != 0:
odd += int(i)
else:
even += int(i)
return 'Odd sum = {}, Even sum = {}'.format(odd, even)
print(odd_even(n1))
|
C++ | UTF-8 | 1,008 | 3.0625 | 3 | [] | no_license | /**
* \class Diplodocus
* \brief Diplodocus adalah salah satu binatang dalam game
*
* Diplodocus adalah binatang turunan dari EggProducingAnimal dan MeatProducingAnimal
* sehingga Diplodocus bisa menghasilkan telur maupun daging
*
* \note Habitat Diplodocus adalah Grassland
* dan bunyinya adalah "... |
Python | UTF-8 | 215 | 3.234375 | 3 | [] | no_license | def funkcja():
a = 100
b = 200
return a, b
if __name__ == "__main__":
print(funkcja())
wynik = funkcja()
print(wynik[0])
print(wynik[1])
x, y = funkcja()
print(x)
print(y)
|
Markdown | UTF-8 | 10,645 | 3.171875 | 3 | [] | no_license | ## Producers
Dagger Producers is an extension to Dagger that implements asynchronous dependency injection in Java.
### Overview
This document assumes familiarity with the Dagger 2 API and with Guava’s ListenableFuture.
Dagger Producers introduces new annotations @ProducerModule, @Produces, and @ProductionComponent ... |
TypeScript | UTF-8 | 510 | 3.109375 | 3 | [
"MIT"
] | permissive | export default class ValidationUtils {
/**
* @description Checks if the provided string is "true"
*
* @param $stringBoolean
* @returns {boolean}
*/
public static isTrue($stringBoolean){
return ( $stringBoolean === 'true');
};
/**
* @description Checks if the provi... |
Python | UTF-8 | 1,637 | 3.4375 | 3 | [
"Apache-2.0"
] | permissive | import re
import string
class Owner:
def __init__(self, dni, apellidos, nombre):
self.nombre = nombre
self.apellidos = apellidos
self.dni = dni
def muestraDatos(self):
return [self.nombre, self.apellidos, self.dni]
def getDni(self):
return self.dni
def validaDN... |
JavaScript | UTF-8 | 1,773 | 2.53125 | 3 | [] | no_license | import React from 'react';
import InputForm from './InputForm';
import './InputWrapper.css';
class InputWrapper extends React.Component {
constructor(props) {
super(props)
this.state = {
topics: [],
candidates: [],
debates: [],
errorOn: false
... |
Java | UTF-8 | 2,344 | 3.3125 | 3 | [
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0"
] | permissive | package com.example.simpleparadox.listycity;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
class CityListTest {
private CityList mockCityList() {
CityList cityList = new CityList();
cityList.add(mockCity());
return cityList;
}
private City ... |
Go | UTF-8 | 2,750 | 3.328125 | 3 | [
"MIT"
] | permissive | package bloomd
import (
"bufio"
"io"
"net"
"os"
"strconv"
"strings"
"time"
)
// Connection materializes a concrete connection to bloomd
type Connection struct {
Server string
Timeout time.Duration
Socket *net.TCPConn
File *os.File
Attempts int
Reader *bufio.Reader
}
// Create a TCP socket for... |
Java | UTF-8 | 2,708 | 1.78125 | 2 | [] | no_license | package com.richotaru.notificationapi;
import com.richotaru.notificationapi.dao.AppRepository;
import com.richotaru.notificationapi.dao.ClientAccountRepository;
import com.richotaru.notificationapi.dao.SubscriptionPlanRepository;
import com.richotaru.notificationapi.service.NotificationService;
import com.richotaru.n... |
Swift | UTF-8 | 1,445 | 2.890625 | 3 | [] | no_license | //
// CharactersListFlowCoordinator.swift
// Marvel-Wiki
//
// Created by Ramzy on 15/08/2021.
//
import UIKit
protocol CharactersListFlowCoordinatorDependencies {
func makeCharactersListViewController(actions: CharactersListViewModelActions) -> CharactersListViewController
func makeCharacterDetialsViewCon... |
Java | UTF-8 | 2,010 | 3.625 | 4 | [] | no_license | package ships.dev.functional;
import java.util.Scanner;
public class Game {
private static final int boardSize = 7;
private static final int numberOfShips = 3;
private char[][] board = new char[boardSize][boardSize];
public static void main(String[] args){
Ships ships = new Ships();
G... |
Java | UTF-8 | 1,607 | 3.265625 | 3 | [] | no_license | package leetcodeMedium;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.PriorityQueue;
public class LCNo692 {
public static void main(String[] args) {
// TODO Auto-generat... |
Shell | UTF-8 | 4,512 | 3.734375 | 4 | [] | no_license | #!/usr/bin/env bash
#
# Create a path to a log file that encodes
# into the path the date and time to minute resolution
#
LOG="$PWD/log.$(date +"%Y-%m-%dT%H:%m")"
# To handle global redirection
#exec 3>&1 4>&2 >>$LOG 2>&1
#exec 1>&3 2>&4
log() {
typeset -r msg=$1
echo "$(date): $msg"
}
#
# Update packages
#
l... |
Markdown | UTF-8 | 1,086 | 2.59375 | 3 | [] | no_license | ---
layout: post
title: A test, a test
date: '2010-09-06T02:14:00.000+10:00'
author: Zarah Dominguez
tags:
- hello
- android
modified_time: '2010-09-06T03:31:38.537+10:00'
blogger_id: tag:blogger.com,1999:blog-8588450866181483028.post-8641279766713478805
blogger_orig_url: http://www.zdominguez.com/2010/09/test-test.htm... |
PHP | UTF-8 | 1,381 | 3.203125 | 3 | [
"MIT"
] | permissive | <?php
namespace Noodlehaus\Writer;
/**
* Properties Writer.
*
* @package Config
* @author Jesus A. Domingo <jesus.domingo@gmail.com>
* @author Hassan Khan <contact@hassankhan.me>
* @author Filip Š <projects@filips.si>
* @author Mark de Groot <mail@markdegroot.nl>
* @link https://githu... |
Python | UTF-8 | 2,894 | 2.859375 | 3 | [] | no_license | import xlsxwriter
import os
from time import sleep
from datetime import datetime
hclogin = "END0FTH3W0R1D"
hclcount = 1
slcount = 1
kickcounter = 0
offloop = 1
loggoloop = 1
while hclcount == 1:
if kickcounter < 3:
hclinput = input("Please enter your application password: ")
if hclinput... |
Python | UTF-8 | 24,103 | 2.90625 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from ressources import config as c
from ressources.config import bcolors
import time
import base64
import random
###########################
# LIVE CHAIN #
###########################
"""
This is a single-threaded simulation, so adding miners will not s... |
Swift | UTF-8 | 558 | 3.046875 | 3 | [] | no_license | //
// testClassException .swift
// swift_demo_T1000
//
// Created by Rayan Taj on 20/10/2021.
//
import Foundation
//
//
//print("Please enter a password : " , terminator: "\t")
//
//let password = Utils.readString()
//
//do{
// try checkPassword(password: password)
//} catch is CapitalfirstLetter {
// print(... |
Markdown | UTF-8 | 1,687 | 2.53125 | 3 | [] | no_license | ---
course_id: 9-16-cellular-neurophysiology-spring-2002
layout: course_section
menu:
leftnav:
identifier: 1ee23f802cb46686326694c8dfe9be1d
name: Syllabus
weight: 10
title: Syllabus
type: course
uid: 1ee23f802cb46686326694c8dfe9be1d
---
Course Meeting Times
--------------------
Lectures: 1 session / we... |
C# | UTF-8 | 1,332 | 3.1875 | 3 | [] | no_license | public void BuildPerson()
{
var list = new People
{
PersonList = new List<List<Person>>
{
new List<Person>
{
new Person
{
Name = "test",
... |
C | UTF-8 | 3,278 | 3.453125 | 3 | [] | no_license | /******************************************************************************
* File: main.c
* Version: 1.2
* Date: 2017-10-18
* Author: J. Onokiewicz, M. van der Sluys
* Description: OPS exercise 5: Queues
*****************************************************************************... |
Python | UTF-8 | 935 | 2.921875 | 3 | [] | no_license | import pygame
from entities.entity import Entity
class Platform(Entity):
# if you want moving platforms, specify here minimum and maximum x and y values
def __init__(self,x,y,dx,dy,width,height,world,passthrough=True,dropdown=True, min_x = 0, max_x = 700,image_file=None):
super().__init__(x,y,dx,dy,wid... |
Markdown | UTF-8 | 577 | 2.71875 | 3 | [
"MIT"
] | permissive | ---
layout: post
title: "How To Make A New Page"
date: 2018-09-24 16:34:48 +0000
categories: jekyll gettingstarted
---
# This is my new content about how to make a new page!
1. In the pages folder on your desktop, create a new file or copy an existing one to alter to your needs. Make sure this file ends with a ".m... |
Python | UTF-8 | 7,487 | 2.96875 | 3 | [] | no_license | __authour__ = 'Harry Burge'
__date_created__ = '20/06/2020'
__last_updated_by__ = 'Harry Burge'
__last_updated_date__ = '20/06/2020'
# Imports
from bin.AI.ai_class import AI
from random import randint
from bin.Utils.game_util import normalise
from bin.Game.Pieces.StarTrekChess.pawn_s import Pawn
import copy
'''
Simul... |
TypeScript | UTF-8 | 414 | 3.171875 | 3 | [
"MIT"
] | permissive | /**
* Checks if a email is a valid formatted email.
*/
export function isValidEmail(email: string) {
if(typeof email !== 'string') {
throw new TypeError('Email must be typeof string.');
}
// eslint-disable-next-line max-len
return (/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,... |
C | UTF-8 | 179 | 3.234375 | 3 | [] | no_license | #include "holberton.h"
/**
* _abs - finds the absolute value
* @a: number thats type int
* Return: a
*/
int _abs(int a)
{
if (a < 0)
return (a * -1);
else
return (a);
}
|
PHP | UTF-8 | 151 | 2.671875 | 3 | [] | no_license | <?php
namespace Package\Model;
class User {
public function __construct(){
}
public function Display(){
echo "Frolov";
}
} |
PHP | UTF-8 | 4,182 | 2.703125 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Security\Core\User\UserInterface;
/**
* @ORM\Entity(repositoryClass="App\Repository\UserRepository")
* @ORM\Table(name="sgl_users")
*/
class User implements UserInterface
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
... |
Ruby | UTF-8 | 842 | 3.546875 | 4 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | require "pry"
class Song
attr_accessor :name ,:artist ,:genre
@@count = 0
@@artists = []
@@genres = []
def initialize(name, artist, genre)
@name = name
@artist = artist
@genre = genre
@@count +=1
@@artists<<artist
@@genres<<genre
end
def self.count
@@count
end
de... |
Python | UTF-8 | 1,175 | 2.6875 | 3 | [] | no_license | import sys, fileinput
source = fileinput.input()
src = source.readline().strip()
num = source.readline().strip()
links = {}
backpointers = {}
backpointers[src]=(-1,0)
for line in source:
if '->' not in line:
break
(link, weight) = line.strip().split(':')
weight = int(weight)
(start, end) = link.split('->')
... |
Markdown | UTF-8 | 2,477 | 2.9375 | 3 | [] | no_license | # 创建数据集
在`K-Lab页面`下的`我的数据集`中点击蓝色`+`或直接点击`创建数据集`来进行数据集的创建。

该功能分为两个步骤,数据集制作与数据集信息完善。
### 数据集制作
* **上传数据集图片**:上传一个能够代表数据集内容的封面图片。
* **填写数据集名称**:对将要创建的数据集进行命名。
* **设置挂载目录**:挂载目录是可以在K-Lab Notebook中访问到数据集的地址,挂载目录的设置支持字母、数字及下划线,**在创建后不可修改**。以上传名为vgsalesGlobale.csv的数据文件为例,若... |
Shell | UTF-8 | 6,985 | 3.734375 | 4 | [
"Apache-1.1"
] | permissive | #!/bin/bash
project="fpm-refinery"
version="0.1.0-1"
projectdir="/vagrant/fpm-refinery"
prefix="/opt/$project"
box="$1"
packagedir="$projectdir/pkg/$box"
#
# Prints a log message.
#
log()
{
if [[ -t 1 ]]; then
echo -e "\x1b[1m\x1b[32m>>>\x1b[0m \x1b[1m$1\x1b[0m"
else
echo ">>> $1"
fi
}
#
# Prints a w... |
C++ | UTF-8 | 3,595 | 2.640625 | 3 | [] | no_license | #ifndef _GUI_BUTTON_H
#define _GUI_BUTTON_H
#include "Label.h"
#include "../Geometries/IGeometryQuads.h"
#include "../Utils/ButtonAction.h"
namespace jogy {
enum InputBehaviour
{
None = 0,
ReplaceTex,
AddTex,
Decal,
Scale,
Enlight
};
// must return false if resulting in a closing event
type... |
Python | UTF-8 | 723 | 3.59375 | 4 | [] | no_license | """
二分 middle
2021-07-13
"""
class Solution:
def findNumberIn2DArray(self, matrix, target):
if not matrix or not matrix[0]:return False
n = len(matrix)
m = len(matrix[0])
i = 0
j = m-1
while i<n and j>=0:
if matrix[i][j]==target:return True
eli... |
Markdown | UTF-8 | 925 | 2.5625 | 3 | [] | no_license | # Notes
## Pipeline
**Data Fetching**
Raw data is current stored in a network MySQL Server.
Data fetching is performed in the file designated 1.
**Preprocessing**
Data preprocessing is performed in R.
The data is reformated and recordeds are coded 1 or 0 to structure the training data.
Preprocessing occurs according... |
Java | UTF-8 | 1,193 | 2.015625 | 2 | [
"Apache-2.0"
] | permissive | package org.itstack.naive.chat.interfaces.facade;
import org.itstack.naive.chat.application.service.UserService;
import org.itstack.naive.chat.interfaces.dto.UserInfoDto;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import... |
C++ | UTF-8 | 451 | 2.53125 | 3 | [] | no_license | #pragma once
#include "GameObject.h"
class Game;
class View : public sf::RectangleShape
{
public:
View(int texture, Game * game);
~View();
void draw(sf::RenderWindow &window);
void Update();
void addObject(GameObject * obj);
void eventHandler(sf::Vector2i &mousePosition, bool isPressed);
Game * _parent;
void re... |
JavaScript | UTF-8 | 979 | 3.390625 | 3 | [
"Apache-2.0"
] | permissive | /*
The purpose of this API is to provide a random saying such
as one that would be found in a fortune cookie.
*/
function loadSayingsSync(){
if(!process.env.SAYINGS){
const arr= [];
require('fs').readFileSync('sayings.txt', 'utf-8').split(/\r?\n/).forEach(function(line){
arr.push({sayi... |
C# | UTF-8 | 686 | 2.875 | 3 | [] | no_license | using UnityEngine;
[System.Serializable] public class InputProvider {
public enum Mode {
Manual, AI
}
public enum Direction {
Left, Rigth, None
}
AI ai = new AI();
public Mode mode = Mode.Manual;
public Direction GetHorizontalInput() {
if (mode == Mode.Man... |
C++ | UTF-8 | 854 | 3.28125 | 3 | [] | no_license | Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n.
For example, given n = 12, return 3 because 12 = 4 + 4 + 4; given n = 13, return 2 because 13 = 4 + 9.
class Solution {
public:
int numSquares(int n) {
vector<int> dp (n + 1, 1);
... |
Python | UTF-8 | 2,338 | 2.9375 | 3 | [] | no_license | from sys import argv
from json import dumps
########## CONSTANTS ##############
SEPARATORS = [' ', ' - ', ' "', '" ', ' "', '" "', '"']
UNIMPORTANT_SEPARATORS = {'" "'}
DATA_DICT = { 0: 'IP',
1: 'domain',
2: 'dateTime',
3: 'HTTPRequest',
4: 'responseStatus',
5: 'client'
}
FILE_NAME = 'out_%04d.j... |
Python | UTF-8 | 2,885 | 2.75 | 3 | [] | no_license | import json
import sys
import random
import os
import numpy as np
from collections import deque
from keras.models import Sequential
from keras.layers import *
from keras.optimizers import *
class KerasAgent:
def __init__(self, shape, action_size):
self.weight_backup = "bombergirl_weight.model"
... |
C++ | UTF-8 | 381 | 2.984375 | 3 | [
"Apache-2.0"
] | permissive | /*
王道考研机试指南 p87
GCD
*/
#include <stdio.h>
int gcd(int a, int b) {
if(b == 0) return a;
return gcd(b, a%b);
}
int gcd1(int a, int b) {
int t;
while(b) {
t = a%b;
a = b;
b = t;
}
return a;
}
int main() {
int a, b;
while(scanf("%d %d", &a, &b) != EOF)
pr... |
Python | UTF-8 | 924 | 3.46875 | 3 | [] | no_license | # chats
# 读取档案
def read_file(filename):
chats = []
with open(filename, 'r', encoding = 'utf-8-sig') as f:
for line in f:
chats.append(line.strip())
return chats
# 转换格式 [名字:语句]的格式
def convert(chats):
new = []
person = None
for c in chats:
if c == 'Allen':
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.