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 |
|---|---|---|---|---|---|---|---|
Python | UTF-8 | 17,369 | 2.734375 | 3 | [] | no_license | # FTP Server was implmented by Kavilan Nair (1076342)
import socket
import threading
import os
import random
import platform
# FTP server class that inherits from the threading module
class FTPServer (threading.Thread):
def __init__(self, connection_socket, address_ip):
threading.Thread.__init__(self)
... |
PHP | UTF-8 | 782 | 2.859375 | 3 | [] | no_license | <?php
function secondvalidate($email) {
$domains = array('yahoo.com', 'gmail.com', 'usc.edu', 'hotmail.com', 'aol.com');
$num = 0;
foreach ($domains as $domain) {
if (strpos($email, $domain)) {
echo "<p>Thank you for your submission.</p>";
break;
}
else {
$num++;
if ($num == 5) {
... |
Java | UTF-8 | 303 | 2.859375 | 3 | [] | no_license | public abstract class AnagramFinder {
public abstract String[] search(String word);
public void createDictionary(String[] words) {
for(String s : words){
if(s!=null){
add(s);
}
}
}
protected String getBaseFormOf(String word){
return "";
}
public abstract void add(String w);
}
|
Java | UTF-8 | 197 | 1.96875 | 2 | [
"Unlicense"
] | permissive | package Domain.Users;
public class RefereeStub extends Referee{
public RefereeStub(SystemUser systemUser, RefereeQualification training) {
super(systemUser, training, true);
}
}
|
C | UTF-8 | 194 | 2.921875 | 3 | [] | no_license | #include "holberton.h"
char *_memcpy(char *dest, char *src, unsigned int n)
{
unsigned int i;
char *d = dest;
char *s = src;
for (i = 0; i < n; i++)
{
*d++ = *s++;
}
return (dest);
}
|
Java | UTF-8 | 5,781 | 2.015625 | 2 | [] | no_license | /***********************************************************************************************************************
*
* Copyright (C) 2010-2013 by the Stratosphere project (http://stratosphere.eu)
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance... |
Java | UTF-8 | 4,442 | 2.4375 | 2 | [] | no_license | package com.gcit.lms.dao;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import org.springframework.jdbc.core.PreparedStatementCreator;
import org.springframework.jdbc.core.ResultSetExtractor;
import org.springframework.jdbc.suppo... |
JavaScript | UTF-8 | 755 | 2.59375 | 3 | [] | no_license | import axios from 'axios';
const baseURL = 'https://rich-kid.herokuapp.com/';
const axiosInstance = axios.create({
baseURL,
timeout: 30000,
headers: {'Content-Type': 'application/json'},
});
class HttpLayer {
static Axios = axiosInstance;
constructor() {}
#prepareUrl = (url) => {
return url.includes... |
Python | UTF-8 | 963 | 3.140625 | 3 | [] | no_license | # 用法
# python simple_thresholding.py --image coins01.png
import argparse
import cv2
ap = argparse.ArgumentParser()
ap.add_argument("-i", "--image", required=True, help="Path to the image")
args = vars(ap.parse_args())
# 加载图片,转为灰度,做一下模糊
image = cv2.imread(args["image"])
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
... |
Markdown | UTF-8 | 1,095 | 2.78125 | 3 | [] | no_license | ## Welcome
This is meant as a boilerplate for a simple coding task.
## How to run
terminal 1:
```
cd server
yarn run seeds # creates seeds
yarn run start # runs dev server
```
terminal 2:
```
cd client
yarn run start
```
open in browser: http://localhost:3000
## Asks
* Build a simple filter form for t... |
PHP | UTF-8 | 2,738 | 3.015625 | 3 | [] | no_license | <?php
/**
* @author Xethilos
*/
class Settings implements ArrayAccess {
/** @var array */
protected $values = array();
/** @var string */
protected $filePath;
/** @var string */
protected $namespace;
/** @var Nette\Caching\Cache */
protected $cache = NULL;
... |
Java | UTF-8 | 2,030 | 2.546875 | 3 | [] | no_license | import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
public class LockFreeSetImplTest {
private LockFreeSet<Integer> set;
@Before
public void setUp() {
set = new LockFreeSetImpl<>();
}
@Test
public void add() throws Exception {
Assert.assertTrue(set.add(10... |
Python | UTF-8 | 385 | 3.71875 | 4 | [] | no_license | smallest = None
largest = None
while True:
a=input("Enter the Number: ")
if a=="done":
break
try:
b=int(a)
except:
print("Invalid input")
if smallest is None:
smallest = b
if largest is None:
largest = b
if b > largest :
largest = b
elif b ... |
Java | UTF-8 | 392 | 1.875 | 2 | [] | no_license | package com.springboot.jpa;
import com.springboot.model.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
/**
* Created by ghost on 2018/12/10.
*/
public interface UserJpa extends JpaRepository<User, Integer>, JpaSpecificatio... |
Markdown | UTF-8 | 2,850 | 2.53125 | 3 | [
"MIT"
] | permissive | # eChat
eChat is a cross-platfrom instant chat application built with Flutter.
## Features
- Send and recieve realtime messages
- Send photos and videos
- Seen status
- Online status
- Reply messages
- Make voice and video calls (to be added soon)
# Demo
<p float="left">
<img src="https://user-images.githubuser... |
Python | UTF-8 | 1,652 | 3.046875 | 3 | [] | no_license | import java.lang.*;
import java.io.*;
import java.lang.*;
public class Main
{
public static int[] array = null;
public static int n, m;
public static void main(String[] args) throws IOException
{
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String line = null;
String[] separa... |
Markdown | UTF-8 | 766 | 2.546875 | 3 | [] | no_license | ---
nav_order: 4
---
# Translations
To [translate Epoptes in your language](https://translations.launchpad.net/epoptes) you only need a web browser and a launchpad account. Usually less than half an hour is needed to complete the process. Once you've finished your translation, it will be automatically included in the... |
JavaScript | UTF-8 | 589 | 2.515625 | 3 | [] | no_license | import React, { Component } from 'react';
class Player extends Component {
constructor(props) {
super(props);
this.audio = new Audio();
}
clicked(){
this.audio.play()
//console.log("Hey I worked!");
};
render() {
this.audio.src = this.props.src;
return (
... |
C | GB18030 | 2,185 | 2.609375 | 3 | [] | no_license | #include <stm32f10x_lib.h>
#include "sys.h"
#include "usart.h"
#include "delay.h"
#include "led.h"
#include "key.h"
#include "exti.h"
#include "wdg.h"
#include "timer.h"
#include "lcd.h"
#include "rtc.h"
#include "wkup.h"
#include "adc.h"
#include "dma.h"
#include "24cxx.h"
//Mini STM32巶16
//IIC... |
PHP | UTF-8 | 672 | 2.765625 | 3 | [] | no_license | <?php
header('content-type:text/html;charset="utf-8"');
error_reporting(0);
//接收数据
$username = $_GET['username'];
$age = $_GET['age'];
$sex = $_GET['sex'];
//打开文件
$file_n = fopen("student.txt","a") or exit("Unable to open file!");
$file_a = fopen("age.txt","a") or exit("Unable to open file!");
$file_s = fopen("se... |
Java | UTF-8 | 3,737 | 1.945313 | 2 | [] | no_license | package com.smapley.powerwork.fragment;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.... |
JavaScript | UTF-8 | 2,037 | 3.515625 | 4 | [] | no_license | //http://data.fixer.io/api/latest?access_key=3f144bb3405456657ec931bfe187002e
//https://restcountries.eu/rest/v2/currency/USD
const axios = require('axios');
// const getExchangeRate = (from,to) => {
// return axios.get('http://data.fixer.io/api/latest?access_key=3f144bb3405456657ec931bfe187002e')
// .then(... |
PHP | UTF-8 | 2,521 | 2.703125 | 3 | [
"CC0-1.0",
"MIT"
] | permissive | <?php
namespace YabaCon\Paystack\Routes;
use YabaCon\Paystack\Contracts\RouteInterface;
/**
* Customer
* Insert description here
*
* @category
* @package
* @author
* @copyright
* @license
* @version
* @link
* @see
* @since
*/
class Customer implements RouteInterface
{
/**
Root
*
@p... |
Java | UTF-8 | 311 | 2.296875 | 2 | [] | no_license | package com.ws.design.template;
/**
* @author Jun
* data 2019-09-23 23:23
*/
public abstract class AbstractProcess {
abstract void firstStep();
abstract void secondStep();
abstract void last();
public void process() {
firstStep();
secondStep();
last();
}
}
|
Swift | UTF-8 | 2,692 | 2.609375 | 3 | [] | no_license | //
// Profile.swift
// PicFlow
//
// Created by Antonio Hernandez on 7/2/17.
// Copyright © 2017 Antonio Hernandez . All rights reserved.
//
import ObjectMapper
import FacebookCore
import TwitterKit
import GoogleSignIn
class Profile {
//MARK: - Enumerations
enum ProfileType : Int {
... |
Java | UTF-8 | 2,736 | 3.5 | 4 | [] | no_license | //implements a generic M by N matrix data structure
//eli f.
public class Matrix {
private int rows;
private int columns;
private double[][] elements;
//creates a matrix of zeros
public Matrix(int rows, int columns) {
this.rows = rows;
this.columns = columns;
this.elements = new... |
Python | UTF-8 | 7,568 | 2.546875 | 3 | [
"MIT",
"GPL-3.0-only"
] | permissive | # coding=utf-8
"""
Various helper functions
"""
import datetime
import os
import shutil
import typing
from pathlib import Path
import pefile
import pkg_resources
import requests
from esst import LOGGER
from esst.core import Status
# from esst.core.fs_paths import FS
from .arg import arg
from .find_port import assign_... |
Markdown | UTF-8 | 3,045 | 2.90625 | 3 | [] | permissive | # Case 37: Traffic Lights
## Introduction
In our daily life, many traffic accidents should have been avoided. These traffic accidents are often caused by people not observing the traffic rules, thus, we must understand the traffic rules. For example, the common traffic lights in our lives, red light means not pas... |
JavaScript | UTF-8 | 3,996 | 2.71875 | 3 | [] | no_license | var express = require('express');
var router = express.Router();
var mongoose = require('mongoose');
var VotingSchemaObj = mongoose.model('Voting');
router.param('candidate', function(req, res, next, id) {
var query = VotingSchemaObj.findById(id);
query.exec(function (err, candidate){
if (err) { return next(e... |
PHP | UTF-8 | 987 | 2.640625 | 3 | [] | no_license | <?php
function getAll($tbl){
include('connect.php');
$queryAll = 'SELECT * FROM '.$tbl;
$runAll = $pdo->query($queryAll);
if($runAll){
return $runAll;
}else{
$error = 'There was a problem accessing this info.';
return $error;
}
}
function getSingle($tbl, $col, $value){
include('connect... |
C# | UTF-8 | 979 | 2.671875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
namespace Yaar.Objects.Reference
{
class Wolfram
{
public Wolfram(string query)
{
var url = "http://api.wolframalpha.com/v2/query?input={0}&appid=2P... |
Java | UTF-8 | 1,958 | 2.1875 | 2 | [] | no_license | /*
* Copyright 2004 - 2013 Wayne Grant
* 2013 - 2016 Kai Kramer
*
* This file is part of KeyStore Explorer.
*
* KeyStore Explorer is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either versio... |
Python | UTF-8 | 2,221 | 2.90625 | 3 | [] | no_license | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 17 16:23:32 2020
@author: user
"""
import re
import string
import random
import glob
import operator
import heapq
from collections import defaultdict, Counter, defaultdict
import math
from functools import reduce
import csv
from pprint import ppri... |
Java | UTF-8 | 434 | 2.359375 | 2 | [] | no_license | /**
* @author 许瑞锐
* @date 2020/9/4 11:04
* @description {java类描述}
*/
public class Resource {
private int id;
public Resource(int id) {
this.id = id;
}
@Override
public String toString() {
return "Resource{" +
"id=" + id +
'}';
}
public ... |
Python | UTF-8 | 79 | 2.78125 | 3 | [] | no_license | import math
def calculate_area(radius):
return math.pi * radius * radius
|
JavaScript | UTF-8 | 4,815 | 2.65625 | 3 | [] | no_license | const fs = require('fs');
const { ungzip } = require('node-gzip');
const colors = require('colors');
const Path = require('path');
const scriptName = Path.basename(__filename);
const movies_id = require('../models/movies_id.js');
const serials_id = require('../models/serials_id.js');
const { contentDownloader } = requ... |
Markdown | UTF-8 | 2,231 | 2.671875 | 3 | [] | no_license |
# Store.Categories Property (Outlook)
Returns a **[Categories](319efa26-269d-9f2f-c8ec-33082e80a9e2.md)** collection that represents all of the categories that are defined for the **[Store](1eb22fe9-8849-7476-5388-2515b48591b9.md)** . Read-only.
## Syntax
_expression_ . **Categories**
_expression_ A variable t... |
Java | UTF-8 | 191 | 1.695313 | 2 | [
"Apache-2.0"
] | permissive | package de.arthurpicht.cli.common;
public class CLISpecificationException extends RuntimeException {
public CLISpecificationException(String message) {
super(message);
}
}
|
Markdown | UTF-8 | 1,819 | 2.640625 | 3 | [
"MIT"
] | permissive | # APL Language Server Client
This extension implements the client for an APL Language Server. The server is embedded with the extension, but has its own repository on [APL Language Server](https://github.com/optimasystems/apl-language-server). Please report issues or feature requests to that project.
The language ser... |
Markdown | UTF-8 | 3,423 | 3.671875 | 4 | [
"MIT"
] | permissive | ###### Core > object
# {{LIB_NAME}}.object
> 객체 관련 코어 확장 기능을 사용할 수 있습니다.
## 확장기능
- [keys()](#keys)
- [values()](#values)
- [map()](#map)
- [hasObject()](#hasobject)
- [toQueryString()](#toquerystring)
- [traverse()](#traverse)
- [remove()](#remove)
- [stringify()](#stringify)
<br>
## keys()
객체의 열거가능한 속성 및 메서드 이름을 ... |
Shell | UTF-8 | 593 | 3.40625 | 3 | [] | no_license | #!/bin/bash
# Run from this project's root directory(typically FuzMusic/)
# Get tags from all files in a directory with some default settings
if [[ -z $1 ]]; then
echo "[!] Please specify a directory"
elif [[ -z $2 ]] && [[ -n $1 ]]; then
echo "[!] Reading in jsons from $1"
echo "[!] Please input new pickle fil... |
Rust | UTF-8 | 5,190 | 3.578125 | 4 | [] | no_license | use rand::prelude::*;
use rand::distributions::WeightedIndex;
// Quality
//
// An integer from 0-5 indicating how easily the information was remembered today. This could correspond to a button such as "Difficult" or "Very Easy."
//
// The official algorithm description explains the meaning of each number:
#[derive(... |
Python | UTF-8 | 548 | 2.96875 | 3 | [] | no_license | import tkinter as tk
from tkinter import Text
root = tk.Tk()
frame = tk.Frame(root)
frame.pack()
def show_WIT():
T=Text(root)
T.pack()
T.insert(tk.END,"This is my CV app")
#root.mainloop()
def show_AM():
T=Text(root)
T.pack()
T.insert(tk.END,"I am Miguel Ramos, a Systems Engineer")
#root.mainloop()
btn_ab... |
JavaScript | UTF-8 | 1,988 | 3.90625 | 4 | [] | no_license | // 3.6 Animal Shelter: An animal shelter, which holds only dogs and cats, operates on a strictly "first in, first
// out" basis. People must adopt either the "oldest" (based on arrival time) of all animals at the shelter,
// or they can select whether they would prefer a dog or a cat (and will receive the oldest animal... |
Markdown | UTF-8 | 2,327 | 3.5 | 4 | [] | no_license | ### Go 的动态类型
https://github.com/unknwon/the-way-to-go_ZH_CN/blob/master/eBook/11.12.md
在经典的面向对象语言(像 C++,Java 和 C#)中数据和方法被封装为 类 的概念:类包含它们两者,并且不能剥离。
Go 没有类:数据(结构体或更一般的类型)和方法是一种松耦合的正交关系。
Go 中的接口跟 Java/C# 类似:都是必须提供一个指定方法集的实现。但是更加灵活通用:任何提供了接口方法实现代码的类型都隐式地实现了该接口,而不用显式地声明。
和其它语言相比,Go 是唯一结合了接口值,**静态类型检查(是否该类型实现了某个接口)**,运行... |
C# | UTF-8 | 4,854 | 3.4375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Runtime.Serialization.Formatters.Binary;
using System.Xml.Serialization;
namespace Task_1
{
/*Объявить класс ConsoleSimbol, описывающий символ, расположенный
в определённой позиции консольно... |
Java | UTF-8 | 1,448 | 2.109375 | 2 | [] | no_license | package com.ceiba.cliente.adaptador.dao;
import java.util.List;
import com.ceiba.cliente.modelo.dto.DtoCliente;
import com.ceiba.cliente.puerto.dao.DaoCliente;
import com.ceiba.infraestructura.jdbc.CustomNamedParameterJdbcTemplate;
import com.ceiba.infraestructura.jdbc.sqlstatement.SqlStatement;
import org.springfr... |
JavaScript | UTF-8 | 467 | 2.546875 | 3 | [] | no_license | class SlingShot {
constructor(body1,body2){
var options = {
bodyA : body1,
bodyB : body2,
stiffness : 0.04,
length : 10
}
this.sling = Constraint.create(options)
World.add(world,this.sling)
}
display(){
strok... |
PHP | UTF-8 | 1,640 | 3.015625 | 3 | [] | no_license | <?php
/**
* MiniLibLBC BadPinkChicken
*/
class LBCRequest
{
public $url;
public $options;
private $page_content;
private $content_tab;
private $parsed_content;
function __construct($url, $options) { // Options -> Array -> "date", "title", "price", "place" ,"image"
$this->url = $url;
$this->o... |
Java | UTF-8 | 539 | 2.359375 | 2 | [] | no_license | package postgstats.websocketserver;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.channel.group.ChannelGroup;
class JoinGroupHandler extends ChannelInboundHandlerAdapter {
private final ChannelGroup channelGroup;
JoinGroupHandler(ChannelGroup... |
C# | UTF-8 | 1,137 | 2.875 | 3 | [
"MIT"
] | permissive |
namespace System.Extensions.Http
{
using System.Text;
using System.Threading.Tasks;
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
public sealed class ReadJsonAttribute : Attribute
{
#region private
private static ... |
C# | UTF-8 | 9,986 | 2.921875 | 3 | [] | no_license | using System;
namespace Com.ChinaSoft.DataAcquisition
{
/// <summary>
/// Connection Builder class handles connecting and disconnecting from the Historian. Use this library as
/// an example on how to establish a connection with Historian 11
/// </summary>
public class ConnectionBuilder
{
... |
Markdown | UTF-8 | 2,198 | 3.375 | 3 | [] | no_license | ## Section List Adapter ##
I based this project off of the [Amazing-ListView][1]. The work is fairly divergent at this point, but some of the basic techniques are used from that implementation.
*Note: Still working on the documentation and a sticky header implementation*
This project was created to make a simpler a... |
Java | UTF-8 | 3,254 | 2.15625 | 2 | [] | no_license | package com.example.nthucs.prototype.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import andro... |
Python | UTF-8 | 5,851 | 2.71875 | 3 | [] | no_license | from PIL import Image, ImageFilter, ImageOps, ImageChops, ImageEnhance
from abc import abstractmethod, ABC
import numpy
from Dataset import Entry, Split
class Transformation:
def __init__(self, func, name, origin, keys):
self._func = func
self._name = name
self._origin = origin
se... |
Markdown | UTF-8 | 21,684 | 3.625 | 4 | [] | no_license | # 声明文件
- 当使用第三方库时,我们需要引用它的声明文件,才能获得对应的代码补全、接口提示等功能。
- 在了解声明文件之前,需要先了解什么是**声明语句**
## 什么是声明语句
- 假如我们想使用第三方库 jQuery,一种常见的方式是在 html 中通过 `<script>` 标签引入 jQuery,然后就可以使用全局变量 `$` 或 `jQuery` 了。
- 我们通常这样获取一个 `id` 是 `foo` 的元素:
~~~typescript
$('#foo');
// or
jQuery('#foo');
~~~
- 但是在 ts 中,编译器并不知道 `$` 或 `jQuery` 是什么东西
~~~
jQu... |
Shell | UTF-8 | 1,795 | 2.84375 | 3 | [
"MIT"
] | permissive | #! /bin/bash
cat src/LocalStorage.js > /tmp/pre-bundle.js
cat src/constants.js >> /tmp/pre-bundle.js
cat src/Activities.js >> /tmp/pre-bundle.js
cat src/Activity.js >> /tmp/pre-bundle.js
cat src/App.js >> /tmp/pre-bundle.js
cat src/CantButton.js >> /tmp/pre-bundle.js
cat src/EditActivity.js >> /tmp/pre-bundle.js
cat s... |
Java | UTF-8 | 619 | 2.453125 | 2 | [
"Apache-2.0"
] | permissive | package org.opensha.refFaultParamDb.calc.sectionDists;
import java.io.Serializable;
import java.util.Comparator;
public class RecordIDsComparator implements Comparator<FaultSectDistRecord>, Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
@Override
public int compare(Fa... |
Java | UTF-8 | 1,770 | 2.796875 | 3 | [] | no_license | package cz.muni.fi.pv168.hotelmanager.backend;
public class Guest {
private Long id;
private String name;
private String phone;
private String address;
public Long getID() {
return id;
}
public void setID(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(Strin... |
JavaScript | UTF-8 | 1,197 | 3.234375 | 3 | [] | no_license | class Item {
constructor(element) {
this.element = element;
}
}
class RightLink {
constructor(element, parent){
this.element = element;
this.carousels = parent;
this.carouselItem = parent.getItem(this.element.dataset.item);
this.carouselItem = new Item(this.carouselItem);
... |
C | UTF-8 | 1,190 | 2.890625 | 3 | [] | no_license | #include "includes/fractol.h"
#include "includes/julia_set.h"
#include <stdio.h>
void put_square(t_image image, t_point where, int side, int color)
{
int x;
int y;
y = where.y;
while(y < side)
{
x = where.x;
while(x < side)
{
put_pixel_to_image(image, x, y, color);
x++;
}
y++;
}
}
void put_l... |
Java | UTF-8 | 579 | 1.75 | 2 | [] | no_license | package com.gms.web.member;
import java.util.*;
import org.springframework.stereotype.Component;
import com.gms.web.command.CommandDTO;
@Component
public interface MemberService {
public String add(Map<String,Object> map);
public List<?> list(CommandDTO cmd);
public List<?> findByNames(CommandDTO cmd);
public St... |
Java | UTF-8 | 4,663 | 2.265625 | 2 | [] | no_license | package com.security.admin.model;
import com.anjuxing.platform.common.base.ValidateData;
import com.anjuxing.platform.common.crud.CrudModel;
import com.anjuxing.platform.common.util.CodeUtils;
import com.anjuxing.platform.common.util.DateUtils;
import com.anjuxing.platform.common.util.ValidateUtils;
import com.faster... |
Java | UTF-8 | 1,725 | 2.65625 | 3 | [] | no_license | package pt.lsts;
import io.vertx.core.net.SocketAddress;
import pt.lsts.imc4j.def.SystemType;
import pt.lsts.imc4j.msg.Message;
import pt.lsts.imc4j.net.ImcNetwork;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetSocketAddress;
public class ImcBridgePublish {
private Datagram... |
TypeScript | UTF-8 | 993 | 3.796875 | 4 | [] | no_license | class Prime {
private maxPrime: number = 104744
/* Implements the Sieve of Eratosthenes */
nth(n: number): number {
if (n < 1) {
throw Error('Prime is not possible')
}
const integers: boolean[] = []
const primes: number[] = []
integers.push(false)
... |
Java | UTF-8 | 227 | 1.710938 | 2 | [] | no_license | package com.mevo.app.data.model.response;
import com.google.gson.annotations.SerializedName;
public class ResponseLatLon {
@SerializedName("lat")
public double lat;
@SerializedName("lon")
public double lon;
}
|
C++ | UTF-8 | 2,217 | 3.0625 | 3 | [] | no_license | #ifndef PIECE_H
#define PIECE_H
#include "Piece_Type.h"
#include "square.h"
#include <QGraphicsScene>
#include <QGraphicsView>
#include <vector>
using namespace std;
//Class for Checkers Pieces
class Piece : public QObject, public QGraphicsItem
{
Q_OBJECT
public:
Piece(QColor color, int team, bool aliv... |
C++ | UTF-8 | 5,313 | 2.921875 | 3 | [] | no_license | /*
* GLMouseTools.h
* TrackViewer
*
* A MouseTool is a specialised kind of mouse tool that
* connects to some kind of GLCanvas in order to influence the
* display parameters.
* I defines its own sub-class of MouseResponder to support the
* tools and then defines a set of sub-classes to handle the various
*... |
Java | UTF-8 | 4,739 | 2.203125 | 2 | [] | no_license | package com.example.finalresdemo.ui.activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import a... |
Java | UTF-8 | 636 | 1.929688 | 2 | [] | no_license | package com.duyi.onlinevideo.service.impl;
import com.duyi.onlinevideo.dao.BannerDao;
import com.duyi.onlinevideo.entity.Banner;
import com.duyi.onlinevideo.service.BannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Ser... |
C++ | UTF-8 | 1,962 | 3.859375 | 4 | [] | no_license | #include <iostream>
#include <vector>
// 2개의 배열 v[left...mid]와 v[mid+1...right] 합치기
void merge(std::vector<int>& v, int l, int mid, int r)
{
// 왼쪽 배열 길이(왼쪽 배열에 mid가 포함되어 있기에 1을 더해준다.)
int left = mid - l + 1;
// 오른쪽 배열 길이
int right = r - mid;
// 배열 생성
// v[left...mid]
std::vector<int> leftV(left);
// v[mid+1..... |
Python | UTF-8 | 1,413 | 3.015625 | 3 | [] | no_license | #!/usr/bin/env python3
from app import BacktrackingNQueensOptimizedSafetyCheck
from app import connection
def get_number_of_solutions():
nro_soluciones = []
print()
for i in range(1,13):
solver = BacktrackingNQueensOptimizedSafetyCheck(i)
solver.run()
nro = solver.get_number_of_solu... |
Java | UTF-8 | 342 | 3.46875 | 3 | [] | no_license | package com.mainacad.modul2.Labs2;
public class Employee {
public void calcSalary(String name, double... salary) {
double finSalary = 0;
for (int i = 0; i < salary.length; i++) {
finSalary += salary[i];
}
System.out.println(String.format("Name is %s, salary is %f", name... |
JavaScript | UTF-8 | 1,139 | 3.109375 | 3 | [] | no_license | setInterval(()=>{
let secDoc= document.getElementById('sec');
let minDoc= document.getElementById('min');
let hourDoc= document.getElementById('hour');
let newSec=parseInt(secDoc.innerHTML)+1;
newSec+='';
if(newSec.length==1){
newSec='0'+newSec;
}
if(newSec=='01'){
minDoc... |
Python | UTF-8 | 323 | 3.359375 | 3 | [] | no_license | import unittest
class TestSum(unittest.TestCase):
def test_sum(self):
g = Game()
g.word = "TREE"
self.assertEqual(g.word, "TREE", "Should be TREE")
"""def test_sum_tuple(self):
self.assertEqual(sum((1, 2, 2)), 6, "Should be 6")"""
if __name__ == '__main__':
unittest.main... |
Python | UTF-8 | 556 | 3.03125 | 3 | [] | no_license | import json
import os
import pandas as pd
from argparse import ArgumentParser
import matplotlib.pyplot as plt
if __name__ == '__main__':
parser = ArgumentParser()
parser.add_argument('-f', '--file',required=True, help='Log file to read data from')
args = parser.parse_args()
if args.file:
if os.path.exists(args.... |
Java | UTF-8 | 756 | 2.84375 | 3 | [] | no_license | package myproject.ui;
/**
* @see UIMenuBuilder
*/
public final class UIMenu {
private final String heading;
private final Pair[] menu;
UIMenu(String heading, Pair[] menu) {
this.heading = heading;
this.menu = menu;
}
public int size() {
return menu.length;
}
pub... |
C# | UTF-8 | 382 | 3.546875 | 4 | [] | no_license | interface IFileGenerator
{
void GenerateFile(string userInput);
}
class FileGenerator : IFileGenerator
{
// inject both or your file services into the constructor
public void GenerateFile(string userInput)
{
switch(userInput)
{
... |
Shell | UTF-8 | 1,138 | 3.5625 | 4 | [
"Apache-2.0"
] | permissive | #!/bin/bash
#
# Copyright (c) 2018 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
# This script is used to reset the kubernetes cluster
SCRIPT_PATH=$(dirname "$(readlink -f "$0")")
source "${SCRIPT_PATH}/../../lib/common.bash"
cri_runtime="${CRI_RUNTIME:-crio}"
case "${cri_runtime}" in
containerd)
cri_... |
Java | UTF-8 | 3,646 | 1.945313 | 2 | [] | no_license | package com.visioglobe.libVisioMove;
public class VgINavigationListenerRefPtr {
protected boolean swigCMemOwn;
private long swigCPtr;
protected VgINavigationListenerRefPtr(long cPtr, boolean cMemoryOwn) {
this.swigCMemOwn = cMemoryOwn;
this.swigCPtr = cPtr;
}
protected static long... |
Python | UTF-8 | 527 | 3.59375 | 4 | [] | no_license | def equilibrium(a,n):
i=0
j=n
flag=False
sm,ls=0,0
sm=sum(a)
while i<j:
sm-=a[i]
if sm==ls:
flag=True
break # O(n)
ls+=a[i]
i+=1
if flag:
return i
return -1
if __name__ ==... |
SQL | UTF-8 | 860 | 3.84375 | 4 | [] | no_license | --
-- OV-chipkaart stations
--
CREATE TABLE stations_data (
company INT NOT NULL, -- transport company number
ovcid INT NOT NULL, -- OV-chipkaart station number
name VARCHAR(50), -- name as used by transport company
city VARCHAR(50), -- city/municipality
long... |
Python | UTF-8 | 151 | 2.9375 | 3 | [] | no_license | t=int(input())
for test in range(t):
n,m,k=map(int,input().split())
if abs(n-m)>k:
print(abs(n-m)-k)
else:
print(0)
|
Shell | UTF-8 | 478 | 3.09375 | 3 | [] | no_license | #!/bin/sh
set -e
if [ "$1" = "configure" ]; then
if dpkg --compare-versions "$2" 'lt-nl' '2018.07.30~' && which gpg >/dev/null && which apt-key >/dev/null; then
KEYRING="/etc/apt/trusted.gpg"
eval $(apt-config shell KEYFILE Apt::GPGV::TrustedKeyring)
eval $(apt-config shell KEYFILE Dir::Et... |
Python | UTF-8 | 1,195 | 4.25 | 4 | [] | no_license | """
Define a function, munch_prefix(p, q),
that takes as input two lists and returns a new list containing all the elements of q
except of any elements at the beginning of q that match the corresponding elements at the beginning of p.
For example,
munch_prefix([1, 2, 3, 4], [5, 6]) => [5, 6]
munch_prefix([1, 2, 3... |
C++ | UTF-8 | 1,534 | 2.5625 | 3 | [] | no_license | #include <vector>
#include <algorithm>
#include <utility>
#include <cstdio>
#include <queue>
#define min(a,b) ((a<b)?a:b)
const long long INF = 1e15;
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;
vector <pll> G1[5001], G2[5001];
priority_queue <pll, vector<pll>, greater<pll> > Q;
ll d1[5001], ... |
C | UTF-8 | 455 | 3.671875 | 4 | [] | no_license | #include <unistd.h>
int is_lower(char c)
{
if ('a' <= c && c <= 'z')
return (1);
return (0);
}
int is_upper(char c)
{
if ('A' <= c && c <= 'Z')
return (1);
return (0);
}
int main(int argc, char** argv)
{
int i;
char c;
if (argc == 2)
{
i = 0;
while (argv[1][i])
{
c = argv[1][i];
if (is_l... |
Java | UTF-8 | 387 | 1.546875 | 2 | [] | no_license | package com.orientdata.lookforcustomers.view.home.imple;
import com.orientdata.lookforcustomers.base.BaseView;
import com.orientdata.lookforcustomers.bean.MessageAndNoticeBean;
import java.util.List;
/**
* Created by wy on 2017/12/10.
*/
public interface IMsgAndNoticeView extends BaseView {
void selectMsgAndAn... |
Java | UTF-8 | 1,070 | 2.921875 | 3 | [] | no_license | package asteroids.components.Geometry3D;
import asteroids.components.Component;
import asteroids.math.Vector3f;
public class PointLightComponent extends Component
{
public LightComponent lightComponent;
public Vector3f attenuation;
public float range;
public PointLightComponent()
{
this.lightCom... |
Java | UTF-8 | 186 | 2.484375 | 2 | [] | no_license | package kr.taeu.effectiveJava.item38;
// 인터페이스를 이용해 확장 가능 열거 타입을 흉내 냈다.
public interface Operation {
double apply(double x, double y);
}
|
Python | UTF-8 | 4,602 | 2.71875 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python
#-*- coding: utf-8 -*-
from __future__ import print_function
from bs4 import BeautifulSoup as bs
from selenium import webdriver
import multiprocessing
import os
import re
import signal
import sys
import time
import csv
import urllib2
import constants
def worker(lock, queue, monitor):
signal.... |
Python | UTF-8 | 2,589 | 3.140625 | 3 | [] | no_license | import unittest
from src.Display.TestOutput import TestOutput
from src.Engine.Game import Game
class GameTest(unittest.TestCase):
user_output = TestOutput()
game = Game({"Game Id": "1", "Game Name": "City Builder", "Price": 8.99, "Stock": 4})
game2 = Game({"Game Id": "2", "Game Name": "Survivalist", "Pr... |
Java | UTF-8 | 3,325 | 2 | 2 | [
"BSD-3-Clause",
"Apache-2.0",
"BSD-2-Clause"
] | permissive | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... |
Markdown | UTF-8 | 9,479 | 3.421875 | 3 | [] | no_license | +++
title = "第一百九十九章 车轮战"
weight = 199
+++
第8卷
第一百九十九章 车轮战
床上,五位赤裸的少女并排躺在一起,刚刚洗完澡,还经历了一轮性爱之后的她们都感觉到有点疲倦,处于五位少女的最中间的林萱则是完全一副人生赢家的模样。她一手揽着左边的林璇,一手在旁边诺霖的小肚子上来回抚摸着,身后的那条猫尾巴好像是放在了诺汐的小穴里,在那温暖的地方休息着。虽然这样子很奇怪,不过诺汐本人也并没有什么在意的,毕竟林萱学姐的那条猫尾巴挺舒服的。床上唯有月涟一人,就单纯地呆在最左侧,好像是被遗忘的样子。
“喵~月涟酱是不是寂寞了呢?”林璇看出了月涟的心情,将自己的尾巴缠到了月涟的脚踝上,自... |
Java | UTF-8 | 366 | 1.617188 | 2 | [] | no_license | package com.nklmish.springkafkaissue.kafkautilsexception;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class KafkaUtilsExceptionApplication {
public static void main(String[] args) {
SpringApplication.run(Kafk... |
C# | UTF-8 | 1,637 | 3.421875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Net;
using System.IO;
using Newtonsoft.Json;
namespace Pokedex
{
class Program
{
static void Main(string[] args)
... |
Shell | UTF-8 | 188 | 2.90625 | 3 | [] | no_license | #!/bin/sh
echo Content-type: text/html
echo ""
WANIP=`busybox ip -4 -o addr show wan0 | busybox awk '{print $6}'`
if [ -n "$WANIP" ]; then
echo "$WANIP"
else
echo "127.0.0.1"
fi |
Python | UTF-8 | 174 | 3.703125 | 4 | [
"MIT"
] | permissive | class Circle:
def __init__(self, radius):
self.radius = radius
def area(self):
return self.radius**2*3.14
aCircle = Circle(2)
print(aCircle.area())
|
JavaScript | UTF-8 | 1,120 | 2.609375 | 3 | [] | no_license | import React, { useState } from 'react';
// import logo from './logo.svg';
import './App.css';
function App() {
let [count, updateCount] = useState(0);
let [nightMode, updateMode] = useState(false);
return (
<div className={`main_div ${nightMode ? 'main_div_night' : ''}`}>
<div className='color_change... |
Markdown | UTF-8 | 1,785 | 2.90625 | 3 | [
"Unlicense"
] | permissive | ---
layout: post
title: Unusual Spending Kata
categories: [Experienced, Mocks, TDD, Pair-Programming]
image: default.jpg
---
{% include credits.md name='Test Double Consulting Agency' url='https://github.com/testdouble/contributing-tests/wiki/Unusual-Spending-Kata' %}
## Description
You work at a credit card company... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.