language stringclasses 15
values | src_encoding stringclasses 34
values | length_bytes int64 6 7.85M | score float64 1.5 5.69 | int_score int64 2 5 | detected_licenses listlengths 0 160 | license_type stringclasses 2
values | text stringlengths 9 7.85M |
|---|---|---|---|---|---|---|---|
Java | UTF-8 | 3,054 | 2.25 | 2 | [] | no_license | package hdu.homework.chat.entity.bean.database;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.ToString;
import javax.persistence.*;
/**
* created by 钱曹宇@supercode on 3/8/2020
*/
@ToString
@ApiModel
@Entity... |
Java | UTF-8 | 794 | 2.328125 | 2 | [
"WTFPL"
] | permissive | package ptrman.mltoolset.PIPE;
import ptrman.mltoolset.PIPE.program.Instruction;
import ptrman.mltoolset.PIPE.program.Program;
public interface ProblemspecificDescriptor {
int getNumberOfArgumentsOfInstruction(Instruction selectedInstruction);
ptrman.mltoolset.PIPE.program.Instruction createTerminalNode(... |
C# | UTF-8 | 2,435 | 2.6875 | 3 | [
"MIT"
] | permissive | using System;
using System.Linq;
using NGitLab.Mock.Clients;
namespace NGitLab.Mock
{
public class ReleaseCollection : Collection<ReleaseInfo>
{
private Project Project => (Project)Parent;
public ReleaseCollection(GitLabObject parent)
: base(parent)
{
}
pu... |
Java | UTF-8 | 4,536 | 2.515625 | 3 | [] | no_license | package web;
import java.net.URL;
import java.sql.Timestamp;
import java.text.ParseException;
import java.time.Instant;
import CurrencyHandler.CurrencyHAndler;
import DateHandler.DateHandler;
import downloader.CbrfDownloader;
import org.apache.http.client.utils.URIBuilder;
import org.springframework.jdbc.core.namedpa... |
Shell | UTF-8 | 44,907 | 3.5625 | 4 | [] | no_license | #
# Script @__AnyLabel__ from content/tutorials/setup.md
#
#----------------------------------------------------------------------# Start 1 of 1
echo "# @envVars (block #1 in __AnyLabel__) of content/tutorials/setup.md"
# If JIRI_ROOT or V23_RELEASE are not defined, set them to the default values
# from the installa... |
Python | UTF-8 | 610 | 3.5 | 4 | [] | no_license | class Solution:
def detectCapitalUse(self, word: str) -> bool:
variations = []
variations.append(word.upper())
variations.append(word.lower())
variations.append(word.capitalize())
if word in variations:
return True
else:
return False
... |
PHP | UTF-8 | 597 | 2.71875 | 3 | [] | no_license | <?php
namespace App\DataStructures;
class JsonBuilder
{
public static function data($data)
{
return [
'data' => $data
];
}
public static function success($message, $code)
{
return [
'message' => $message,
'code' => $code
];
}... |
Python | UTF-8 | 1,490 | 2.84375 | 3 | [] | no_license | # Old code from the good old multithreaded days
'''
def playerthread(conn, player_number):
global current_player
global prev_pass
conn.send('Connected. You are player number ' + str(player_number) + '\n');
data = conn.recv(1024)
while data:
# print data
cmdlist = data.split()
cmd = cmd... |
JavaScript | UTF-8 | 1,365 | 2.578125 | 3 | [] | no_license | // import the packages from node_modules
const express = require("express");
const mongoose = require("mongoose");
const morgan = require("morgan");
const bodyParser = require("body-parser");
const cors = require("cors");
const fs = require("fs"); // give access to the file system
require("dotenv").config();
// import... |
Python | UTF-8 | 121 | 2.53125 | 3 | [] | no_license | def primeiras_ocorrencias(x):
dic = {}
for i in range(len(x)):
dic[x][i] = i
return dic
|
Python | UTF-8 | 168 | 2.953125 | 3 | [] | no_license | x = int(input())
if x <= 3:
print(1)
exit()
res = 0
for i in range(2, 33):
for j in range(2, 12):
a = i ** j
if a <= x:
res = max(res, a)
print(res) |
Shell | UTF-8 | 426 | 2.96875 | 3 | [] | no_license | # Maintainer: Hatem Masmoudi <hatem.masmoudi@gmail.com>
pkgname=core-version
pkgver=2018.06.16
pkgrel=2
pkgdesc="Contains SyphaxOS Core version."
arch=('x86_64')
license=('GPL')
groups=('core')
depends=('rootfs')
prepare() {
mkdir -pv "$srcdir/$pkgname-$pkgver"
}
package() {
cd "$srcdir/$pkgname-$pkgver"
... |
Java | UTF-8 | 1,165 | 2.859375 | 3 | [
"Apache-2.0"
] | permissive | package no.kantega.search.api.search;
import java.util.Date;
public class DateRange {
private final String field;
private final String gap;
private final Date from;
private final Date to;
/**
* @param field to create date range from
* @param from the date to start
* @param to the d... |
JavaScript | UTF-8 | 308 | 3.25 | 3 | [] | no_license | const HOUR_IN_MS = 1000 * 60 * 60
const differenceInHours = (dateA, dateB) =>
Math.trunc((dateA - dateB) / HOUR_IN_MS)
// How many hours are between 2 July 2014 06:50:00 and 2 July 2014 19:00:00?
module.exports = differenceInHours(
new Date(2014, 6, 2, 19, 0),
new Date(2014, 6, 2, 6, 50)
)
// => 12
|
C++ | UTF-8 | 3,954 | 2.921875 | 3 | [] | no_license | #include "JSONObject.h"
int __jsoneq(const char *json, jsmntok_t *tok, const char *s)
{
if (tok->type == JSMN_STRING && (int)strlen(s) == tok->end - tok->start &&
strncmp(json + tok->start, s, tok->end - tok->start) == 0)
{
return 0;
}
return -1;
}
JSONObject *JSONObject_CreateObject(v... |
Java | UTF-8 | 381 | 1.851563 | 2 | [] | no_license | package yp.com.akki.ypreportadmin.network;
import retrofit2.Call;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;
/**
* Created by akshaybmsa96 on 13/02/18.
*/
public interface ApiClientSubmitAttendance {
@POST("attendance/")
@FormUrlEncoded
C... |
C# | UTF-8 | 7,706 | 3.625 | 4 | [] | no_license | using System;
using System.Collections;
namespace Hierarchy
{
[Serializable]
public class MyQueue<T> : IEnumerable
{
public int Capacity { get; private set; } //Вместимость
public int Count { get; private set; } //Кол-во элементов
internal QueueElement<T> QueueElement; //Элемент ... |
Java | UTF-8 | 585 | 3.421875 | 3 | [] | no_license | package ch18;
import java.util.*;
public class TreeMapDemo {
public static void main(String[] args) {
TreeMap<String, Double> tm = new TreeMap<String, Double>(new RevLastNameComparator());
tm.put("John Doe", new Double(3434.34));
tm.put("Tom Smith", new Double(123.22));
tm.put("Jane Baker", new Double(1378.0... |
Markdown | UTF-8 | 3,098 | 2.875 | 3 | [] | no_license | ---
layout: post
title: Maya - Keyframe Reduction
description: Keyframe reduction for Maya using least-squares method.
img: /img/tools/keyframe_reduction_thumbnail.png
date: 2019-02-10 15:30:00
category: [tools]
tag: [tool, python, maya, pyside, rigging, animation]
github: https://github.com/robertjoosten/maya-keyframe... |
Java | UTF-8 | 9,382 | 2.375 | 2 | [
"MIT"
] | permissive | package odfgenerator;
import com.independentsoft.office.odf.TextDocument;
import javafx.beans.Observable;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
import javafx.beans.value.ObservableValue;
import javafx.collections.FXCollections;
import javafx.collections... |
Markdown | UTF-8 | 1,846 | 3.328125 | 3 | [
"Apache-2.0",
"MIT"
] | permissive | - Start Date: 2017-01-20
- RFC Issue: #30
- RFC PR:
- Implementation Issue:
# Summary
[summary]: #summary
Define the format for struct and union declarations.
# Details
[details]: #details
Struct names follow on the same line as the `struct` keyword, with the opening brace on
the same line when it fits within the ... |
Python | UTF-8 | 9,766 | 2.9375 | 3 | [] | no_license | """Hue Controller Module (main script)."""
import sys
import os
from hue_controller.hue_classes import HueBridge
from hue_controller.hue_util import get_next
def print_help():
"""Print Help Information."""
help_str = """Usage: hue_controller.py <command> [params]
Special Commands:
--init-bridge 'bridge ... |
PHP | UTF-8 | 4,035 | 2.765625 | 3 | [] | no_license | <?php
/**
* @author IMobiGeeks
* @category Controller
* @desc This is a utility class
*
*/
class Utility
{
/**
* Function - urlEncode
*
* This function is used to encode a given URL
*
* @param $url - it contains a url
* @return- it returns encoded URL
*/
function urlEncode($url)
{
$decoded_ur... |
Swift | UTF-8 | 1,168 | 2.640625 | 3 | [] | no_license | //
// MenuCalendar.swift
// ManageMoney
//
// Created by admin101 on 4/5/18.
// Copyright © 2018 demi. All rights reserved.
//
import UIKit
import FSCalendar
class MenuCalendar : UIViewController ,FSCalendarDelegate ,FSCalendarDataSource{
fileprivate weak var calendar: FSCalendar!
override func view... |
C# | UTF-8 | 907 | 2.53125 | 3 | [] | no_license | using System;
using System.Threading;
using System.Threading.Tasks;
using Application.Commons.Interfaces;
using Application.Commons.Models;
using Domain.Entities;
using MediatR;
namespace Application.Cars.Commands.CreateCarCommands
{
public class CreateCarCommand : IRequest<string>
{
public Car car { g... |
C++ | UTF-8 | 386 | 3.234375 | 3 | [
"Apache-2.0"
] | permissive | #include <iostream>
using namespace std;
int main()
{
int A, B, W;
cin >> A >> B >> W;
int min;
if((W*1000)%B == 0) {
min = (W*1000) / B;
} else {
min = (W*1000) / B + 1;
}
int max = (W*1000) / A;
if(min <= max) {
cout << min << " " << max << endl;
} else ... |
C++ | UTF-8 | 1,219 | 2.75 | 3 | [
"MIT"
] | permissive | #ifndef _USERWORDITERATORCREATOR_H_
#define _USERWORDITERATORCREATOR_H_
#include "WordIterator.h"
#include "WordIteratorCreator.h"
#include "DiscreteWordIterator.h"
#include "EvaluateStrategy.h"
#include "UserInfo.h"
#include "IDictionary.h"
#include <random>
#include <memory>
// 使用用户数据创建迭代器
class UserWordIteratorCre... |
Ruby | UTF-8 | 635 | 3.046875 | 3 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | require 'pry'
require_relative "./lib/cat.rb"
require_relative "./lib/dog.rb"
require_relative "./lib/owner.rb"
ryan = Owner.new("ryan")
ryan.buy_dog("Fido")
ryan.walk_dogs
ryan.buy_dog("Tom")
ryan.buy_dog("Rachel")
paws = Cat.new("Paws", ryan, "nervous", rand(10))
betty = Cat.new("Betty", ryan, "happy", rand(10))
a... |
Ruby | UTF-8 | 970 | 3.609375 | 4 | [
"MIT"
] | permissive | # Our CLI Controller
class PokedexList::CLI
def call
list_pokedex
menu
goodbye
end
def list_pokedex
puts "POKEDEX LIST "
@pokemon = PokedexList::List.pokemon
@pokemon.each.with_index(1) do |deal, i|
puts "#{i}. #{pokemon.name} - #{pokemon.t... |
PHP | UTF-8 | 529 | 3 | 3 | [] | no_license | <?php
declare(strict_types=1);
namespace Tests\Strategy;
use App\Strategy\RSortStrategy;
use PHPUnit\Framework\TestCase;
class SortStrategyTest extends TestCase
{
/**
* Teste algoritmo
*/
public function testFazAOrdenacaoDeFormAscendenteDeUmArray()
{
$rsort = new RSortStrategy();
... |
Markdown | UTF-8 | 10,212 | 2.546875 | 3 | [] | no_license | ---
layout: post
title: "Mind The Product 2020 - Recap Partie 1"
date: 2020-11-24 12:00:00 +0200
date-suffix: ", à 23h en faisant la cuisine et HHAAA mes gnoccis sont en train de cramer"
categories: conference
keywords: "CONFERENCE, MIND THE PRODUCT"
excerpt: "La semaine dernière j'ai assisté à la MindTheProduct, un... |
PHP | UTF-8 | 1,253 | 2.921875 | 3 | [] | no_license | <?php
require "../config/Conexion.php";
class Hora
{
public function __construct()
{
}
public function insertar($nombre)
{
$sql="INSERT INTO hora (nombre,estado)VALUES
('$nombre','1')";
return ejecutarConsulta($sql);
}
public function editar($idhora,$nombre)
... |
Java | UTF-8 | 4,913 | 2.015625 | 2 | [] | no_license | package com.zdsoft.finance.common.base;
import com.zdsoft.essential.dto.permission.DataOperPermDto;
import com.zdsoft.framework.core.common.domain.BaseEntity;
import com.zdsoft.framework.core.common.page.Page;
import com.zdsoft.framework.core.common.page.Pageable;
import org.springframework.data.jpa.repository.JpaRepo... |
Markdown | UTF-8 | 2,333 | 2.671875 | 3 | [] | no_license | ---
title: Hive QL(HQL)でORDER BYするときの注意点
date: 2009/10/14 23:57:37
tags: hadoop
published: true
---
<p>HiveでのSQLことHQLの小ネタ。HQLでは基本的にSQLはほぼ完璧に利用できますが、たまにハマりポイントもあります。その1つが並び替えのORDER BY。</p>
<h3>ORDER BYとSORT BY</h3>
<p>HQLの文法的にORDER BYは有効ですが、実際は並び替えは行われません。(無視されているような感じ)Hiveでは代わりに<strong>「SORT BY [column]」</strong>を利用... |
C++ | UTF-8 | 525 | 3.25 | 3 | [] | no_license | #include <iostream>
using namespace std;
void main()
{
int a, b;
double r;
cout << "introduceti a: ";
cin >> a;
cout << "introduceti b: ";
cin >> b;
if (a == 1 && b == 2 )
{r = a/b;
cout << "a/b = " << r << endl;
r = (double)a/b;
cout << "(double)a/b = " << r << endl;
r = 1. + a/b;
cout << "1. + a/b =... |
Python | UTF-8 | 836 | 2.546875 | 3 | [] | no_license | """CRUD operations."""
from model import db, Product, connect_to_db
import datetime
def create_product(channel_name,product_description, option, product_url, price, added_on, number_sold, margin, updated_on):
product = Product(channel_name=channel_name,
product_description=product_descrip... |
SQL | UTF-8 | 206 | 2.59375 | 3 | [
"MIT"
] | permissive | SELECT v.id AS videoGameId,
v.name AS videoGameName,
v.levels AS videoGameLevels
FROM Videogames v
WHERE ARRAY_CONTAINS(v.levels,
{
"title": "Jungle Arena",
"towers": 2
})
|
Java | UTF-8 | 1,413 | 2.40625 | 2 | [] | no_license | package com.zql.validator.controller;
import com.zql.validator.common.Result;
import com.zql.validator.entity.User;
import org.springframework.validation.BindingResult;
import org.springframework.validation.FieldError;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.anno... |
C# | UTF-8 | 859 | 3.578125 | 4 | [] | no_license | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ForLoop : MonoBehaviour
{
int numEnemies = 3;
void Start()
{
for (int i = 0; i < numEnemies; i++)
{
Debug.Log("Creating enemy number: " + i);
}
/* This is an example o... |
Python | UTF-8 | 3,390 | 2.515625 | 3 | [] | no_license | import time
from tabulate import tabulate
import pandas as pd
import Logger
class TimeKeeper:
def __init__(self):
self.pretty_df = pd.DataFrame(columns=['Image','BLEU','Total_Time','Comm_Time'])
self.E_START_CLIENT_PROCESSING = 'E_START_CLIENT_PROCESSING'
self.E_STOP_CLIENT_PROCESSING = '... |
Java | UTF-8 | 806 | 2.03125 | 2 | [] | no_license | package pl.kul.todos.adapter.gui.edititem;
import pl.kul.todos.adapter.gui.mainwindow.MainWindowPresenter;
public class EditItemPresenter {
private final EditItemView editItemView;
private final MainWindowPresenter mainWindowPresenter;
private final ItemToEditDto itemToEditDto;
public EditItemPresent... |
Java | UTF-8 | 4,164 | 2.96875 | 3 | [
"MIT"
] | permissive | package com.special.test13;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;
/**
* Create by Special on 2018/4/5 16:27
*/
public class ProEImprove3 {
static int[] s = {-1, 1};
static final int MIN = -1... |
C++ | UTF-8 | 726 | 2.703125 | 3 | [] | no_license | #ifndef LOGGER_H_INCLUDED
#define LOGGER_H_INCLUDED
#include <ostream>
#include <string>
#include <sstream>
#include <map>
#include <memory>
#include "windows.h"
class Logger
{
private:
// create logger which write to file
explicit Logger( std::ostream * ost );
Logger( const Logger & or... |
TypeScript | UTF-8 | 1,424 | 2.515625 | 3 | [] | no_license | import * as mongoose from 'mongoose';
import {IReturnedRental} from './ReturnedRental';
import ReturnedRental from '../database/ReturnedRental';
export class ReturnedRentalRepository {
private static returnedRentalRepository: ReturnedRentalRepository;
public static create(): ReturnedRentalRepository {
... |
JavaScript | UTF-8 | 1,260 | 3.0625 | 3 | [] | no_license | /*
* @lc app=leetcode.cn id=863 lang=javascript
*
* [863] 二叉树中所有距离为 K 的结点
*/
// @lc code=start
/**
* Definition for a binary tree node.
* function TreeNode(val) {
* this.val = val;
* this.left = this.right = null;
* }
*/
/**
* @param {TreeNode} root
* @param {TreeNode} target
* @param {number} K
... |
PHP | UTF-8 | 1,068 | 3 | 3 | [
"LicenseRef-scancode-996-icu-1.0",
"Apache-2.0",
"ICU"
] | permissive | <?php
use \Go\Chan;
use \Go\Time;
use \Go\Scheduler;
$ch1 = new Chan(["capacity"=>1]);
$ch2 = new Chan(["capacity"=>1]);
$exit = new Chan(0);
go(function() use($ch1, $ch2, $exit){
$selector = select(
[
'case', $ch1, function($value){
echo "go 0: receive from ch1: " . $value . P... |
PHP | UTF-8 | 1,255 | 2.515625 | 3 | [] | no_license | <?php
class pages_categoryModel extends commonModel
{
public function __construct()
{
parent::__construct();
}
//模型附加表信息
public function model_ini_data()
{
return array();
}
//模型文件或文件夹信息
public function model_ini_file()
{
return array();... |
Markdown | UTF-8 | 1,125 | 2.625 | 3 | [
"MIT"
] | permissive | # Get Unsubscribed Stats
This gets an XML document with the unsubscribed stats for a particular promotion and mail send.
## Unsubscribed Stats Options
[MadMimi's Statistics API Documentation](https://madmimi.com/developer/statistics-api-methods) should give you an idea
of what you need to send to the API. This opti... |
Markdown | UTF-8 | 24,240 | 2.65625 | 3 | [] | no_license | ---
title: ०२१
---
महातपा उवाच ।
पूर्वं प्रजापतिर्देवः सिसृक्षुर्विविधाः प्रजाः ।
चिन्तयामास धर्मात्मा यदा ता नाध्यगच्छत ।। २१.२ ।।
तदाऽस्य कोपात् संजज्ञे स च रुद्रः प्रतापवान् ।
रोदनात् तस्य रुद्रत्वं संजातं परमेष्ठिनः ।। २१.३ ।।
तस्य ब्रह्मा शुभां कन्यां भार्यार्थं मूर्त्तिसंभवाम् ।
गौरी नाम्ना स्वयं देव... |
Java | UTF-8 | 994 | 2.921875 | 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 Question3;
import java.util.ArrayList;
import java.util.Date;
/**
*
* @author Sai Satyanarayana Gullapalli
*/
public class... |
Swift | UTF-8 | 1,741 | 2.765625 | 3 | [
"MIT"
] | permissive | /// An abstract protocol that a GraphQL "`scalar`" type must conform to.
///
/// # See Also
/// [GraphQL Spec - Scalars](http://spec.graphql.org/October2021/#sec-Scalars)
public protocol AnyScalarType: JSONEncodable, AnyHashableConvertible {}
/// A protocol that represents any GraphQL "`scalar`" defined in the GraphQL... |
JavaScript | UTF-8 | 3,547 | 3.171875 | 3 | [] | no_license | //Array con el listado de canciones a mostrar en el reprodutor
const canciones = [
"music1.mp3",
"music2.mp3",
"music3.mp3"
]
var indiceActual = new Array(1)
function crearPlayList(){//Función para crear la playlist
const listado = document.createElement('ol')
lista... |
C++ | UTF-8 | 653 | 2.65625 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
using namespace std;
int n,x;
int s[111];
void input(){
scanf("%d %d",&n,&x);
for (int i=0;i<n;i++)
scanf("%d",&s[i]);
}
int binary_search(int so){
int l = 0;
int r = n-1;... |
C | UTF-8 | 4,397 | 2.8125 | 3 | [
"CC0-1.0"
] | permissive | #include "copy.h"
#include <exec/types.h>
#include <proto/keymap.h>
#include <assert.h>
#include <string.h>
// 'Normal' kmEntries are copied as-is
void copyNormal(void* pContext, UBYTE rawKey, UBYTE kmType, ULONG kmEntry) {
CopyContext* pClone = pContext;
*(pClone->pKmEntry++) = kmEntry;
}
// 'KCF_NOP' kmEntr... |
Java | UTF-8 | 928 | 2.390625 | 2 | [] | no_license | package ua.com.golubov.algo.exam.test;
import org.junit.Test;
import ua.com.golubov.algo.exam.CodilityNokiaService;
import static org.junit.Assert.assertEquals;
public class CodilityNokiaServiceTest {
@Test
public void testCase() {
assertEquals(11, new CodilityNokiaService().solution(9736));
... |
Python | UTF-8 | 289 | 3.53125 | 4 | [
"MIT"
] | permissive | """
A function that used to be buggy.
"""
def createabug(x):
"""
A function that created a bug by dividing by zero.
"""
y = x**4
# Stop the script and debug it.
#import pdb; pdb.set_trace()
# Set z to 1 rather than zero.
z = 1.
y = y/z
return y
print createabug(25)
|
Markdown | UTF-8 | 14,679 | 2.890625 | 3 | [
"MulanPSL-2.0",
"LicenseRef-scancode-mulanpsl-2.0-en",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | ---
---
---
title: 11统治阶层支配的历史
---
我们常用自己的眼光看待不熟悉的外国文化。北京政府所用的一些词句,使我们对它更难理解。中国的政治文章不光有道德性,还常掺杂进一些对历史人物的影射,如秦始皇(公元前221年,他建立起统一的帝国,被视为一个残酷的暴君,但也可把他看成是具有进步意义的人物),还有最近发明的马克思主义词汇,如“走资派”(指赞成用物质奖励促进生产的忠诚的党员;他本人并非资本家,但主张走物质发展的道路)。中国的民俗学与马克思主义对美国人来说都是异邦之物,我们在这两者间发现一些意义含混的词语,其威力显而易见,内容却令我们感到迷惑不解。既然中国的政治论争通常是间接和隐晦的,那么,这种迷惑也正说... |
Markdown | UTF-8 | 1,195 | 2.703125 | 3 | [
"CC-BY-4.0",
"MIT",
"LicenseRef-scancode-generic-cla"
] | permissive | # LED Single
identifier: 0x1e3048f8
camel: ledSingle
group: light
tags: 8bit, padauk
status: deprecated
A controller for 1 or more monochrome or RGB LEDs connected in parallel.
## Commands
command animate @ 0x80 {
to_red: u8
to_green: u8
to_blue: u8
speed: u8
... |
Java | UTF-8 | 1,167 | 2.71875 | 3 | [] | no_license | package com.example.root.metr.utils;
import android.support.v7.util.DiffUtil;
import java.util.List;
public class DiffCallback<T> extends DiffUtil.Callback{
private List<T> oldPersons;
private List<T> newPersons;
public DiffCallback(List<T> newPersons, List<T> oldPersons) {
this.newPersons = n... |
Markdown | UTF-8 | 740 | 2.84375 | 3 | [
"MIT"
] | permissive | # angular-auto-save
Code to auto save content of page in every 5 seconds(time could be changed)
My new solution uses the $watch method that Angular provides for watching for changes to scope variables. I don’t want to make requests to the server with every keystroke, so I’ll use a simple debounce function (using Angul... |
Java | UTF-8 | 3,426 | 2.171875 | 2 | [] | no_license | package com.ambition.epm.baseinfo.dao;
import java.util.ArrayList;
import java.util.List;
import net.sf.json.JSONObject;
import org.springframework.stereotype.Repository;
import com.ambition.epm.entity.EpmOrtIndicator;
import com.ambition.epm.entity.EpmOrtItem;
import com.norteksoft.product.orm.Page;
import com.nor... |
C++ | UHC | 1,279 | 2.515625 | 3 | [] | no_license | #include<stdio.h>
#define Max 21
typedef long long int ll;
ll fact[Max], K;
int N,op, ans[Max], visit[Max];
void init() {
for (int i = 0; i < Max; i++) {
ans[i] = 0;
visit[i] = 0;
}
fact[0] = 1;
for (int i = 1; i < Max; i++)
fact[i] = fact[i - 1] * i;
}
int main() {
init();
scanf("%d", &N);
scanf("%d", &op... |
Python | UTF-8 | 5,758 | 3.171875 | 3 | [] | no_license | from __future__ import division
import random
class Perceptron:
def __init__(self, learningRate, epoch, randomInit=True):
# There are 124 features in the test and training data.
self.FEATURE_COUNT = 124
random.seed(124)
# Should the weight vector and bias be randomly initalizied.
... |
Ruby | UTF-8 | 1,213 | 2.953125 | 3 | [] | no_license | class Assignment
extend ClassModule
include InstanceModule
attr_accessor :general_info, :github_link, :co_workers
attr_reader :id
def initialize(options={})
@id = options["id"]
@general_info = options["general_info"]
@github_link = options["github_link"]
@co_workers = options["co_work... |
C++ | UTF-8 | 1,840 | 2.984375 | 3 | [
"MIT"
] | permissive | /*
* Copyright © 2018 AperLambda <aperlambda@gmail.com>
*
* This file is part of kimiko++.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
#ifndef KIMIKO_MANAGER_H
#define KIMIKO_MANAGER_H
#include "command.h"
#include <optional>
namespace kimiko
{
/*!
* CommandManager.... |
Markdown | UTF-8 | 2,668 | 2.5625 | 3 | [
"Apache-2.0"
] | permissive | ---
pageClass: "rule-details"
sidebarDepth: 0
title: "yml/no-irregular-whitespace"
description: "disallow irregular whitespace"
since: "v0.1.0"
---
# yml/no-irregular-whitespace
> disallow irregular whitespace
- :gear: This rule is included in `"plugin:yml/recommended"` and `"plugin:yml/standard"`.
## :book: Rule D... |
Markdown | UTF-8 | 584 | 2.53125 | 3 | [] | no_license | # Pneumatic
I find myself trying to store links often that I want to share with others at a later time. This app easily stores the links for later retrieval.

## Tubes and Capsules
A tube is a queue that stores your individual links (capsules). Create a tube that is used to send to one person o... |
Python | UTF-8 | 1,856 | 3.109375 | 3 | [] | no_license | #!/usr/bin/env python
# Big Data Assignment 1 - Task5
# Jungwoo Han (jh5990@nyu.edu)
from operator import itemgetter
import sys
current_registration_state = None
registration_state = None
current_plate_id = None
plate_id = None
count = 0
max_count = 0
max_reg_state = None
max_plate_id = None
# input comes from STDI... |
C | UTF-8 | 5,994 | 2.546875 | 3 | [
"MIT"
] | permissive | #include "../include/penv.h"
#include "../include/pbound.h"
#include "../include/ptile.h"
#include <stdio.h>
int addsub_index(long long lhs_lattice, long long rhs_lattice){
//matrix points are generated by shifting away the ulp status.
int lpoint1 = (lhs_lattice >> 1);
int lpoint2 = (rhs_lattice >> 1);
//shift... |
PHP | UTF-8 | 728 | 2.625 | 3 | [] | no_license | <?php
if (!isset($_SESSION['id'])) {
if (isset($_COOKIE['user']) && isset($_COOKIE['hashPass'])) { // s'il y a des cookies de session, on vérifie qu'ils correspondent à un des users, et on ouvre la session
$req = $bdd->prepare('SELECT id FROM users WHERE user = :user AND hashPass = :hashPass');
$req->execute(arr... |
Markdown | UTF-8 | 10,885 | 3.484375 | 3 | [] | no_license |
## stats包
`scipy`计算包提供了[scipy.stats](https://docs.scipy.org/doc/scipy/reference/stats.html#module-scipy.stats)子模块来支持与**分布**和**概率**相关的计算.
`stats`子包中包含了几乎所有可能见到的**连续分布**和**离散分布**类型. 而对于所有的连续分布有着同样的方法来进行操作, 离散部分同理, 只是部分函数与连续的有区别.
因此在使用时, 需要首先选择一种分布, 然后使用这个分布中的某些方法来达成目的.
首先了解**连续分布**和**离散分布**共有的一些方法.
## 分布的可用方法
```... |
Java | UTF-8 | 7,714 | 2.625 | 3 | [] | no_license | package com.kaylerrenslow.mysqlDatabaseTool.fx.db;
import com.kaylerrenslow.mysqlDatabaseTool.database.lib.MysqlQueryResult;
import com.kaylerrenslow.mysqlDatabaseTool.fx.contextMenu.CM_DBTableView;
import com.kaylerrenslow.mysqlDatabaseTool.fx.control.factory.TableRowFactory;
import com.kaylerrenslow.mysqlDatabaseToo... |
C++ | UTF-8 | 971 | 3.71875 | 4 | [] | no_license | /*
* 04.cpp
*
* Created on: Dec 13, 2016
* Author: robertwinke
*/
#include <iostream>
#include <string>
#include <map>
using namespace std;
// write a function that takes a string and returns a map
// the map should have the letters of the string as keys and
// it should have integers as values that repr... |
C# | UTF-8 | 932 | 2.734375 | 3 | [
"MIT"
] | permissive | // Copyright (c) PdfToSvg.NET contributors.
// https://github.com/dmester/pdftosvg.net
// Licensed under the MIT License.
using System;
using System.IO;
using System.Threading.Tasks;
namespace PdfToSvg.Driver
{
internal static class Program
{
public static async Task Main()
{
var ... |
C++ | UTF-8 | 2,071 | 2.90625 | 3 | [
"MIT"
] | permissive | /*
* test_dispatch.cxx
*
* Created on: 29 Aug 2020
* Author: nirsancho
*/
#include "../dispatch/safe_queue.h"
#include "../dispatch/dispatch_queue.h"
#include <thread>
#include <chrono>
using namespace dispatch;
#define NITEMS 50000
#define TIMEOUT 10
struct Tiktok {
Tiktok(const std::string &label) :
... |
Python | UTF-8 | 5,905 | 2.5625 | 3 | [
"MIT"
] | permissive | from actualizar import *
from impresiones import limpiar, mostrarGanador
from movimientos import moverPzaEnTab, posiblesDestinos, reporMata
from busquedas import jugTienePza, validMov, posDePzaEnTab
def turno(tablero, jugs):
N = 0
hay_presi = False
siguiente = 0
anterior = -1
dblturn = False
first = True
turn... |
Java | UTF-8 | 3,877 | 3.0625 | 3 | [] | no_license | package correlationmatrix;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.commons.io.IOUtils;
public class CorrelationMatrix {
public static ... |
C++ | UTF-8 | 465 | 3.015625 | 3 | [] | no_license | // xy.cpp: definisce il punto di ingresso dell'applicazione console.
//
#include "stdafx.h"
#include<stdio.h>
int main()
{
int fine;
int x;
int y;
int contatore=0;
int risultato=1;
printf("digita un numero e il suo esponenente\n");
scanf_s("%d%d", &x, &y);
while (contatore < y) {
risultato = risultato*... |
JavaScript | UTF-8 | 4,436 | 3.40625 | 3 | [] | no_license | const form = document.querySelector('form');
const firstNameEl = document.querySelector('#first-name')
const lastNameEl = document.querySelector('#last-name')
const emailEl = document.querySelector('#email')
const passwordEl = document.querySelector('#password')
const submit = document.querySelector('.submit')
su... |
JavaScript | UTF-8 | 859 | 3.4375 | 3 | [] | no_license |
'use strict';
const a = { name: 'a', discs: [] };
const b = { name: 'b', discs: [] };
const c = { name: 'c', discs: [] };
function newHanoi(num) {
let counter = 0;
for (let i = 0; i < num; i++) {
a.discs.push(num - i);
console.log(a.discs, b.discs, c.discs);
}
const solver = (disc, sou... |
Java | UTF-8 | 3,587 | 2.796875 | 3 | [] | no_license | package hibernate.lesson4.dao;
import hibernate.lesson4.entity.Room;
import hibernate.lesson4.exceptions.BadRequestException;
import hibernate.lesson4.exceptions.DBException;
import hibernate.lesson4.utils.Filter;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.query.Native... |
C# | UTF-8 | 1,811 | 2.90625 | 3 | [
"MIT"
] | permissive | using GameStore.Data.Models;
using GameStore.Models;
using System.Collections.Generic;
using System.Linq;
namespace GameStore.Test.Data
{
public static class Games
{
public static IEnumerable<Game> GetFiveGames()
{
return Enumerable.Range(0, 5).Select(x => new Game
{
... |
Java | UTF-8 | 1,555 | 2.140625 | 2 | [] | no_license | package uz.cas.controllersestem.payload.request;
import javax.validation.constraints.NotBlank;
public class ReqUser {
@NotBlank(message = "malumot kiritilmagan")
private String firstName;
@NotBlank(message = "malumot kiritilmagan")
private String lastName;
@NotBlank(message = "malumot kiritilmaga... |
C# | UTF-8 | 827 | 3.328125 | 3 | [] | no_license | namespace Utilities
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
/// <summary>
/// Permite adicionar linhas a uma tabela.
/// </summary>
/// <typeparam name="ElementType">O tipo de objetos que constituem as entradas da tabela.</typeparam>
... |
Python | UTF-8 | 720 | 3 | 3 | [] | no_license | import time
from typing import Union
import RPi.GPIO as GPIO
class SSR:
def __init__(self, pin: int) -> None:
self.__pin = pin
GPIO.setup(
self.__pin,
GPIO.OUT,
)
self.is_on = 0
GPIO.output(self.__pin, self.is_on)
def write(self, is_on: Union[b... |
Ruby | UTF-8 | 2,020 | 2.640625 | 3 | [
"MIT"
] | permissive | require 'shameless/errors'
module Shameless
class Index
PRIMARY = :primary
attr_reader :name
def initialize(name, model, &block)
@name = name || PRIMARY
@model = model
instance_eval(&block)
end
DataTypes = {integer: Integer, string: String}
DataTypes.each do |name, type|... |
Python | UTF-8 | 6,470 | 4.25 | 4 | [] | no_license | """
Hash Map :
A key-value store that uses an array and a hashing function to save and retrieve values.
Being a map means relating two pieces of information, but a map also has one further requirement.
Key: The identifier given to a value for later retrieval.
In order for a relationship to be a map, eve... |
Markdown | UTF-8 | 1,047 | 3.328125 | 3 | [] | no_license | ####初始化
```c++
//1.chushihua.cpp
#include <iostream>
#include <string>
#include <algorithm>
using std::cin;
using std::cout;
using std::endl;
using std::string;
int main() {
int a = 0;
int b(1);
int c = {3};
}
```
```c++
//大佬笔记
#include <iostream>
using namespace std;
struct test{
public:
string s... |
Java | UTF-8 | 85 | 1.664063 | 2 | [] | no_license | package com.example.demo.utils;
public enum RoleEnum {
CLIENT,
LIBRARIAN
}
|
C++ | UTF-8 | 1,832 | 3.90625 | 4 | [] | no_license | /*
Short example of how to use the trig functions in C++
Code by Jason Lillard, 2018
*/
#include <cmath> //for trig function functions
#include <iostream> // for input and output
using namespace std;
//FUNCTION PROTOTYPE
//helper function to get float inputs w/0 breaking
float getFloat(const char * pro... |
C# | UTF-8 | 1,917 | 2.71875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DemonstrativoPagamento
{
public class FolhaPagamento : IFolhaPagamento
{
public Demonstrativo GerarDemonstrativo(int horasCategoria, double salarioBase, double horasExtras, dou... |
Ruby | UTF-8 | 624 | 3.359375 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | require 'pry'
class Artist
attr_reader :name
@@all = []
def initialize(name)
@name = name
save
end
def name=(name)
@name = name
end
def self.all
@@all
end
def add_song(song_instance)
song_instance.artist = self
end
def songs
Song.all.select do |song|
song.artis... |
Python | UTF-8 | 1,384 | 2.640625 | 3 | [] | no_license | from struct import *;
from binascii import *;
from array import *;
from random import *;
from re import *;
from socket import *;
import sys;
from helper import *
serverName = "paris.cs.utexas.edu"
serverPort = 35604
serverIP = gethostbyname(serverName)
# creates a UDP socket #
sock = socket(AF_INET, SOCK_DGRAM)
coo... |
Markdown | UTF-8 | 1,534 | 3.109375 | 3 | [] | no_license | # monograph
This is a little web site generator, just for me, so I can publish journal
entries, if I want.
It uses [hemingway](https://github.com/griffinmyers/hemingway) to parse individual
journal entries and a hacky treetop parser I rigged together just to parse my
journal structure.
# generally, how it works.
I'... |
Java | UTF-8 | 1,089 | 2.46875 | 2 | [] | no_license | package com.dhrs.service.impl;
import com.dhrs.dao.UserDao;
import com.dhrs.domain.User;
import com.dhrs.service.UserService;
public class UserServiceImpl implements UserService {
private UserDao userDao;
@Override
public User getUserByUsername(String username) {
User user = null;
try {
... |
Markdown | UTF-8 | 4,209 | 2.84375 | 3 | [
"Apache-2.0"
] | permissive | [](https://jitpack.io/#Yesferal/HornsApp-DI)
# HADI: Kotlin HornsApp Dependency Injection
Hadi is a whole Kotlin container, which you can use very simple on JVM or Android.
You can define all the instance that you will need in your app and manage them in a single place.... |
C++ | UTF-8 | 3,519 | 2.78125 | 3 | [
"MIT"
] | permissive | // Explanation: https://www.youtube.com/watch?v=WMZp0XzkhyQ
/**********************************************************************************************************/
// Problem: E - Rotate and Flip
// Contest: AtCoder - AtCoder Beginner Contest 189
// URL: https://atcoder.jp/contests/abc189/tasks/abc189_e
// Memor... |
Markdown | UTF-8 | 2,462 | 2.6875 | 3 | [] | no_license | # Everything Proxy
More often than not I find myself behind a proxy server. And then, that one tool I need, just doesn't work. Well, this guide might help.
## APT (Debian's Advanced Package Tool)
```bash
# Configure the proxy in the proxy.conf file
cat /etc/apt/apt.conf.d/proxy.conf
Acquire::http::Proxy "http://prox... |
Java | UTF-8 | 2,211 | 3.09375 | 3 | [] | no_license | package main.converters;
import com.opencsv.bean.AbstractBeanField;
/*
* Converts given String into Java Double object.
* Works directly for phosphate, nitrate/nitrite.
*/
public class DoubleConverter extends AbstractBeanField<String> {
// uses SimpleDoubleConverter as base
private SimpleDoubleConverter co... |
C# | UTF-8 | 4,870 | 2.703125 | 3 | [] | no_license |
namespace SystemFrameWork.Error
{
using System;
using ExtendedMethords;
/// <summary>
/// This class is used for logging error
/// </summary>
public class Error : IError
{
#region Private Variable
#endregion
#region Properties
/// <summary>
/// Ge... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.