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 |
|---|---|---|---|---|---|---|---|
Markdown | UTF-8 | 6,146 | 2.59375 | 3 | [] | no_license | 三十三
二十一
路易丝·德·绍利厄致勒内·德·莱斯托拉德
嫁了人的亲爱的小鹿,你这封信来得正好。它为我证明了一个大胆计划的正确性,对于这个计划,我已经酝酿了无数个日日夜夜。我心里产生了一种难以名状的欲望,想了解某些从未经历过、甚至被禁止知道的事,这种欲望使我时刻不得安宁。它也说明,社会法则和自然法则在我的头脑里正进行着一场战斗。我说不清楚,自然法则在我身上是否要比社会法则更加强大,然而,我惊讶地发现,我正在调和这两大力量。说得明白一点:我想找一个晚上,单独和费利普在花园尽头的菩提树下谈一个小时。公爵夫人曾笑着把我称作情窦初开的饶舌妇,这一说法还得到父亲的肯定。现在,我这种欲望倒是使我无愧于这一称号... |
Python | UTF-8 | 1,642 | 2.859375 | 3 | [
"Apache-2.0"
] | permissive | import sys
sys.path.append("../../src/")
from DEVS import *
import random
class Generator(AtomicDEVS):
def __init__(self, num, ta):
AtomicDEVS.__init__(self, "Generator" + str(num))
self.state = None
self.ta = ta
def timeAdvance(self):
return self.ta
class StaticModel(Cou... |
Python | UTF-8 | 274 | 3.953125 | 4 | [] | no_license | x1=float(input("Enter Value: "))
x2=str(input("Enter unit A(Feet) or B(Inches): "))
if x2!="A" and x2 != "B" :
print("Error")
elif x2=="A":
print( "the Value in Centimeter is: " + str(x1*30.28))
elif x2=="B":
print( "the Value in Centimeter is: " + str(x1*2.54)) |
Markdown | UTF-8 | 6,353 | 2.8125 | 3 | [] | no_license | MEGA65 Extended BASIC
-------------------
This extended BASIC is intended as a starting point, not a finished product.
For convenience, I have created it by extending the relatively simple starting point
that is the C64's BASIC 2. It would of course be better to extend BASIC 7 or BASIC 10,
but for now this is what we... |
Java | UTF-8 | 243 | 2.515625 | 3 | [] | no_license | package Model;
/**
*
* @author dvandenberge
*/
public class CircleAreaService {
public double getArea(String r){
double rad=r!=null?Double.parseDouble(r):0;
return Math.PI*Math.pow(rad,2);
}
}
|
Markdown | UTF-8 | 6,346 | 3.109375 | 3 | [
"MIT"
] | permissive | ---
date: "1"
---
# ENS Domains
You can easily point an [Ethereum Name Service](https://ens.domains/) (ENS) domain to your **IPFS site** and have the content automatically update for future deployments. The benefit of ENS domains is that they are decentralized and trustless, running on the Ethereum blockchain network... |
C# | UTF-8 | 8,518 | 2.578125 | 3 | [
"MIT"
] | permissive | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.InteropServices;
using System.Drawing;
using System.Collections.ObjectModel;
#region title
#endregion
namespace LgdLogo
{
using LgdLogo.ExtensionMethod;
[StructLayout(LayoutK... |
C# | UTF-8 | 525 | 2.796875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
namespace Dora.Caching
{
public static class CacheExtensions
{
public static async Task<T> GetValueAsync<T>(this ICache cache, string key, T defaultValue = default(T))
{
Guard.ArgumentNotNull(cache, name... |
PHP | UTF-8 | 11,859 | 2.765625 | 3 | [] | no_license | <!DOCTYPE html>
<html lang="en" >
<?php
include 'header.php';
include 'common/common.php';
?>
<head>
<title>Schedule Administration</title>
</head>
<body>
<?php include 'navStart.php'; ?>
<div class="container">
<h2>Schedule Administration</h2>
<?php
function formatMonthlySched... |
C# | UTF-8 | 1,900 | 2.515625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using Server;
namespace Server.Mobiles
{
public class Cobbler : BaseVendor
{
private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
[Constructable]
public Cobbler()
: ... |
Java | UTF-8 | 3,282 | 2.3125 | 2 | [] | no_license |
package fr.aumjaud.antoine.services.synology.chatbot.service;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;
import java.io.IOException;
import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Paths;
import... |
TypeScript | UTF-8 | 4,515 | 2.828125 | 3 | [
"BSD-3-Clause"
] | permissive | import { Option, Some, None } from 'space-lift';
import { Effect } from '../effects/Effect';
import { LogEvent } from '../logging/LogEvent';
import clone = require("clone");
import { CanvasState } from "../effects/CanvasState";
export class Scope {
private _varBindings: Map<string, Option<any>>;
pr... |
C++ | UTF-8 | 8,745 | 3.03125 | 3 | [] | no_license | //
// Created by zhang on 2018/10/10.
//
/*
* dfs方法有误
#include <iostream>
#include <cmath>
#include <cstdio>
#include <iomanip>
using namespace std;
#define MaxSize 10000
int Graph[MaxSize][MaxSize], N, M, DFS_Visited[MaxSize]; // N结点数 M边数
int DFS(int start, int distance, int count){
DFS_Visited[start] = 1;
... |
Python | UTF-8 | 1,346 | 3.125 | 3 | [] | no_license | import sys
from PyQt5.QtWidgets import *
from PyQt5.QtGui import QPixmap
class Window(QWidget):
def __init__(self):
super().__init__()
# 화면의 (x : 150, y: 50) 위치에서 (width : 1000, height : 500) 크기의 윈도우가 생성됩니다.
self.setGeometry(150, 50, 1000, 500)
# Window의 Title을 지정합니다.
self.U... |
PHP | UTF-8 | 6,898 | 2.8125 | 3 | [] | no_license | <?php
/*****************************************************
*
* phpMyCalendar
* Author: Balazs Bezeczky
* phpMyCalendar@gmx.net
* http://phpmycalendar.sourceforge.net/
*
* Last Modified: April 23, 2003
* Version: 1.1.2
*
* Please read the README file for more information
* to install see INSTALL
*
***... |
Markdown | UTF-8 | 1,721 | 2.921875 | 3 | [] | no_license | # WEB DEVELOP STANDARD
1. API standard ([restful style](http://www.ruanyifeng.com/blog/2014/05/restful_api.html))
* back-end => front-end:
get (query info):
```js
// request successed
// /api/v1/areas/info/areas
{
"code": 200,
... |
PHP | UTF-8 | 2,558 | 2.5625 | 3 | [] | no_license | <?php
require 'function.php';
// if(empty($_POST['nama']) || empty($_POST['keterangan']) || empty($_POST['harga']) || empty($_POST['jumlah'])){
// $error = "<h3 style='color:red;'> Data tidak boleh kosong</h3>";
// return false;
// }
if(isset($_POST["tambah"])){
if(tambah($_POST) == 1){
echo "<sc... |
Markdown | UTF-8 | 7,020 | 3.234375 | 3 | [
"BSD-2-Clause"
] | permissive | # node-netbios-name
A utility module for working with NetBIOS names as defined in [RFC1001][],
[RFC1002][], and [RFC883][].
[](https://travis-ci.org/wanderview/node-netbios-name)
## Example
``` javascript
var NBName = require('netbios-name');
/... |
C++ | UTF-8 | 7,332 | 3.0625 | 3 | [] | no_license | #include "doughnutmode.h"
DoughnutMode::DoughnutMode(int height, int width, float density, int outputType, string outputFile) : Game(height, width, density, outputType, outputFile){
}
DoughnutMode::DoughnutMode(string file, int outputType, string outputFile) : Game(file, outputType, outputFile){
}
DoughnutMode::~D... |
Java | UTF-8 | 3,548 | 1.765625 | 2 | [] | no_license | package com.rfchina.community.service;
import com.rfchina.community.component.PlatformGlobalComponent;
import com.rfchina.community.persistence.mapper.SysSmsTemplateMapper;
import com.rfchina.community.persistence.model.SysSmsTemplate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework... |
JavaScript | UTF-8 | 2,640 | 2.53125 | 3 | [] | no_license | /**
* Extended Webix AJAX (http://docs.webix.com/helpers__ajax_operations.html)
* so that can work with server security constraints.
*
* Created by Phuttipong on 19/5/2559.
*/
var domain = '//localhost:8080/';
webix.extend(webix.ajax, {
/**
* helper method for create Webix general, non-secure GET ajax.
... |
Python | UTF-8 | 910 | 3.875 | 4 | [] | no_license | # python3
def max_pairwise_product(numbers):
n = len(numbers)
max_product = 0
for first in range(n):
for second in range(first + 1, n):
max_product = max(max_product,
numbers[first] * numbers[second])
return max_product
def max_pairwise_product_fast... |
Java | UTF-8 | 631 | 2.4375 | 2 | [
"Apache-2.0"
] | permissive | package com.six.dove.common;
/**
* @author sixliu
* @date 2018年1月17日
* @email 359852326@qq.com
* @Description 服务接口
*/
public interface Service {
/**
* 服务状态
*
* @author Administrator
*
*/
public enum State {
INIT,START, STOP, FAILED;
}
/**
* 获取服务名称
*
* @return
... |
SQL | UTF-8 | 632 | 3.8125 | 4 | [] | no_license | select vmt.vehicle_id,plt.lead_name,plt.phone_number,vmt.vehicle_no,emt.first_name,
CONCAT(date(pvdt.owned_on),' ',TIME_FORMAT(pvdt.owned_on, '%h:%i:%s %p')) as updated_on
from purchased_vehicle_details_tbl pvdt inner join vehicle_master_tbl vmt on vmt.vehicle_id=pvdt.vehicle_id and vmt.is_active='Y'
and pvdt.is_active... |
SQL | UTF-8 | 26,385 | 3.09375 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.5.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jun 24, 2018 at 03:50 PM
-- Server version: 5.7.11
-- PHP Version: 5.6.19
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */... |
JavaScript | UTF-8 | 799 | 2.9375 | 3 | [] | no_license | const puppeteer = require('puppeteer'); //importar pupperteer
puppeteer.launch().then(async browser => { //función en línea que se invoca inmediatamente // se crea el navegador llamndo al método launch
const page = await browser.newPage(); //crea la página de navegador
await page.goto('https://www.mondosonoro.com/... |
C++ | UTF-8 | 567 | 2.53125 | 3 | [] | no_license | #pragma once
#include<iostream>
#include<string>
#include "Player.h"
using namespace std;
/**
*\author Elif GENC (01elifgenc@gmail.com)
*\date 20.12.2017
*/
class VideoPlayer:public Player
{
protected:
/**
\brief Desteklenen bicimler
*/
string* supportedFormats;
public:
/**
\brief Desteklenen fo... |
Markdown | UTF-8 | 2,429 | 2.84375 | 3 | [
"MIT"
] | permissive | # The source plugin
The `source` plugin creates a `JAR` file with the project source code. It defines five goals: `aggregate` , `jar` , `test-jar` , `jar-no-fork` , and `test-jar-no-fork` . All these five goals of the source plugin will run under the `package` phase of the `default` lifecycle.
Unlike any of the plugi... |
C | UTF-8 | 402 | 3.4375 | 3 | [] | no_license | #include<stdio.h>
int main(){
int num, soma, hn;
hn=0;
num=1;
while(hn<100){
soma=num;
while(soma!=1 && soma!=4 && soma!=9){
soma=digit(soma);
}
if(soma==1){
printf("%d\n", num);
hn=hn+1;
}num++;
}
return 0;
}
int digit(int v){
int res, sum;
res=0;
sum=0;
... |
C++ | UTF-8 | 5,345 | 3 | 3 | [
"Apache-2.0"
] | permissive | #ifndef DOCUMENT_CLASS_COMPONENT_H
#define DOCUMENT_CLASS_COMPONENT_H
#include <vector>
#include <string>
#include <tuple>
#include "Atom.hpp"
#include "StringSplitter.hpp"
#include "StringPayload.hpp"
#include "HashFunction.hpp"
#define EDGE_WEIGHT_TYPE float
#define EDGE_WEIGHT_UNIT_VALUE 1.0
/*
* A class that r... |
Java | UTF-8 | 736 | 2.34375 | 2 | [
"MIT"
] | permissive | package me.shatteredhej.railhack.railhackmod.event.events;
import me.shatteredhej.railhack.railhackmod.event.EventCancellable;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
public class EventDamageBlock extends EventCancellable {
private BlockPos BlockPos;
private EnumFacing ... |
C# | UTF-8 | 5,286 | 3.34375 | 3 | [
"MIT"
] | permissive | using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Native.Csharp.App.Actors
{
/// <summary>
/// 文件操作
/// </summary>
class FileIOActor
{
static string logFile = "log.txt";
/// <summary>
... |
Markdown | UTF-8 | 8,480 | 2.765625 | 3 | [
"Apache-2.0"
] | permissive | Congenio: Configuration Generation Language
========================================================
The Congenio Configuration Generation Language is a tool
to maintain and generate configuration values (primarily) for experiments
in a reproducible manner.
See [User's guide](https://github.com/tatemura/congenio/wiki... |
C# | UTF-8 | 3,118 | 2.8125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.Concurrent;
using System.Threading;
namespace Lab6
{
public class Bartender
{
private Action<string> Callback;
private ConcurrentQueue<Patron> PatronQueu... |
Python | UTF-8 | 1,293 | 3.078125 | 3 | [] | no_license | import pickle
_phon_dicts = pickle.load(open('./resources/phon-dicts.pydb','rb'))
def translate(form,source_alpha='jm',target_alpha='elp',cmu_delim='.'):
"""
Accepts a phonological transcription/form and converts it from one phonetic
encoding to another.
form: string, required
source_alpha: str... |
Python | UTF-8 | 157 | 3.515625 | 4 | [] | no_license | import math
x = 2
print(math.pi)
if x >= -math.pi and x <= math.pi:
y = math.cos(3*x)
print(y)
elif x < -math.pi or x > math.pi:
y = x
print(y) |
Java | UTF-8 | 657 | 3.265625 | 3 | [] | no_license | package vista;
import app.InputController;
public class Menu implements Vista {
private String[] options;
private int seleccion = 1;
public Menu (String... options)
{
this.options = options;
}
@Override
public void mostrar()
{
System.out.println("/ ------------------------- \\");
for (int i = 0;... |
PHP | UTF-8 | 1,985 | 2.75 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | <?php
class Pagination_model extends CI_Model
{
function __construct() {
parent::__construct();
}
private $total;
private $offset;
private $search_data;
private $pre_url;
private $num_page;
private $limit;
public function create_link($config)
{
$this->initialize($config);
$total_page = ceil($this->t... |
Java | UTF-8 | 418 | 1.695313 | 2 | [] | no_license | package org.densyakun.forge.japanpack;
import org.densyakun.forge.japanpack.tileentity.TileEntityTataraFurnace;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.world.World;
public class JapanPackCommonProxy {
public World getClientWorld() {
return null;
}
public void registerTileEntity() {
... |
Java | UTF-8 | 7,629 | 2.25 | 2 | [] | no_license | /*
* Copyright (C) 2019 DBC A/S (http://dbc.dk/)
*
* This is part of ee-remote-admin-access
*
* ee-remote-admin-access is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the Lice... |
Shell | UTF-8 | 1,008 | 3.390625 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT",
"OpenPBS-2.3"
] | permissive | #!/bin/sh
# This file is bilingual. The following shell code finds our preferred python.
# Following line is a shell no-op, and starts a multi-line Python comment.
# See https://stackoverflow.com/a/47886254
""":"
# preferred pythons for running buildtest
PREFERRED_PYTHONS="python3 python"
# Find a suitable python in... |
PHP | UTF-8 | 2,490 | 2.546875 | 3 | [
"MIT"
] | permissive | <?php
namespace Shaparak\Service\Requests;
use Carbon\Carbon;
use Exception;
use Shaparak\Database\models\Merchant;
use Shaparak\Database\models\Response;
use Shaparak\Service\Requests\WriteRequest\ShopProviderRegister;
use Shaparak\Service\Requests\WriteRequest\TerminalRegister;
class Shaparak
{
public $request... |
Java | UTF-8 | 709 | 3.09375 | 3 | [] | no_license | package br.com.treinaweb.projeto.classes;
public class Cliente {
private String nome;
private String nomeMae;
private String cpf;
private String rg;
public void cadastroCliente(String nome, String cpf,
String rg, String nomeMae){
this.nome = nome;
th... |
Python | UTF-8 | 406 | 4.4375 | 4 | [] | no_license | # Bubble Sort
def bubbleSort(arr):
for i in range(len(arr)-1):
for j in range(len(arr)-1-i):
if arr[j] > arr[j+1]:
swap(arr,j,j+1)
return arr
def swap(arr, x, y):
temp = arr[x]
arr[x] = arr[y]
arr[y] = temp
# Driven Program
if __name__ == "__main__":
array ... |
C++ | UTF-8 | 1,321 | 3.6875 | 4 | [] | no_license | using namespace std;
#include <iostream>
#include <limits>
#include <vector>
class CoinChange {
public:
int countChange(const vector<int> &denominations, int total) {
// minimum number of coins needed to make a change of T
int n = (int)(denominations.size());
// minimum number of coins needed to ... |
PHP | UTF-8 | 1,045 | 2.921875 | 3 | [] | no_license | <?php
namespace Chap;
use Chap\DB;
class Chapter
{
public function createDB()
{
$parsed = explode(';', file_get_contents('parse_file'));
DB::insertIntoDB($parsed);
}
public function getResult(){
$to_obj = array_unique((new DB)->getToObjectFromDB(), SORT_REGULAR);
if (empty($to_obj))
return;... |
Python | UTF-8 | 446 | 4.0625 | 4 | [] | no_license | # Volume of circle
from math import pi
def volume_of_circle(radius, pi):
return 4 / 3 * pi * radius ** 3
r = int(input('Enter the radius : '))
result = volume_of_circle(r,pi)
print(result)
'''
# lohit's answer
def area(radius):
return 3.142 * radius * radius
def volume(area, length):
print(area*le... |
PHP | UTF-8 | 558 | 2.75 | 3 | [] | no_license | <?php
use PHPUnit\Framework\TestCase;
class UserTest extends TestCase {
public function testReturnsFullName() {
// set to autoload
//require("User.php");
$user = new User;
$user->firstName = "John";
$user->lastName = "Tiger";
$this->assertEquals('John Tiger', $user->GetFullName());
}
pu... |
Python | UTF-8 | 7,184 | 2.984375 | 3 | [] | no_license |
import numpy as np
from dtw import *
import matplotlib.pyplot as plt
import argparse
import os
def dtw_find_seq(path_A=None, path_B=None):
# 动态规划对齐两个序列
# path_A='ATCGGGGGTACACCTTT'
# path_B='AAAAAAAATTTTTCGGGGGGGGGGGGTAAAACCCA'
mat_path = np.zeros([len(path_B), len(path_A)])
print('path_A len:{... |
Ruby | UTF-8 | 982 | 2.6875 | 3 | [] | no_license | class Statistics < ActiveRecord::Base
belongs_to :user
class << self
def user_added(user)
Statistics.create(:user => user, :action => "added")
end
def user_removed(user)
Statistics.create(:user => user, :action => "removed")
end
def get_number_of_users(date)
result... |
Shell | UTF-8 | 241 | 2.65625 | 3 | [] | no_license | #!/bin/bash
echo "Updating Sub Repos"
if [ ! -d "./drupal" ]; then
git clone --branch 8.x http://git.drupal.org/project/drupal.git
fi
if [ ! -d "./pages" ]; then
git clone --branch gh-pages git@github.com:ericduran/drupalcores.git pages
fi
|
Python | UTF-8 | 2,622 | 3.03125 | 3 | [] | no_license | ''' Detect human skin tone and draw a boundary around it.
Useful for gesture recognition and motion tracking.
Inspired by: http://stackoverflow.com/a/14756351/1463143
Date: 08 June 2013
'''
# Required moduls
import cv2
import numpy
import serial
s = serial.Serial(port='/dev/ttyUSB0', baudrate=9600)
# Constants f... |
C# | UTF-8 | 1,159 | 2.734375 | 3 | [] | no_license | // -----------------------------------------------------------------------
// This code is part of the Alexandria project (https://github.com/ahlec/Alexandria).
// Written and maintained by Alec Deitloff.
// Archive of Our Own (https://archiveofourown.org) is owned by the Organization for Transformative Works (http://... |
JavaScript | UTF-8 | 1,632 | 3.09375 | 3 | [] | no_license | function shoppingTime(memberId, money) {
// you can only write your code here!
var hasil ={};
var belanja = [
["Sepatu Stacattu", 1500000],
["Baju Zoro", 500000],
["Baju H&N", 250000],
["Sweater Uniklooh", 175000],
["Casing Handphone", 50000]
];
var listPurchase... |
Python | UTF-8 | 1,218 | 4.53125 | 5 | [] | no_license | # 문제: 알파벳 소문자로만 이루어진 단어 S가 주어진다. 각각의 알파벳에 대해서, 단어에 포함되어 있는 경우에는 처음 등장하는 위치를, 포함되어 있지 않은 경우에는 -1을 출력하는 프로그램
# 입력: 첫째 줄에 단어 S가 주어진다. 단어의 길이는 100을 넘지 않으며, 알파벳 소문자로만 이루어져 있다.
# 출력: 각각의 알파벳에 대해서, a가 처음 등장하는 위치, b가 처음 등장하는 위치, ... z가 처음 등장하는 위치를 공백으로 구분해서 출력한다. 만약, 어떤 알파벳이 단어에 포함되어 있지 않다면 -1을 출력한다. 단어의 첫 번째 글자는 0번째 위치이고, 두 번... |
Shell | UTF-8 | 780 | 2.96875 | 3 | [
"Apache-2.0"
] | permissive | #!/usr/bin/env bats
load bats-workaround
runtime_os=$(uname -s | tr '[:upper:]' '[:lower:]')
runtime_arch=$(go env GOARCH | tr '[:upper:]' '[:lower:]')
exe="dist/kubectl-neat_${runtime_os}_${runtime_arch}"
rootDir="./test/fixtures"
@test "invalid args 1" {
echo $exe >&3
run2 "$exe" --foo
[ $status -eq 1 ]
... |
C# | UTF-8 | 1,400 | 2.6875 | 3 | [] | no_license | using System;
namespace Mongeral.Provisao.V2.DTO
{
public class ChaveProduto : IEquatable<ChaveProduto>
{
public int ItemProdutoId { get; }
public int TipoFormaContratacaoId { get; }
public int? TipoRendaId { get; }
public DateTime DataVigencia { get; }
private DateTim... |
Java | UTF-8 | 761 | 2.671875 | 3 | [] | no_license | import java.util.List;
import java.util.Observable;
/**
*
* @author adri
*/
abstract public class Operation extends Observable{
private float progress;
private boolean necessaryLicense;
public float getProgress() {
return progress;
}
protected void setProgress(float p){
thi... |
Python | UTF-8 | 11,018 | 2.53125 | 3 | [
"MIT"
] | permissive | import sys
import os
import argparse
import subprocess
import fnmatch
from Bio import SeqIO
### Version 5, created 27 August 2020 by Nicole S Paulat ###
### Compare MELT-DELETION output to its input RepeatMasker file to append orientation
### into the MELT-DELETION hits, and check for inconsistencies in MELT-DEL outp... |
JavaScript | UTF-8 | 1,739 | 3.265625 | 3 | [] | no_license | <!--
function trace(data, type, iteration)
{
var S = [], T = (Boolean(type) || (type === undefined)) ? true : Boolean(type), I = (iteration > 0) ? Number(iteration) : 0;
var repeat = function (t, n) { var s = ''; for (var i = 0; i < n; i++) s += t; return s; }
var s = function (i, s, t) { S[S.length] = repeat... |
Markdown | UTF-8 | 988 | 3.046875 | 3 | [] | no_license | # Build Infrastructure
Here we will have our first infrastructure created, i.e, provision an EC2 instance on Amazon Web Services (AWS).
## Prerequisites
- The Terraform CLI installed.
- The AWS CLI installed.
- An AWS account.
- Your AWS credentials.
## Steps to follow:
- Configure the AWS CLI from your terminal
... |
C# | UTF-8 | 1,634 | 2.609375 | 3 | [] | no_license | using ShoppingCartDataLayer.Repositories;
using ShoppingCartLibrary;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ShoppingCartSystem
{
public class OrderManager : ShoppingSystemManager
{
public OrderManager(IDataSource da... |
SQL | UTF-8 | 6,746 | 3.109375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Dec 04, 2020 at 04:22 AM
-- Server version: 5.7.24
-- PHP Version: 7.4.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHA... |
Java | UTF-8 | 613 | 2.40625 | 2 | [] | no_license | package com.roadioapp.roadioappuser.mModels;
import android.app.Activity;
import android.widget.Toast;
import com.roadioapp.roadioappuser.mObjects.AuthObj;
public class DriverBid {
public String amount;
private Activity activity;
public DriverBid(){
}
public DriverBid(Activity activity){
... |
Python | UTF-8 | 542 | 4.5 | 4 | [] | no_license | # 定义类名 首字母大写(大驼峰法)
class Person:
def __init__(self, name, age, sex):
self.name = name
self.age = age
self.sex = sex # 没使用的变量尽量不要定义
def eat(self):
print("我是%s" % self.name)
print("我饿了,我要吃吃吃")
def sleep(self):
print("我是%s" % self.name)
... |
Python | UTF-8 | 4,391 | 4.25 | 4 | [
"MIT"
] | permissive | import matplotlib.pyplot as plt
""" The Car class defines a car's movement and keeps track of its state.
The class includes init, move, and display functions.
This class assumes a constant velocity motion model and the state
of the car includes the car's position, and it's velocity.
Attributes:
... |
Ruby | UTF-8 | 746 | 2.640625 | 3 | [] | no_license | require_relative 'Bookie.rb'
require_relative 'BookieView.rb'
require_relative '../ObserverPattern/Observer.rb'
class BookieController < Object
include Observer
attr_reader :model
def initialize
super()
@view = BookieView.new
@model = Bookie.new
end
def create
data = @view.createView
@model.setUsername(d... |
Java | UTF-8 | 1,041 | 2.0625 | 2 | [] | no_license | package com.pedrohubner.message.services;
import com.pedrohubner.message.models.Messages;
import com.pedrohubner.message.models.MessagesDAO;
import com.pedrohubner.message.repositories.MessagesRepository;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import reactor.core.publisher.Flu... |
Java | UTF-8 | 1,343 | 3.078125 | 3 | [
"MIT"
] | permissive | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package mpoop6;
/**
* Clse que hereda de la clase Persona y modela a un alumno
* @author Leal Hernandez Haziel Ivan
*/
p... |
Shell | UTF-8 | 751 | 2.59375 | 3 | [] | no_license | _gemname=rvpacker
pkgname=ruby-$_gemname
pkgver=1.2.0
pkgrel=2
pkgdesc="Pack and unpack RPG Maker data files"
arch=(any)
url="https://github.com/akesterson/rvpacker"
license=("MIT")
depends=(ruby-trollop ruby-formatador)
source=("https://rubygems.org/downloads/$_gemname-$pkgver.gem")
noextract=("$_gemname-$pkgver.gem")... |
Markdown | UTF-8 | 7,527 | 3.65625 | 4 | [] | no_license | ## DATA ANALYSIS FOR COMPANY XYZ
* Company XYZ owns a supermarket in 3 cities across the Country - Lagos, Abuja and Portharcourt. This data analysis is conducted to determine sales trend and Company growth, as there has been an increase in Supermarket competition.
### Loading Datasets
* The process begins with importi... |
Swift | UTF-8 | 2,692 | 2.875 | 3 | [] | no_license | //
// Provider.swift
// router
//
// Created by agies on 7/3/18.
// Copyright © 2018 agies. All rights reserved.
//
import UIKit
public protocol ControllerProvider {
func get<TController: UIViewController>(byName name: String) -> TController
}
public class StoryboardControllerProvider: ControllerProvider {
... |
Markdown | UTF-8 | 7,113 | 2.765625 | 3 | [
"MIT"
] | permissive | # Scratcher.js #
A tiny `scratch off` pluggin based on HTML5 canvas for mobile.
Have only 2.3k after gzip.
<a href="http://xiaoyuze.com/demo/scratcher/index.html" target="_blank">Here's a live demo</a>
## Support ##
IE9+ & all mordern browser & all mobile browser (Android 2.3+).
## Dependence ##
Jquery/Zept... |
C++ | UTF-8 | 988 | 2.71875 | 3 | [] | no_license | const int micPin = 0;
const int baseLine = 338;
void setup ()
{
Serial.begin (9600);
pinMode (10, OUTPUT);
pinMode (11, OUTPUT);
pinMode (12, OUTPUT);
pinMode (13, OUTPUT);
}
void oscilloscope (int reading)
{
int x = reading + 175;
Serial.write( 0xff );
Serial.write( (x >> 8) & 0xff );
Serial.write( x... |
TypeScript | UTF-8 | 1,950 | 2.78125 | 3 | [] | no_license | export class Address {
constructor(private _addrId?: number,
private _addrLongitude?: number,
private _addrLatitude?: number,
private _addrCountry?: string,
private _addrCity?: string,
private _addrStreetName?: string,
private _addrS... |
C# | UTF-8 | 3,732 | 2.6875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using DemoCRUD.Models;
namespace DemoCRUD.Controllers
{
public class ProductController : Controller
{
// GET: Product
public ActionResult Index()
{
var db = new DemoCr... |
C++ | UTF-8 | 456 | 2.96875 | 3 | [
"MIT"
] | permissive | #include "simple_task.h"
SimpleTask::SimpleTask(char const* n, unsigned et) :
Task(n), executionTime(et), progress(0) {}
void SimpleTask::print(std::ostream& os) const {
os << "Проста ";
Task::print(os);
}
unsigned SimpleTask::work(unsigned t) {
if (isFinished() || t == 0)
return t;
// executionTime >... |
JavaScript | UTF-8 | 1,173 | 2.84375 | 3 | [
"MIT"
] | permissive | import expect from 'expect';
const { split } = require('../../').array;
describe('array.split', () => {
it('should export a function', () => {
expect(split).toBeA('function');
});
describe('called with bad parameters', () => {
it('should throw error(s)', () => {
expect(() => split(null)).toThrow... |
Go | UTF-8 | 579 | 3.359375 | 3 | [] | no_license | package main
import "fmt"
// 超时
func climbStairs2(n int) int {
if n == 1 {
return 1
}
if n == 2 {
return 2
}
return climbStairs2(n-1) + climbStairs2(n-2)
}
// 动态规划
func climbStairs(n int) int {
if n == 1 {
return 1
}
var dp []int
if n > 1 {
dp = make([]int, n)
dp[0] = 1
dp[1] = 2
}
for i := 2;... |
Java | UTF-8 | 5,754 | 1.859375 | 2 | [] | no_license | package com.google.android.gms.internal.maps;
import android.os.IBinder;
import android.os.Parcel;
import android.os.RemoteException;
import com.google.android.gms.dynamic.IObjectWrapper;
import com.google.android.gms.dynamic.IObjectWrapper.Stub;
import com.google.android.gms.maps.model.LatLng;
import com.goog... |
PHP | UTF-8 | 1,197 | 2.703125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | <?php
namespace Application\Filter\Api;
use Laminas\Filter\AbstractFilter;
use Laminas\Stdlib\ArrayUtils;
use function explode;
use function is_string;
use function strpos;
use function substr;
class FieldsFilter extends AbstractFilter
{
protected array $fields = [];
public function setFields(array $fields... |
Python | UTF-8 | 2,401 | 2.765625 | 3 | [
"Apache-2.0"
] | permissive | # -*- coding: utf-8 -*-
"""
Secrets factory.
"""
# Standard imports
import logging
from abc import (
ABC,
abstractmethod,
)
from collections import OrderedDict
from inspect import getdoc
logger = logging.getLogger(__name__)
# pylint: disable=missing-function-docstring
class SecretFactory:
"""
Fac... |
C | UTF-8 | 7,785 | 2.984375 | 3 | [
"Apache-2.0"
] | permissive |
#include <string.h>
#include "cprini.h"
/*
*
***************************************************************************
*
* This is the end of the debugging code, and the beginning
* of the printing functions proper. The code below contains
* five user-callable functions: cprini, cprin, cprin2, ... |
C# | UTF-8 | 1,484 | 3.046875 | 3 | [] | no_license | using Microsoft.AspNetCore.Http;
using Newtonsoft.Json;
using PizzaGuys.Models;
namespace PizzaGuys.Helper
{
public static class SessionHelper
{
public static void SetSession(this ISession session, string key, object o)
{
var str = JsonConvert.SerializeObject(o, Formatting.None,
... |
Java | UTF-8 | 659 | 2.4375 | 2 | [] | no_license | package com.controllerface.cmdr_j.classes.recipes;
import com.controllerface.cmdr_j.classes.data.ItemEffects;
import com.controllerface.cmdr_j.classes.data.CostData;
import com.controllerface.cmdr_j.enums.equipment.modules.stats.ItemGrade;
public abstract class AbstractTechnologyRecipe extends AbstractRecipe
{
pu... |
Java | UTF-8 | 34,113 | 1.828125 | 2 | [] | no_license | package eon.hg.fap.web.manage.action;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.StrUtil;
import eon.hg.fap.common.CommUtil;
import eon.hg.fap.common.util.metatype.Dto;
import eon.hg.fap.common.util.metatype.impl.HashDto;
import eon.hg.fap.core.body.ResultBody;
import eon.hg.fap.core.constant.Ae... |
C++ | UTF-8 | 1,262 | 3.5625 | 4 | [] | no_license | #include <iostream>
#include <vector>
#include <stack>
using namespace std;
class MinStack{
public:
stack<int> StackValue;
stack<int> StackMin;
MinStack(){
}
void push(int n ){
StackValue.push(n);
if( StackMin.empty() || StackMin.top() >= n ){
... |
Python | UTF-8 | 1,586 | 2.5625 | 3 | [] | no_license | from sklearn.model_selection import StratifiedKFold
from sklearn import preprocessing
from sklearn.naive_bayes import GaussianNB
from sklearn.neighbors import KNeighborsClassifier
from sklearn.svm import SVC
import numpy as np
import semi_chi
def getACC(X, y, selected_num,classifier = 'Gauss',k = 10):
skf = Strati... |
Java | UTF-8 | 599 | 2.203125 | 2 | [] | no_license | package com.plantix.data.database;
import androidx.room.Database;
import androidx.room.RoomDatabase;
import androidx.room.TypeConverters;
import com.plantix.data.database.converters.DateTypeConverter;
import com.plantix.data.database.daos.DatumTableDao;
import com.plantix.data.database.dbpojo.Datum;
//Here initial... |
Shell | UTF-8 | 8,667 | 3.03125 | 3 | [] | no_license | #!/bin/bash
help_info ()
{
echo "****************************************************************************"
echo "*"
echo "* MODULE: Linux Script - facenet"
echo "*"
echo "* COMPONENT: This script used to run facenet python process"
echo "*"
echo "* REVISION: $Revision: 1.0 $"
... |
C++ | UTF-8 | 3,250 | 3.203125 | 3 | [] | no_license | /**
* @file arena.cc
*
* @copyright 2017 3081 Staff, All rights reserved.
*/
/*******************************************************************************
* Includes
******************************************************************************/
#include <algorithm>
#include <iostream>
#include "arena.h"
#in... |
Markdown | UTF-8 | 625 | 2.59375 | 3 | [] | no_license | ## 1819-csse1
___
## Hektor Misplon
## NMD-2
### _16/12/18_
___
# Deel 1: Dataformaten
## 1. Wat is een Dataformaat?
Een dataformaat is een formaat die het mogelijk maakt om data uit te wisselen tussen verschillende bestanden of databasestructuren.
Gegevens kunnen dus omgezet worden naar een bepaald dataformaat doo... |
C# | UTF-8 | 3,180 | 2.828125 | 3 | [] | no_license | namespace Dtx.IO
{
/// <summary>
/// Version: 1.0.1
/// Update Date: 1392/05/16
///
/// </summary>
public static class File
{
public static string Read(string pathName)
{
if (pathName == null)
{
return (string.Empty);
}
pathName = pathName.Trim();
if (pathName == string.Empty)
{
... |
Java | UTF-8 | 372 | 1.90625 | 2 | [] | no_license | package be.tomvertommen.drinksMachine.communication;
/**
* The names of all possible requests.
* @author Tom Vertommen
*
*/
public enum RequestName {
SET_MODE,
GET_DRINK,
ADD_INGREDIENT,
REMOVE_INGREDIENT,
ADD_MAX_QTY,
REMOVE_MAX_QTY,
ADD_ALARM_QTY,
REMOVE_ALARM_QTY,
GET_STOCK_QTYS,
GET_STATUS,
SET_PO... |
C++ | UTF-8 | 631 | 3.140625 | 3 | [] | no_license | #ifndef BITSTOSHIFT_H
#define BITSTOSHIFT_H
class BitsToShift {
public:
BitsToShift() {
bits = 0;
}
void setBit(uint8_t reg_bit, bool set) {
if (set)
bits = bits | reg_bit;
else
bits = bits & ~reg_bit;
setRegister();
}
bool getBit(uint8_t reg_bit) {
return (bits & reg_bit) > 0... |
JavaScript | UTF-8 | 6,848 | 2.515625 | 3 | [] | no_license | 'use strict';
import React, { Component } from 'react';
import {
View,
StyleSheet,
Text,
StatusBar,
TextInput,
Image,
Dimensions,
TouchableOpacity,
Alert,
AppRegistry,
} from 'react-native';
import { FlatList } from 'react-native-gesture-handler';
import * as firebase from 'firebase';
const { width,... |
C++ | UTF-8 | 2,303 | 4.03125 | 4 | [] | no_license | // Ivan Stus cssc1719
// CS320Lab3 - point.cpp (Class)
#include <cmath>
#include <iostream>
using namespace std;
class Point {
private: //Initialize inputted point as private
float x1;
float y1;
public: //(0,0) is a public point
float x2;
float y2;
//Constructor
... |
Shell | UTF-8 | 614 | 3.125 | 3 | [
"Apache-2.0",
"MIT",
"EPL-1.0"
] | permissive | #!/bin/sh
# exit when any command fails
set -e
echo "Building and testing artifacts, and creating pom files"
./gradlew -s --scan build publishToMavenLocal codeCoverageReport
echo "Testing Bintray publication by uploading in dry run mode"
./gradlew -s -i --scan bintrayUploadAll -Pbintray.dryRun
echo "Pull request: [... |
C++ | UTF-8 | 274 | 2.71875 | 3 | [] | no_license | #pragma once
template<typename T>
class Singleton
{
public:
static T* GetInstance()
{
// static T instance_;
return instance_;
}
private:
Singleton(){};
static T* instance_;
};
template <typename T>
T* Singleton<T>::instance_ = new T;
|
Python | UTF-8 | 456 | 3.03125 | 3 | [] | no_license | import requests
from requests import status_codes
#Melakukan input data yang akan dimasukkan pada json
load_data = {"title":"recommendation", "body":"motorcycle", "userId":12}
#Melakukan POST data yang ingin diinput pada link json
r = requests.post("https://jsonplaceholder.typicode.com/posts", json = load_data)
#Men... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.