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 |
|---|---|---|---|---|---|---|---|
C# | UTF-8 | 1,447 | 2.578125 | 3 | [
"MIT"
] | permissive | namespace WarriorsSnuggery.Graphics
{
public class BatchSequence : BatchRenderable
{
readonly BatchObject[] objects;
readonly int tick;
readonly bool pauseable;
int curTick;
int curObj;
public BatchSequence(TextureInfo info, bool pauseable = false, bool startRandom = false) : this(info.GetTextures(), in... |
Python | UTF-8 | 2,151 | 2.6875 | 3 | [] | no_license | import numpy as np
import torch
def transition_probability(previous_state, later_state):
if previous_state == 0:
if later_state == 0:
return 0.7
else:
return 0.3
elif previous_state in [1,2,3,4]:
if later_state == previous_state - 1:
return 0.1
elif late... |
Python | UTF-8 | 2,118 | 2.859375 | 3 | [
"MIT"
] | permissive | # Pytest-compatible tests for loop system
import pytest
from bear_hug.event import BearEventDispatcher, BearLoopException, BearEvent
@pytest.fixture
def event_dispatcher():
l = BearEventDispatcher()
yield l
@pytest.fixture
def listener():
class L:
"""
Records the events
"""
... |
Java | UTF-8 | 3,031 | 2.34375 | 2 | [] | no_license | package com.forimm.Email;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseExpandableListAdapter;
import android.widget.TextView;
import com.forimm.R;
import com.forimm.domain.Center.Center;
import java.util.List;
import java.util.Map;
public cl... |
TypeScript | UTF-8 | 945 | 3.34375 | 3 | [] | no_license | export {};
const range = (min: number, max: number): number[] =>
Array(max - min + 1)
.fill(0)
.map((_, idx) => idx + min);
const gcd = (a: number, b: number): number => (b > 0 ? gcd(b, a % b) : a);
const sum = (arr: number[]): number => arr.reduce((acc, cur) => acc + cur);
const count = (arr: number[]): number =>... |
Python | UTF-8 | 713 | 2.96875 | 3 | [] | no_license | import requests
import random
# IFTTT_Webhook
def ifttt_webhook(eventid,value):
payload = {"value1": value,
"value2": "Of",
"value3": "Things" }
url = 'https://maker.ifttt.com/trigger/' + eventid + '/with/key/d1Ep3s3uUhMZugkBfz5vOQ'
response = requests.post(url,payload)
# こ... |
Java | UTF-8 | 325 | 2.140625 | 2 | [] | no_license | package com.cc.dc.customview.recyclerviewadapter;
import android.support.annotation.NonNull;
/**
* Created by dc on 2017/12/27.
*/
public interface AdapterDelegate<T> {
boolean isForViewType(@NonNull T items, int position);
int getItemViewLayoutId();
void convert(ViewHolder holder, T t, int position... |
PHP | UTF-8 | 1,393 | 2.75 | 3 | [] | no_license | <?php
/**
* Объект маппится в контроллере
*/
class StoreCart {
static public function get() {
return new StoreCart();
}
protected $sessionId;
public function __construct($sessionId = null) {
$this->sessionId = $sessionId ? $sessionId : session_id();
Misc::checkEmpty($this->sessionId);
}
... |
Java | UTF-8 | 4,742 | 1.617188 | 2 | [] | no_license | /**
* Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later... |
Rust | UTF-8 | 2,107 | 2.796875 | 3 | [
"MIT"
] | permissive | use diesel::pg::PgConnection;
use diesel::prelude::*;
use diesel::result::Error::NotFound;
use crate::diesel_schema::movies;
use crate::models::movies::Movie;
use crate::schemas::movies::{MovieCreate, MovieUpdate};
pub fn add(db: &PgConnection, movie_in: MovieCreate) -> QueryResult<Movie> {
let mut new_movie = Mo... |
Java | UTF-8 | 5,221 | 2.53125 | 3 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package reworkfx;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.DriverManager;
import java.s... |
Java | UTF-8 | 742 | 2.25 | 2 | [
"Apache-2.0"
] | permissive | package com.xlp.sell.converter;
import com.xlp.sell.dto.OrderDto;
import com.xlp.sell.entity.OrderDetail;
import com.xlp.sell.entity.OrderMaster;
import org.springframework.beans.BeanUtils;
import java.util.List;
import java.util.stream.Collectors;
/**
* @Description TODO
* @Author xianglianpeng@sunseaaiot.com
* ... |
Python | UTF-8 | 1,874 | 2.75 | 3 | [] | no_license | import pymongo
from typing import List
from src.database.daos.generic_dao import GenericDAO
from src.database.mongo import Mongo
from src.model.consultations.consultation import QueueableData
class QueueDAO(GenericDAO):
@classmethod
async def store(cls, queueable_data: QueueableData):
""" Store the ... |
Markdown | UTF-8 | 7,237 | 3.140625 | 3 | [] | no_license | 七四六
那时,他极为单纯,还弄不清楚这是怎么回事,如今想起来,才知道罗师爷有把柄落在自己的手里。
他微微一笑道:“朱少侠,祢的意思要怎样嘛?是想要把罗师爷抓起来,囚入大狱之中?还是另有打算,别有图谋?”
朱宣宣红着脸道:“我有什么图谋?”
金玄白笑道:“这样吧,祢跟冰儿产赌钱,也输了不少银子,我点祢一条明路,祢在天亮之后,到衙门去找薛义或罗三泰,要他们带祢去见罗师爷……”
朱宣宣秀眉一蹙,道:“我见他做什么?难道跟他借银子?”
金玄白笑道:“祢不需要开口跟他提银子的事,只要对他说:‘在天愿为比翼鸟,在地愿为连理枝’就行了!”
他的这句话还没说完,朱宣宣已胀红了脸,“啐... |
Java | UTF-8 | 313 | 1.882813 | 2 | [] | no_license | public Long zrevrank(final String key,final byte[] member){
final byte[] keyByte=SafeEncoder.encode(key);
return new JedisClusterCommand<Long>(connectionHandler,maxRedirections){
public Long execute( Jedis connection){
return connection.zrevrank(keyByte,member);
}
}
.runBinary(keyByte);
}
|
Java | UTF-8 | 4,946 | 2.265625 | 2 | [
"Apache-2.0"
] | permissive | package com.example.whatsmymood;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.ListViewCompat;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import an... |
C# | UTF-8 | 2,576 | 3.453125 | 3 | [] | no_license | using System;
using System.Runtime.InteropServices;
namespace Students_Marks
{
class Program
{
static string marks;
static int disciplinesQuantity;
static int studentsQuantity;
static string name;
static string discipline;
static void Main(string[]... |
Swift | UTF-8 | 1,632 | 3.6875 | 4 | [] | no_license | protocol Bird {
var name: String { get }
var canFly: Bool { get }
}
protocol Flyable {
var airspeedVelocity: Double { get }
}
struct FlappyBird: Bird, Flyable {
let name: String
let flappyAmplitude: Double
let flappyFrequency: Double
var airspeedVelocity: Double {
return 3 * flappyAmplitude * flapp... |
Java | UTF-8 | 6,402 | 3.28125 | 3 | [] | no_license | public class BubbleGrid {
private int[][] grid;
private int bNum;
/* Create new BubbleGrid with bubble/space locations specified by grid.
* Grid is composed of only 1's and 0's, where 1's denote a bubble, and
* 0's denote a space. */
public BubbleGrid(int[][] grid) {
this.grid = grid;... |
Java | UTF-8 | 455 | 2.34375 | 2 | [
"Apache-2.0"
] | permissive | package com.github.ompc.greys.core.util;
/**
* 调用耗时
* Created by vlinux on 16/6/1.
*/
public class InvokeCost {
private final ThreadLocal<Long> timestampRef = new ThreadLocal<Long>();
public long begin() {
final long timestamp = System.currentTimeMillis();
timestampRef.set(timestamp);
... |
JavaScript | UTF-8 | 6,841 | 4.125 | 4 | [] | no_license | console.log('Lection 6 - Object');
/**
* - Объект
* - Ключами объекта являются строки
* - Доступ к свойствам объекта
* - Добавить/изменить ствойство
* - Удалить свойство
* - Проверка существования свойства. in
* - Цикл for in
* - hasOwnProperty(), Object.getOwnPropertyNames()
* - Копирование по ссылке
* - Сра... |
Java | UTF-8 | 832 | 2.1875 | 2 | [] | no_license | package com.project.rine;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import androidx.annotation.Nullable;
public class MsgDatabaseHelper extends SQLiteOpenHelper {
public static final String CREATE_MSG = "create table msg(" +
... |
Shell | UTF-8 | 512 | 2.5625 | 3 | [] | no_license | #!/usr/bin/env bash
### Start the Database
cd /home/vagrant/educloud-bazaar
python manage.py syncdb --noinput
python manage.py migrate
### Populate DB (not being used at the moment)
# From Oscar
# python manage.py oscar_populate_countries # Oscar 1.0
# From Bazaar
# python manage.py oscar_import_catalogue fixtures/... |
TypeScript | UTF-8 | 816 | 2.875 | 3 | [] | no_license | import {
TodosActions,
TodosActionType,
TodosState,
} from '../../types/todo'
const initialState: TodosState = {
todos: [],
loading: false,
error: null,
page: 1,
limit: 10,
}
export const todoReducer = (
state: TodosState = initialState,
action: TodosActions
): TodosState => {
switch (action.typ... |
JavaScript | UTF-8 | 2,596 | 2.734375 | 3 | [] | no_license | let count = 0;
let deadList = [];
let nearDeadList = [];
/**
* 一个通用的读取文件的函数
* 作用:在第一次运行的时候将文件写入本地,在之后的运行中,可以修改本地成语文件
* @param appPath 在APP内部的默认文件
* @param sdcardPath 写入手机本地文件夹的文件
* @returns {list} 返回一个读取文件后的list
*/
function createAndReadFile(appPath, sdcardPath) {
files.ensureDir(sdcardPath);
... |
Java | UTF-8 | 891 | 2.296875 | 2 | [] | no_license | package com.example.loginwebservice;
public class ListItem
{
private String cid;
private String desc;
private String status;
private String ctype;
public ListItem(String cid, String desc, String status, String ctype) {
this.cid = cid;
this.desc = desc;
this.status = statu... |
Java | UTF-8 | 474 | 2.453125 | 2 | [
"MIT"
] | permissive | package com.hgys.iptv.model.enums;
public enum RoleEnum{
ROLE_ADMIN("管理员"),
ROLE_OPERATOR("操作员"),
ROLE_CP("内容提供商"),
ROLE_CP_GROUP("内容提供商分组"),
ROLE_USER("普通用户");
private final String description;
RoleEnum(String displayName){
description = displayName;
}
public String getCo... |
Python | UTF-8 | 1,654 | 2.5625 | 3 | [] | no_license | from itertools import count, chain
from operator import neg
from Bio.Seq import Seq
from common import small_example, read_dataset, big_example, write_result
def syntenies(v, w, k):
cw = w.complement()
count = 0
for i in range(0, len(v) - k + 1):
block = v[i:i + k]
j = w.find(block)
... |
Shell | UTF-8 | 2,030 | 3.484375 | 3 | [
"Unlicense"
] | permissive | #!/usr/bin/bash
# CC0, Wei-Lun Chao <bluebat@member.fsf.org>, 2018
# let player2 choose color
if [ $ARENA_MOVENO -eq 0 ] ; then
echo "Choose Red/Black for $ARENA_PLAYER2"
exit 1
fi
# store the game board
if [ "${ARENA_STATUS:0:7}" != INVALID -a "${ARENA_STATUS:0:7}" != ILLEGAL ] ; then
echo $ARENA_BOARD >> $ARE... |
Java | UTF-8 | 1,066 | 1.90625 | 2 | [] | no_license | package com.summer.app.ui.bed.shiftdute.bean.uibean;
import android.content.Context;
import android.view.View;
import android.widget.TextView;
import com.summer.app.R;
import com.summer.lib.bean.uibean.BaseUIBean;
import butterknife.BindView;
/**
* Created by ${viwmox} on 2016-12-06.
*/
public class ShiftDuteUIBe... |
Java | UTF-8 | 1,700 | 3.515625 | 4 | [] | no_license | package packer;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author I.M.Bad
*/
/**
* The Customer class contains customer name and addresses
*/
public class Customer {
private String name;
private List<Address> addresses;
/**
*
* used to create the customer and add addresses to them
... |
C++ | UTF-8 | 1,400 | 2.515625 | 3 | [] | no_license | /**
* String
*/
class String
{
public:
/* object properties */
/* object behaviors */
int _beh_9_() const;&s
float _beh_9_() const;&s
double _beh_9_() const;&s
URL _beh_9_();&s
/* object methods */
String& opAssign(const String&in);
String& opAssign(int);
String& opAssign(double);
String& opAssign(float)... |
PHP | UTF-8 | 2,714 | 2.546875 | 3 | [
"Apache-2.0"
] | permissive | <?php
namespace MPSToolbox\Legacy\Modules\ProposalGenerator\Forms;
use Twitter_Bootstrap_Form_Horizontal;
use Zend_Form_Element_File;
/**
* Class ImportClientCostCsvForm
*
* @package MPSToolbox\Legacy\Modules\ProposalGenerator\Forms
*/
class ImportClientCostCsvForm extends Twitter_Bootstrap_Form_Horizontal
{
... |
Python | UTF-8 | 1,067 | 2.75 | 3 | [] | no_license | import PyLidar3
import time # Time module
import RPi.GPIO as GPIO
import time
#import pigpio
servoPIN = 17
GPIO.setmode(GPIO.BCM)
GPIO.setup(servoPIN, GPIO.OUT)
servo = GPIO.PWM(servoPIN, 33) # GPIO 17 for PWM with 33Hz (pulse period of 30ms)
servo.start(2) # Initialization
#ESC = 4
#pi = pigpio.pi()
... |
C# | UTF-8 | 2,676 | 2.78125 | 3 | [] | no_license | using System.IO;
using AspNetSandBox.Controllers;
using AspNetSandBox.Models;
using Xunit;
namespace AspNetSandBox.Tests
{
/// <summary>Tests for getting city coordinates from city name.</summary>
public class CityCoordinatesControllerTest
{
/// <summary>Test for getting coordinates of London.</sum... |
C | UTF-8 | 2,593 | 2.84375 | 3 | [] | no_license | #include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/types.h>
#include <string.h>
#include "redirect.h"
#include "debug.h"
#include "shell_name.h"
void redirect_stdout(int *redirect, int *dup_stdout) {
*redirect = *redirect | STDOUT_CHANGED;
*dup_stdout = dup(STDOUT_FILENO);
... |
Python | UTF-8 | 3,421 | 3.21875 | 3 | [] | no_license | import abc
import graphics
from util import toArray
class Drawable(abc.ABC):
@abc.abstractmethod
def draw(self, g):
# type: (graphics.Graphics) -> None
pass
class Text(Drawable):
def __init__(self, x, y, text, centered=0, underline=False):
self.y = y
self.x = x
se... |
Java | UTF-8 | 467 | 3.125 | 3 | [] | no_license | package tdd.generics;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Yohan on 3/18/14.
*/
public class Syntaxer<E> {
private List<E> elems;
public Syntaxer() {
this.elems = new ArrayList<E>();
}
public E getHead() {
return elems.size() > 0 ? elems.get(0) : null... |
JavaScript | UTF-8 | 690 | 2.84375 | 3 | [
"MIT"
] | permissive | export function patch() {
String.prototype.format = function(params) {
let formatted = this
for (const [key, value] of Object.entries(params)) {
formatted = formatted.replace(`{${key}}`, value)
}
return formatted
}
}
export function translateCoords(x, z, hellTransl... |
SQL | UTF-8 | 516 | 2.703125 | 3 | [] | no_license | --------------------------------------------------------
-- Ref Constraints for Table FL101_OBJECTIVE_LAS
--------------------------------------------------------
ALTER TABLE "FLOODMASTER"."FL101_OBJECTIVE_LAS" ADD CONSTRAINT "FL101_FL94_FK" FOREIGN KEY ("OBJECTIVE_ID")
REFERENCES "FLOODMASTER"."FL94_OBJECTIVES"... |
Java | UTF-8 | 2,312 | 2.390625 | 2 | [
"Apache-2.0"
] | permissive | package com.shuzijun.leetcode.plugin.window.dialog;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.ui.components.JBPanel;
import com.intellij.ui.components.JBScrollPane;
import com.shuzijun.leetcode.plugin.model.Question;
import org.jetbrains.annotations.... |
PHP | UTF-8 | 5,519 | 2.84375 | 3 | [] | no_license | <?php
# --------------------------------------------------------------------------- #
# DndClient/models/db.php
# --------------------------------------------------------------------------- #
#
# Объект для работы с БД
#
# --------------------------------------------------------------------------- #
# winzo.delirium
... |
JavaScript | UTF-8 | 1,911 | 3.078125 | 3 | [] | no_license | class Tile{
constructor(i,j,scene) {
this.x=i;
this.z=j;
this.walkable = true;
this.items=[];
this.tempItems=[];
this.scene=scene;
this.mesh = BABYLON.Mesh.CreateBox("tile", 0.1, scene);
this.mesh.isVisible=false;
}
addItem(item){
if(it... |
Java | UTF-8 | 244 | 1.710938 | 2 | [] | no_license | package com.razorpay;
import proguard.annotation.Keep;
import proguard.annotation.KeepClassMembers;
@Keep
@KeepClassMembers
interface RzpInternalCallback {
void onPaymentError(int i, String str);
void onPaymentSuccess(String str);
}
|
Python | UTF-8 | 658 | 3.15625 | 3 | [] | no_license | import os
def rename_files():
#1 get file names from a folder
file_list = os.listdir("/home/wang/Desktop/udacity/prank")
current_path = os.getcwd()
os.chdir("/home/wang/Desktop/udacity/prank")
print ('Current working directory : ' + current_path)
for file_name in file_list:
print('Old ... |
Markdown | UTF-8 | 23,220 | 2.609375 | 3 | [
"Apache-2.0"
] | permissive | ---
title: KAPSARC Data Versioning API
language_tabs:
- ruby: Ruby
- python: Python
toc_footers: []
includes: []
search: false
highlight_theme: darkula
headingLevel: 2
---
<h1 id="kapsarc-data-versioning-api">KAPSARC Data Versioning API v0.1.1</h1>
> Scroll down for code samples, example requests and responses. ... |
JavaScript | UTF-8 | 1,312 | 2.703125 | 3 | [] | no_license |
function handleHamburgerClick(){
$(".toggle").on("click", function(){
if ($(".item").hasClass("active")){
$(".item").removeClass("active");
//setting to $(this) is saying go to .item at "a" and add the "hamburger" icon.
$(this).find("a").html("<i class='fas fa-bars'></... |
Java | UTF-8 | 4,401 | 2.484375 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright by the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable ... |
TypeScript | UTF-8 | 2,133 | 2.65625 | 3 | [] | no_license | import fs from 'fs-extra';
import path from 'path';
import LRUCache from 'lru-cache';
import { ICertificateStorage, ICertificateModel, ICertificateStorageOptions } from './interfaces';
export class CertificateStorage implements ICertificateStorage {
private cache: LRUCache.Cache<string, ICertificateModel>;
private... |
JavaScript | UTF-8 | 4,426 | 3.578125 | 4 | [] | no_license | //will load the expense data from localStorage
if (localStorage.getItem("expense") == null)
localStorage.setItem("expense", "[]")
//retrieving values from localStorage
var expense = JSON.parse(localStorage.getItem("expense"));
// below function will display the transaction history
displayList()
// function will ... |
Markdown | UTF-8 | 1,490 | 3.015625 | 3 | [
"MIT"
] | permissive | # bamazon
Amazon-esque CLI app to practice SQL knowledge
## Overview
This app is designed to demonstrate basic SQL functionality and how it interacts w/ Javascript to make updates to a database.
## Functionality Used
General | Node Dependencies
------- | -------------
SQL | inquirer
Javascript | colors
Node.js | cl... |
Python | UTF-8 | 2,085 | 3.90625 | 4 | [] | no_license | """
File: taxformwithgui.py
Project 8.1
A GUI-based tax calculator.
Computes and prints the total tax, given the income and
number of dependents (inputs), and a standard deduction of
$10,000, an exemption amount of $3,000, and a flat tax rate
of 20%.
"""
from breezypythongui import EasyFrame
class TaxCalculator(Easy... |
Java | UTF-8 | 4,287 | 1.984375 | 2 | [] | no_license | /**
*
*/
package com.application.ui.activity;
import android.os.Build;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import... |
Java | UTF-8 | 794 | 1.796875 | 2 | [] | no_license | package example;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplicatio... |
Markdown | UTF-8 | 6,436 | 3.25 | 3 | [] | no_license | ---
layout: post
title: "Sales Kit"
date: 2019-03-26
description: |
How do you sell Zerocracy platform to a potential
client? What are the pain points to address?
How to convince that we are the best?
author:
name: Yegor Bugayenko
twitter: yegor256
---
I was talking to a few people recently, who wanted to jo... |
Java | UTF-8 | 3,770 | 2.5 | 2 | [] | no_license | package mito.sms.userinterface.parsing;
import mitto.sms.hibernate.entity.CountryFee;
import mitto.sms.userinterface.parsing.CountryFeeParserImpl;
import mitto.sms.userinterface.parsing.Parser;
import mitto.sms.userinterface.parsing.exception.ParsingException;
import org.junit.jupiter.api.Test;
import java.util.Optio... |
C | UTF-8 | 6,829 | 3.34375 | 3 | [
"MIT"
] | permissive | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_sorted_list_insert.c :+: :+: :+: ... |
TypeScript | UTF-8 | 1,193 | 2.984375 | 3 | [] | no_license | const getUserChoice = (): number => {
return Math.floor(Math.random() * 12) + 1;
};
const generateRandomStr = (): string => {
let str = "";
const ramdomCharCode = (): number => {
return Math.floor(Math.random() * 26) + 97;
};
for (let i = 0; i < 6; i++) {
const code = ramdomCharCode();
const lett... |
Java | UTF-8 | 3,477 | 2.28125 | 2 | [
"Apache-2.0"
] | permissive | /* Licensed Materials - Property of IBM */
/* */
/* SAMPLE */
/* */
/* (c) Copyr... |
Python | UTF-8 | 848 | 2.921875 | 3 | [] | no_license | import cv2
import numpy as np
from matplotlib import pyplot as plt
img = cv2.imread("lena.jpg")
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) #Conversion is necessary as malplotlib reads images in RGB format whereas opencv reads it in BGR format
kernel = np.ones((5, 5), np.float32)/25 #kernel = 1/(kwidth*kheight) which ... |
Markdown | UTF-8 | 1,189 | 2.8125 | 3 | [] | no_license | ## 获取在会员期内的level接口
+ 功能说明:获取在会员期内的level
### 历史记录
#### 2019-10-14
- 新增
**公共参数:**
+ 测试接口的地址为 https://test-msyb-api.qingclasswelearn.com/user/get-effective-level-list
+ 线上接口的地址为 https://msyb-api.qingclasswelearn.com/user/get-effective-level-list
+ 公共参数 说明: 公共参数需要传递到get或post里面,get请求参数都传到参数中,post请求参数都传到form中。
### 接口信息
|... |
Java | UTF-8 | 1,220 | 2.9375 | 3 | [] | no_license | package projeto;
public class View {
private User viewer;
private Video movie;
public View(User viewer, Video movie) {
this.viewer = viewer;
this.movie = movie;
this.viewer.setTotWatched(this.viewer.getTotWatched() + 1);
this.movie.setViews(this.movie.getViews() + 1);
}... |
C++ | UTF-8 | 577 | 3.703125 | 4 | [] | no_license | #include<iostream>
class SmallInt{
friend
SmallInt operator+(const SmallInt&,const SmallInt&){SmallInt smlt;return smlt;}
public:
SmallInt(int i=0){val=i;}//conversion from int
operator int()const{return val;}//conversion to int
size_t print(){return val;}
private: std::size_t val;
};
int ... |
Python | UTF-8 | 8,699 | 2.578125 | 3 | [] | no_license | from datetime import datetime
import cv2
import matplotlib.pyplot as plt
import numpy as np
import PIL.Image as Image
import PIL.ImageDraw as ImageDraw
from motion_planner import MotionPlanner
from util import *
for seed_val in [10, 11, 12, 17]:
for direction_val in [3, 5]:
img_dir = f'image/seed_{seed_... |
Java | UTF-8 | 6,885 | 2.1875 | 2 | [] | no_license | package vista;
import controlador.PremioJpaController;
import java.util.List;
import javax.swing.JOptionPane;
import modelo.Premio;
/**
*
* @author zulur
*/
public class MenuPrincipal extends javax.swing.JFrame implements ICambiaVentana {
private final PremioJpaController controlador = new PremioJpaController... |
Python | UTF-8 | 1,350 | 2.9375 | 3 | [] | no_license | from overrides import overrides
import numpy as np
from allennlp.common.util import JsonDict
from allennlp.data import DatasetReader, Instance
from allennlp.models import Model
from allennlp.predictors.predictor import Predictor
@Predictor.register("name-predictor")
class NamePredictor(Predictor):
"""
Predict... |
Python | UTF-8 | 242 | 3.953125 | 4 | [] | no_license | #Entrada dos números
entA,entB =input("Insira dois numeros aqui :)" ).split()
boolean = False
#Condicional
if int(entA) % int(entB) == 0:
boolean = True
#Saída
if boolean:
print('é divisivel')
else:
print('Não é divisivel') |
C++ | UTF-8 | 1,002 | 2.765625 | 3 | [] | no_license | //
// Created by Diego Santos Seabra on 16/08/21.
//
#include "input.h"
#include "../logging/log.h"
void Input::init() {
// Init game controller (a.k.a joystick)
mController = SDL_GameControllerOpen(0);
if (mController == NULL) {
Log::warn("Unable to find a game controller (joystick) device");
... |
C# | UTF-8 | 862 | 2.5625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApp1
{
public partial class Form1 : Form
{
public Form1()
... |
JavaScript | UTF-8 | 3,472 | 2.890625 | 3 | [] | no_license | const json = {
token: ''
}
let connection = new Connection('test')
const urlAuth = connection.getAuthServiceConnection()
const urlCore = connection.getStorageServiceConnection()
/**
* Factory for api
* @param url
* @param method (GET or POST)
* @param endpoint
* @param message (message for errors)
* @param ... |
C | UTF-8 | 5,442 | 3.15625 | 3 | [
"Unlicense"
] | permissive | #include <stdio.h> //declaring standard library
struct AccType //declaring structure for later use
{
int AccBal;
}DBBL,Rocket,bKash,Payoneer;
void DBBLf(); //declaring function for later use
void Rocketf();
void bKashf();
void Payoneerf();
int main()
{
... |
Markdown | UTF-8 | 1,280 | 3.53125 | 4 | [] | no_license |
# React-Play.Class-and-State
**Author:** klequis
This React example project shows you how to use 'Class' components with 'state'.
## Component Hierarchy
- index.js
- Home.jsx
- Welcome
- Message
- CurrentDate
* Note: Home is not necessary but we in the example but it is there i p... |
C++ | UTF-8 | 1,211 | 2.671875 | 3 | [] | no_license | #include <stdio.h>
#include <malloc.h>
#include "bits/stdc++.h"
using namespace std;
#define SIZE 100
int inSet(double creal,double cimage)
{
int iterations = 0;
double zreal=0,zimage=0;
double freal=0,fimage=0;
while ((freal*freal+fimage*fimage<4) && (iterations < 1000))
{
freal=zre... |
Python | UTF-8 | 630 | 4.40625 | 4 | [] | no_license | # Display a linked list from the end.
class Node:
def __init__(self, value):
self.data = value
self.next = None
class Linkedlist:
def __init__(self):
self.head = None
def push(self, new_data):
new_node = Node(new_data)
new_node.next = self.head
self.head = ... |
C | UTF-8 | 1,978 | 3.171875 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_split.c :+: :+: :+: ... |
JavaScript | UTF-8 | 514 | 2.5625 | 3 | [] | no_license | //line
var ctxL = document.getElementById("lineChart").getContext('2d');
var myLineChart = new Chart(ctxL, {
type: 'line',
data: {
labels: ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"],
datasets: [{
label: "Jogos do ano 2019",
data: [100, 1... |
JavaScript | UTF-8 | 503 | 2.890625 | 3 | [] | no_license | import React, {useState} from "react";
import './App.css';
const App = () => {
const [hex, setHex] = useState("#ffffff");
const randomizedHex = () => {
const randomColor = "#" + Math.floor(Math.random() * 16777215).toString(16);
setHex(randomColor);
};
return <div className="App">
<h1>{hex}</... |
Markdown | UTF-8 | 1,488 | 2.703125 | 3 | [] | no_license | Within the 3bot Admin console, a chatflow has been created to reserve S3 storage capacity.
This storage can be dispersed over different nodes.

Through this chatflow, S3 storage is reserved and configured simply by collection of a number of parameters :
- IPv4 vs... |
Java | UTF-8 | 692 | 1.992188 | 2 | [] | no_license | package com.example.demo.UseCases;
import com.example.demo.Domini.Comentari;
import com.example.demo.Domini.Reserva;
import com.example.demo.Persistence.ComentariDAO;
import com.example.demo.Persistence.ReservaDAO;
import org.springframework.stereotype.Service;
import java.util.List;
@Service("comentariUseCases")
pu... |
Python | UTF-8 | 2,383 | 3.4375 | 3 | [] | no_license | import unittest
from datastructure.hash.Hash import *
class TestHashQ1(unittest.TestCase):
def test_creation(self):
n = 10
h = Hash(n)
self.assertIsNotNone(h)
self.assertEqual(0, len(h))
n = 15
h = Hash(n)
self.assertIsNotNone(h)
self.assertEqual(0,... |
Java | UTF-8 | 400 | 1.632813 | 2 | [] | no_license | package com.qi.demo.DTO;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import javax.persistence.Entity;
import javax.persistence.Id;
@Data
public class ImageFileDTO {
private String pictureId;
private String documentsId;
... |
Java | UTF-8 | 1,248 | 2.5 | 2 | [
"Apache-2.0"
] | permissive | package functional.com.trailblazers.freewheelers.helpers;
import java.math.BigDecimal;
import static java.math.BigDecimal.valueOf;
public class SyntaxSugar {
public static final String SOME_PHONE_NUMBER = "555-123456";
public static final String SOME_PASSWORD = "secret";
public static final String SOME_... |
PHP | UTF-8 | 258 | 2.75 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace Sirius\Sql;
class Raw
{
protected $value;
public function __construct($value)
{
$this->value = (string)$value;
}
public function __toString()
{
return $this->value;
}
}
|
JavaScript | UTF-8 | 2,486 | 2.796875 | 3 | [] | no_license | var AnimationRadix = new RadixTree(null, undefined);
AnimationRadix.set("delta", function (token, stream, keyframe) {
stream.i += 5;
keyframe.isDelta = true;
});
Globals.private.parse2 = function(stream){
var temp = stream.data.substring(stream.i);
var nums = temp.match(/\s+(-?[\d\.]+)\s+(-?[\d\.]+)\s?/);
... |
Python | UTF-8 | 1,696 | 2.515625 | 3 | [] | no_license | # coding=utf-8
from typing import Tuple
from _framework.data_types import RATIONAL_INPUT, RATIONAL_OUTPUT, PREDICTOR_STATE
from _framework.systems.predictors.abstract import Predictor
class RationalPredictor(Predictor[RATIONAL_INPUT, RATIONAL_OUTPUT]):
def __init__(self, no_states: int, input_dimensions: int, ou... |
Java | UTF-8 | 2,405 | 2.296875 | 2 | [] | no_license | /*
* Emulator game server Aion 2.7 from the command of developers 'Aion-Knight Dev. Team' is
* free software; you can redistribute it and/or modify it under the terms of
* GNU affero general Public License (GNU GPL)as published by the free software
* security (FSF), or to License version 3 or (at your option) a... |
Ruby | UTF-8 | 1,065 | 2.84375 | 3 | [
"MIT"
] | permissive | require 'verbose_hash_fetch'
RSpec.describe "VerboseHashFetch" do
let(:hash) { { :foo => "bar" } }
context "with one argument" do
it "fetches an existing key" do
expect(hash.fetch(:foo)).to eq "bar"
end
it "raises a KeyError for non existing keys" do
expect { hash.fetch(:bar) }.to raise... |
TypeScript | UTF-8 | 1,096 | 3.359375 | 3 | [
"MIT"
] | permissive | /**
* File: address.ts
* Defines the Address data structure to be returned ty the random address API
* Version 1.0
*/
export interface Address {
/**
* House number, i.e. 123
*/
house: string;
/**
* Street name (may also contain street number)
* Example: "Broadway", "123 Outamy Way"... |
PHP | UTF-8 | 4,855 | 2.578125 | 3 | [] | no_license | <?php
/*追加実装の参考 http://rinknowledge.rindomain.com/index.php?title=%E6%B7%BB%E4%BB%98%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E4%BB%98%E3%81%8D%E3%83%A1%E3%83%BC%E3%83%AB%E3%81%AE%E9%80%81%E4%BF%A1 */
// &&【どちらの変数もセットされている時に中身を実行】→||【nameとbodyのどちらかが未記入の場合の処理を先に書いてる】
if (isset($_POST["name"]) && isset($_POST["body"]) &&... |
Java | UTF-8 | 649 | 3.1875 | 3 | [] | no_license | package com.scaler.threads;
import java.util.ArrayList;
public class MultiThreading {
public static void main(String[] args) {
Runnable r = new Runnable() {
@Override
public void run() {
for (int i = 0; i < 10000; i++) {
System.out.println("i = "... |
Markdown | UTF-8 | 736 | 2.859375 | 3 | [] | no_license | Guard AI:
Routines:
Patrol - walk to next target patrol point
- Can transition to any other state
- Idle - if told to by patrol point, for specified time
Idle - stand still and look cool. Either as a stationary guard, or stopping for a short time at a patrol point.
Hunt - search for the player, using more comp... |
Python | UTF-8 | 5,648 | 2.5625 | 3 | [
"MIT"
] | permissive | from typing import Any, Dict
from django import template
from django.conf import settings
from django.template import Context
from django.template.base import Variable, token_kwargs
register = template.Library()
##
# Component tags
def create_component_tag(template_path):
def do_component(parser, token):
... |
JavaScript | UTF-8 | 601 | 2.515625 | 3 | [] | no_license | let formSubmitHandler = async (e) => {
e.preventDefault();
try {
let userForm = new FormData(e.target);
if (e.target.password.value != e.target.cpassword.value) throw "Password don't match!";
userForm.delete('cpassword');
let userData = Object.fromEntries(userForm);
let r... |
Java | UTF-8 | 5,310 | 2.3125 | 2 | [] | no_license | package com.sg.hrco.test.web.rest;
import com.sg.hrco.test.domain.WaAssignment;
import com.sg.hrco.test.repository.WaAssignmentRepository;
import com.sg.hrco.test.web.rest.errors.BadRequestAlertException;
import io.github.jhipster.web.util.HeaderUtil;
import io.github.jhipster.web.util.ResponseUtil;
import org.slf4j.... |
Python | UTF-8 | 1,505 | 3.15625 | 3 | [] | no_license | '''
Created on Apr 24, 2013
@author: Luke
'''
class Table():
def __init__(self, tableName, primaryKey, columns):
self.primaryKey = primaryKey
self.tableName = tableName
self.dependencies = []
self.columns = columns
self.dependentCount = 0
self.isNested = False
... |
Markdown | UTF-8 | 1,168 | 4.03125 | 4 | [] | no_license | # Encrypt-Decrypt
The text file will consist of messages; each line will start with either E (encrypt) or D (decrypt), and a single digit for the number of columns that will be used (or was used) to encrypt the message.
Each message will end with “*.”
The encryption works as follows:
The message is written to a table ... |
TypeScript | UTF-8 | 1,643 | 3.265625 | 3 | [] | no_license | const decoder = new TextDecoder("utf-8");
function getCommandType(command: string) {
switch (command) {
case "add":
case "sub":
return "C_ARITHMETIC";
case "push":
return "C_PUSH";
case "pop":
return "C_POP";
default:
throw new Error("invalid command type");
}
}
export ... |
Markdown | UTF-8 | 5,029 | 2.8125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | # State-Stepper
Progress steps visualizer.
> NOTE This version (2.x) of state-stepper is not compatible with the previous version (1.x).
> Version 1.x is for Ionic 3 and 2.x is a standard Web-Component to use everywhere. (Also Ionic 3 and 4).

Visualize your progress steps. This is a [Web-Componen... |
C++ | UTF-8 | 687 | 3.0625 | 3 | [] | no_license | #include<stdio.h>
#include<conio.h>
#include<string.h>
int reverse(char *s[],int len);
int main()
{
char *s[]={
"to err is human...",
"but to really mess things up...",
"one nees to know c!!"
};
int i,len;
for(i=0;i<3;i++)
{
len=strlen(s[i]); ... |
Python | UTF-8 | 903 | 3.59375 | 4 | [] | no_license | """
ECE606, F'19, Assignment 1, Problem 3(b)
Skeleton solution file.
"""
import random
"""
You are not allowed to import anything else
"""
def avgfalsepos(n,k,m):
"""
You need to implement this method.
You are certainly allowed to define any subroutines you want
above this method in this file. You are... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.