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 | 2,386 | 3.015625 | 3 | [] | no_license | // -*- C++ -*-
// $RCSfile: circlestack.h,v $
// $Revision: 1.4 $
// $Author: langer $
// $Date: 2000-10-24 14:35:17 $
/* This software was produced by NIST, an agency of the U.S. government,
* and by statute is not subject to copyright in the United States.
* Recipients of this software assume all responsibilities... |
JavaScript | UTF-8 | 488 | 2.5625 | 3 | [
"MIT"
] | permissive | /*
* Author: maeek
* Description: No history simple websocket chat
* Github: https://github.com/maeek/vv-chat
* Version: 1.1.1
*
* You can generate password from command line
* Usage: node passwordHash.js password
*
*/
const bcrypt = require('bcrypt-nodejs');
const args = process.argv.slice(2);
v... |
Markdown | UTF-8 | 2,475 | 2.84375 | 3 | [
"MIT"
] | permissive | # GUI Programming with C++ [Video]
This is the code repository for [GUI Programming with C++ [Video]](https://www.packtpub.com/application-development/gui-programming-c-video?utm_source=github&utm_medium=repository&utm_campaign=9781789139464), published by [Packt](https://www.packtpub.com/?utm_source=github). It conta... |
Java | UTF-8 | 909 | 2.015625 | 2 | [] | no_license | package com.thoughtworks.i1.commons.test;
import com.thoughtworks.i1.commons.util.DBUtils;
import org.junit.runners.model.FrameworkMethod;
import org.junit.runners.model.InitializationError;
import org.slf4j.LoggerFactory;
public class TransactionalDomainTestRunner extends AbstractTestRunner {
public Tr... |
JavaScript | UTF-8 | 927 | 2.515625 | 3 | [
"MIT"
] | permissive | function Method(options, system) {
this.construct(options, system, 'extended');
}
Method.prototype.types = {
extended: function (options) {
this.include(options, {
method: undefined
});
this.notifyUndefined(['method']);
if (typeof this.method == 'string') {
this.method = eval('(' + this... |
Python | UTF-8 | 2,707 | 3.34375 | 3 | [] | no_license | import streamlit as st
import pandas as pd
from PIL import Image
# Importacion de Archivos
image = Image.open('Description.jpg')
st.title('Energy in Place')
# Variables de ingreso
st.info('Cálculo de calor almacenado y potencial de generación geoeléctrica usando método volumétrico y valores de parámetros... |
Java | UTF-8 | 3,100 | 1.859375 | 2 | [] | no_license | package shangri.example.com.shangri.ui.adapter;
import android.content.Context;
import android.view.ViewGroup;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.wi... |
JavaScript | UTF-8 | 3,453 | 3.875 | 4 | [] | no_license | window.onload = function() {
// list of possible words
var wordBank = ["computer", "program", "mouse", "keyboard", "javascript", "css", "html", "website"];
var randomWord = wordBank[Math.floor(Math.random() * wordBank.length)]; // randomly selects a word from wordBank
var underscores = [];
for (var i = 0; i <... |
C++ | UTF-8 | 2,580 | 2.8125 | 3 | [
"BSD-2-Clause",
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /*
* This file is part of the source code of the software program
* Vampire. It is protected by applicable
* copyright laws.
*
* This source code is distributed under the licence found here
* https://vprover.github.io/license.html
* and in the source directory
*/
/**
* @file FormulaVarIterator.hpp
* Defines a... |
Python | UTF-8 | 1,660 | 2.734375 | 3 | [] | no_license | import os
from os import walk
from nltk.tokenize import RegexpTokenizer
from gensim.models import Word2Vec
def gen_formatted_review(data_dir, tokenizer = RegexpTokenizer(r'\w+') ):
data = []
for filename in os.listdir(data_dir):
file = os.path.join(data_dir, filename)
with open(file,encoding='... |
Java | UTF-8 | 1,629 | 2.359375 | 2 | [] | no_license | package com.datalife.controller;
import com.datalife.entities.User;
import com.datalife.repositories.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.Pa... |
PHP | UTF-8 | 2,942 | 2.515625 | 3 | [] | no_license | <?php
class Like extends MY_Controller
{
public function __construct()
{
parent::__construct();
$this->CI =& get_instance();
$this->load->model('comment_model');
$this->load->model('news_model');
$this->load->model('like_model');
if (ENVIRONMENT === 'productio... |
Markdown | UTF-8 | 8,296 | 2.828125 | 3 | [
"CC-BY-4.0",
"MIT"
] | permissive | ---
title: "Type List (Visual Basic) | Microsoft Docs"
ms.date: "2015-07-20"
ms.prod: ".net"
ms.reviewer: ""
ms.suite: ""
ms.technology:
- "devlang-visual-basic"
ms.topic: "article"
f1_keywords:
- "StructureConstraint"
- "vb.StructureConstraint"
- "ClassConstraint"
- "vb.ClassConstraint"
dev_l... |
Java | UTF-8 | 1,341 | 2.34375 | 2 | [] | no_license | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Dao;
import Modelo.Estadocivil;
import Modelo.Nivelhabilitacao;
import conexao.Conexao;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLEx... |
C# | UTF-8 | 1,937 | 2.5625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Assets.Scripts.Magic;
using UnityEngine;
using UnityEngine.Assertions;
namespace Assets.Scripts.Map
{
public class MapModel : MonoBehaviour
{
public List<TileModel> Tiles { get; set; }
private Dictionar... |
Python | UTF-8 | 3,651 | 2.78125 | 3 | [] | no_license | import datetime
import pandas as pd
import random
LABEL_UNKNOWN = 'Unknown'
LABEL_OTHER = 'Other'
class ClassificationModel:
def __init__(self, train_df, test_df, output_label):
self.train_df = train_df
self.test_df = test_df
self.output_label = output_label
self.category_encode ... |
C++ | UTF-8 | 4,526 | 3.015625 | 3 | [] | no_license | #include "TXLib.h"
const int PAUSE = 0;
const int SUIT_SPADES = 0,
SUIT_HEARTS = 1,
SUIT_CLUBS = 2,
SUIT_DIAMONDS = 3,
SUIT_FACE1 = 4,
SUIT_FACE2 = 5,
TOP_SPACE = 50;
const int N = 13;
struct Page {
int page_... |
C++ | UTF-8 | 4,463 | 2.625 | 3 | [] | no_license | /* DUO VERSION
=================================================================================
XBEE 868Mhz - RS485 Node Transparent Mode - With RX/TX and power LEDs
=================================================================================
- Pin 20 used for RS485 direction control
- Pin 13 turne... |
Shell | UTF-8 | 855 | 3.5 | 4 | [] | no_license | #!/bin/bash
default_action="s"
action=${1:-$default_action}
if [ $action == "s" ]; then
#запускаем скрипт start.sh
start-stop-daemon -Sbmp /var/www/html/mainpid -x /var/www/html/modules/start.sh
echo 'Для завершения записи необходим параметр: e';
elif [ $action == "e" ]; then
#запускаем скрипт end.sh
pid=`cat /var/... |
Markdown | UTF-8 | 11,570 | 2.578125 | 3 | [] | no_license | # -树莓派智能安防摄像头(Smart security camera for home use by Raspberry-Pi)

## -目录(Catalogue)
- [-描述(Description)](#-描述description)
- [-详细功能(detailed function)](#-详细功能detailed-function)
- [-为什么使用树莓派(Why Raspberry Pi?)](#-为什么使用树莓派why-raspberry-pi)
- [- 如何使用(How to do)](#--如何使用how-to-do) ... |
Java | UTF-8 | 2,850 | 2.390625 | 2 | [] | no_license | package ru.mirea.app.schedule;
import android.content.Context;
import android.database.Cursor;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
/**
* Created by Senik on 12.03.2015.
*/
public class ScheduleAdapter extends android.support.v... |
Markdown | UTF-8 | 12,452 | 3.171875 | 3 | [] | no_license | ---
title: 网络时代,基督徒凡事都要规规矩矩地照着次序行
author: sweditor3
type: post
date: 2018-11-29T02:38:26+00:00
url: /2018/11/29/网络时代基督徒凡事都要规规矩矩地照着次序行/
categories:
- 《@守望》第120期——面对数字化产品
---
<p style="text-align: center;">
<span style="font-size: 12pt;">文/晓峰 牧师</span>
</p>
**<span style="font-size: 12pt;">经文:</span>**
**<... |
Shell | UTF-8 | 2,024 | 3.890625 | 4 | [
"Apache-2.0"
] | permissive | #!/usr/bin/env bash
function devices {
bluetoothctl devices
}
function paired_devices {
bluetoothctl paired-devices
}
function connect_mouse_mx {
connect_device "MX Master"
}
function connect_mouse_ultrathin {
connect_device "Ultrathin Touch Mouse"
}
function connect_keyboard {
connect_device "Keyboard... |
JavaScript | UTF-8 | 389 | 3.21875 | 3 | [] | no_license | const inputText = document.querySelector('input#name-input');
const outputText = document.querySelector('span#name-output');
inputText.addEventListener('input', e => {
// outputText.textContent = e.target.value || "незнакомец";
if (e.target.value === '') {
outputText.textContent = 'незнакомец';
} else {
... |
Python | UTF-8 | 560 | 2.6875 | 3 | [] | no_license | import urllib.request, urllib.parse, urllib.error
from bs4 import BeautifulSoup
import ssl
import re
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
url = 'http://py4e-data.dr-chuck.net/comments_738328.html'
html = urllib.request.urlopen(url,context = ctx).read(... |
C | UTF-8 | 1,459 | 2.59375 | 3 | [] | no_license | #include <gba_console.h>
#include <gba_video.h>
#include <gba_interrupt.h>
#include <gba_systemcalls.h>
#include <gba_sio.h>
#include <gba_input.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define JOY_WRITE (1 << 1)
#define JOY_READ (1 << 2)
// REG_HS_CTRL = JOYCNT
// REG_JSTAT = JOYSTAT
static vo... |
Markdown | UTF-8 | 649 | 2.96875 | 3 | [] | no_license | # Crossroads Web Help
This site is where we'll be documenting how to work with and edit the [Crossroads of Arlington website](https://www.crossroadsofarlington.org). Keep in mind, this help site is a work in progress. If there's something you need documented, please let us know.
## Available Help Docs
1. ==__[Workin... |
Java | UTF-8 | 2,097 | 2.1875 | 2 | [] | no_license | package com.jwtauth2.pratice.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.BadCredentialsException;
import org.spring... |
Go | UTF-8 | 802 | 2.9375 | 3 | [] | no_license | package sort
import (
"algorithms/result"
)
func SelectionSort(intSlice *[]int,order string) result.Result {
switch order {
case "ascending":
for i := 0; i < len(*intSlice); i++ {
minIndex := i
for j := i + 1; j < len(*intSlice); j++ {
if (*intSlice)[j] < (*intSlice)[minIndex] {
minIndex = j
}... |
Java | UTF-8 | 311 | 2.03125 | 2 | [] | no_license | package com.vainolo.jjtv5.model;
import org.eclipse.gef.requests.CreationFactory;
public class NodeFactory implements CreationFactory {
@Override
public Object getNewObject() {
return new Node();
}
@Override
public Object getObjectType() {
return Node.class;
}
}
|
Java | UTF-8 | 685 | 1.898438 | 2 | [] | no_license | package com.caton.mvvmdemo.ui.login;
import android.arch.lifecycle.LifecycleObserver;
import android.arch.lifecycle.ViewModel;
import android.arch.lifecycle.ViewModelProvider;
import android.content.Context;
import android.databinding.ObservableField;
import android.widget.Toast;
import com.caton.mvvmdemo.app.MyAppli... |
Java | UTF-8 | 508 | 1.992188 | 2 | [] | no_license | package site.newvalue.dao;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import site.newvalue.domain.User;
import java.util.List;
public interface IUserDao {
@Select("select * from user")
public List<User> findAll();
@Select("select * from user where id=#{id}")... |
Java | UTF-8 | 1,169 | 2.0625 | 2 | [] | no_license | package com.developcollect.commonpay.pay.wxpay;
import com.developcollect.commonpay.PayPlatform;
import com.developcollect.commonpay.config.GlobalConfig;
import com.developcollect.commonpay.config.WxPayConfig;
import com.developcollect.commonpay.pay.wxpay.sdk.WXPayConfig;
import lombok.Data;
import lombok.EqualsAndHas... |
Java | UTF-8 | 860 | 3.109375 | 3 | [
"Apache-2.0"
] | permissive | package com.ppang.randomLinkedListSort;
import java.util.*;
public class Solution {
class Comp implements Comparator<RandomListNode> {
public int compare(RandomListNode a, RandomListNode b) {
return a.val - b.val;
}
}
public RandomListNode sortRandom(RandomListNode root) {
if (root==null |... |
Python | UTF-8 | 822 | 2.90625 | 3 | [] | no_license | import os
import glob
path_a = "C:\\Users\\pisharamsomarajanh\\Desktop\\Excel_Exports\\MP_10msec"
os.chdir(path_a)
a = glob.glob('*.xlsx')
path_b = "C:\\Users\\pisharamsomarajanh\\Desktop\\Excel_Exports\\Main\\MP\\MP_10ms"
os.chdir(path_b)
b = glob.glob('*.xlsx')
a_only = []
b_only = []
print("Only in '... |
Python | UTF-8 | 3,796 | 2.5625 | 3 | [] | no_license | from app import db
from flask.ext.login import UserMixin
from sqlalchemy import UniqueConstraint
import random # FIXME: remove it when rating calculation is implemented
class User(db.Model, UserMixin):
id = db.Column(db.Integer, primary_key=True)
login = db.Column(db.String(64), index=True, unique=True)
... |
JavaScript | UTF-8 | 2,109 | 2.703125 | 3 | [] | no_license | import React, { Component } from 'react';
import '../styling/Metronome.css';
import click1 from '../sounds/click1.wav';
import click2 from '../sounds/click2.wav';
import { Button } from 'shards-react';
class Metronome extends Component {
constructor(props) {
super(props);
this.state = {
playing : fals... |
C++ | UTF-8 | 2,161 | 2.609375 | 3 | [
"MIT"
] | permissive | //==============================================================================
// CheckSimulation.cxx
// This program produces histograms using data
// from a LArSoft-simulated ROOT file
//
// Gleb Sinev, 2016, gleb.v.sinev@gmail.com
//==============================================================================
#... |
C++ | UTF-8 | 439 | 2.734375 | 3 | [
"LicenseRef-scancode-public-domain",
"MIT"
] | permissive | #pragma once
#include "Core/Colour.h"
struct CircleRendererComponent
{
Colour colour{ 1.0f, 1.0f, 1.0f, 1.0f };
float radius = 0.5f;
float thickness = 1.0f;
float fade = 0.005f;
CircleRendererComponent() = default;
CircleRendererComponent(const CircleRendererComponent&) = default;
private:
friend cereal::acce... |
Markdown | UTF-8 | 1,818 | 2.75 | 3 | [] | no_license | ---
title: Units & Dimensions
weight: 10
---
## Builder Units
All units used by the builder are in Millimeters (`mm`). That includes dimensions, coordinates and output. Unfortunately, the current library I am using for exporting DXF files does not support specifying the units in the file format. Because of this, t... |
PHP | UTF-8 | 4,240 | 2.984375 | 3 | [] | no_license | <?php
class EasyPDO_Table {
private $db;
private $name = NULL;
public $cols = NULL;
function __construct($DataBase, $table) {
$this->db = $DataBase;
$this->name = $table;
}
public function all() {
return $this->db->query("SELECT * FROM `" . $this->name . "` ");
}
... |
Java | UTF-8 | 1,036 | 2.375 | 2 | [
"Apache-2.0"
] | permissive | package me.pesehr.trustconnection.app;
import com.squareup.okhttp.OkHttpClient;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLSession;
import javax.net.ssl.SSLSocketFactory;
/**
* Created by pesehr on 23/08/2015.
*/
public final class HttpsClient extends Ok... |
Python | UTF-8 | 230 | 2.53125 | 3 | [] | no_license | a = int(input())
n = list(map(int,input().split()))[1:]
m = list(map(int,input().split()))[1:]
l = n + m
s = set(l)
s.remove(0) if 0 in s else s
if a==len(s):
print("I become the guy.")
else:
print("Oh, my keyboard!")
|
C# | UTF-8 | 2,032 | 2.671875 | 3 | [] | no_license | using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.ComponentModel;
using System.Diagnostics;
using System.Windows.Forms;
namespace BuckRogers.Interface
{
class EmptyMessageListView : ListView
{
public EmptyMessageListView()
... |
Python | UTF-8 | 282 | 3 | 3 | [] | no_license | class DEBUG():
ENABLED = True
def ON(self):
self.ENABLED = True
print(self.ENABLED)
def OFF(self):
self.ENABLED = False
print(self.ENABLED)
def MSG(self, NME, PROS, CMD, MSG):
if self.ENABLED == True:
print(f'| {str(NME)}: {str(PROS)}: { str(CMD)}: {str(MSG)}') |
JavaScript | UTF-8 | 2,645 | 2.609375 | 3 | [
"MIT"
] | permissive | require('babel-polyfill');
const React = require('react');
const ReactDOM = require('react-dom');
const Datepicker = require('../');
class App extends React.Component {
constructor(props) {
super(props);
this.state = {
events: [],
defaultValue: '2019-03-01'
}
}
onSelect(date) {
this.s... |
JavaScript | UTF-8 | 1,711 | 2.71875 | 3 | [] | no_license | var sodium = require('sodium-native')
// ECDH
// x25519
// Create Alice keypair
var AlicePublicKey = sodium.sodium_malloc(sodium.crypto_box_PUBLICKEYBYTES)
var AlicePrivateKey = sodium.sodium_malloc(sodium.crypto_box_SECRETKEYBYTES)
sodium.crypto_box_keypair(AlicePublicKey, AlicePrivateKey)
console.log(`Alice ${sod... |
Java | UTF-8 | 10,875 | 2.421875 | 2 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package osprojectthree;
import java.util.*;
import java.lang.*;
import java.io.*;
/**
*
* @author deadoggy
*/
publi... |
Java | UTF-8 | 537 | 1.75 | 2 | [
"MIT"
] | permissive | package br.com.publicacao.springboot.api.service;
import br.com.publicacao.springboot.api.dto.PublicacaoDTO;
import br.com.publicacao.springboot.api.model.Publicacao;
import org.springframework.http.ResponseEntity;
import java.util.List;
public interface IPublicacaoService {
ResponseEntity<List<PublicacaoDTO>> ... |
C# | UTF-8 | 1,193 | 3.0625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using recipefinder.Classes;
using Xamarin.Forms;
namespace recipefinder
{
public partial class DisplayRecipePage : ContentPage
{
string stepsToMake = "";
public DisplayRecipePage(Recipe recipeToDisplay, string type)
{
Initia... |
C++ | UTF-8 | 609 | 3.34375 | 3 | [] | no_license | #include <iostream>
#include <algorithm>>
using namespace std;
int main()
{
// Max先记录最小的数字,然后慢慢赋值变大
// x表示输入的数字
// temp比较大小
int n, Max = -9999, x, temp = 0;
cin >> n;
for(int i = 0; i < n; i++)
{
// 循环输入
cin >> x;
// 每次都是前一个数和后一个数的和 与 后一个数比大小
// 大的记录起来
... |
JavaScript | UTF-8 | 448 | 2.65625 | 3 | [] | no_license | class InfoBox {
constructor(AuthorBox) {
this.cntx = AuthorBox.getContext('2d');
this.x = 300;
this.y = 300;
}
draw(cntx, score) {
this.cntx.font = '50px Arial';
this.cntx.fillStyle = 'black';
this.cntx.fillText(
`BAD SKY CAB`,
this.x,
this.y
);
this.cntx.stroke... |
Java | UTF-8 | 2,349 | 2.078125 | 2 | [
"MIT"
] | permissive | package com.mediscreen.notes.mock;
import com.mediscreen.notes.api.model.Note;
import com.mediscreen.notes.persistence.entity.NoteEntity;
import com.mediscreen.notes.persistence.mapper.NoteMapper;
import java.time.ZoneOffset;
import java.time.ZonedDateTime;
import java.util.ArrayList;
import java.util.Arrays;
import j... |
Java | UTF-8 | 5,723 | 1.9375 | 2 | [
"Apache-2.0"
] | permissive | /*******************************************************************************
* Copyright 2017 Albert Shun-Dat Chan
*
* 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.apach... |
C# | UTF-8 | 3,306 | 2.703125 | 3 | [
"MIT"
] | permissive | using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using GraphQL;
namespace CoreSharp.GraphQL.Configuration
{
public class TypeConfiguration<TType> : TypeConfiguration, ITypeConfiguration<TType>
{
public TypeConfiguration() : base(typeof(TType))
{
base.Fi... |
JavaScript | UTF-8 | 2,202 | 2.546875 | 3 | [] | no_license | const router = require('express').Router();
let RojakPoem = require('../models/rojakPoem.model');
let ActualPoem = require('../models/actualPoem.model');
let NewSauce = require('../models/newSauce.model');
router.route('/getRojakPoems').get((req, res) => {
RojakPoem.find().sort({ _id: -1 })
.then(poems ... |
Python | UTF-8 | 109 | 2.8125 | 3 | [] | no_license | # -*- coding: cp1252 -*-
kierros = 0
while kierros < 5:
print("Olemme kierroksella",kierros)
kierros += 1 |
C | UTF-8 | 642 | 2.5625 | 3 | [] | no_license | #ifndef LISTAS
#define LISTAS
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
//Estruturas de dados
typedef struct tipoCelulah* apontador;
typedef struct{
int chave;
} tipoNo;
typedef struct tipoCelulah{
tipoNo no;
apontador prox;
} tipoCelula;
typedef struct {
apontador inicio;
... |
Java | UTF-8 | 1,205 | 3.28125 | 3 | [
"Apache-2.0"
] | permissive | package edu.neu.coe.info6205.union_find;
import java.util.Random;
public class UF_Client {
public static int count(int n){
//variable for no. of connections
int connections = 0;
UF_HWQUPC uf = new UF_HWQUPC(n);
Random r = new Random();
while (uf.components() > 2) {
... |
JavaScript | UTF-8 | 1,175 | 4.3125 | 4 | [
"MIT"
] | permissive | // Exercise 1
function Car(name) {
this.name = name;
this.acceleration = 0;
this.honk = function() {
console.log("Toooooooooot!");
};
this.accelerate = function(speed) {
this.acceleration = this.acceleration + speed;
}
}
var car = new Car("BMW");
car.honk();
console.log(car.acc... |
Python | UTF-8 | 730 | 3.875 | 4 | [] | no_license | class MovingAverage:
def __init__(self, size: int):
"""
Initialize your data structure here.
"""
self.size = size
self.store = collections.deque()
self.sum = 0
self.full = False
def next(self, val: int) -> float:
self.store.append(val)
se... |
JavaScript | UTF-8 | 187 | 3.828125 | 4 | [] | no_license | let lista = [10, 58, 68, 88, 25, 45]
let soma = 0
for(let i = 0; i < lista.length; i++){
lista[i] = Math.pow(lista[i], 3)
soma += lista[i]
}
console.log(lista)
console.log(soma) |
TypeScript | UTF-8 | 1,022 | 2.84375 | 3 | [] | no_license | 'use strict';
const canvas = document.querySelector('.main-canvas') as HTMLCanvasElement;
const ctx = canvas.getContext('2d');
function drawTwoLines(startVertical: number, startHorizontalLeft: number, startHorizontalRight: number, color: string) {
ctx.strokeStyle = color;
ctx.beginPath();
ctx.moveTo(canvas.wid... |
Java | UTF-8 | 1,874 | 3.375 | 3 | [] | no_license | import java.io.*;
public class Main {
public static void main(String[] args) {
String str = "MAKS hello BOBBY Sesuriti";
int a = str.indexOf("A");
int b = str.lastIndexOf("B");
System.out.println("Первое вхождение символа (А) в строке -> " + a);
System.out.println("Последн... |
JavaScript | UTF-8 | 2,277 | 3.1875 | 3 | [] | no_license | class CartCard {
get stock() {
return this.card.stock.innerText;
}
set stock(stock) {
this.card.stock.innerText = stock;
}
constructor(name, price, stock, image) {
this.card = document.createElement('div');
this.card.classList.add('cart-card');
this.card.data... |
JavaScript | UTF-8 | 2,224 | 4.0625 | 4 | [] | no_license | function LinkedList() {
this.head = null;
this.tail = null;
this.size = 0;
}
//Insert element in contant time O(1)
LinkedList.prototype.add = function(value) {
var node = {
value: value,
next: null
};
this.size++;
//List is empty, make head = tail = node O(1)
if(this.he... |
C# | UTF-8 | 2,209 | 3.421875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TpPooCSharp
{
class Program
{
private static Random random = new Random();
static void Main(string[] args)
{
DisplayMenu();
ConsoleKeyInfo consoleKeyInfo = Console.ReadKey(tr... |
Java | UTF-8 | 511 | 2.171875 | 2 | [] | no_license | package com.example.demo;
import org.springframework.data.jdbc.repository.query.Modifying;
import org.springframework.data.jdbc.repository.query.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;
import java.util.Optional;
public interface Studen... |
Java | UTF-8 | 2,164 | 2.484375 | 2 | [] | no_license | package com.prankit.contactmanager.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.prankit.contactmana... |
Python | UTF-8 | 421 | 3.046875 | 3 | [] | no_license | dct = {"L": (-1, 0), "R": (1, 0), "U": (0, 1), "D": (0, -1)}
def prog(dat):
d = {}
x, y = 0, 0
val = 0
d[(0, 0)] = 0
for ch in dat:
val += 1
dx, dy = dct[ch]
x += dx
y += dy
if (x, y) in d:
return "BUG"
d[(x, y)] = val
for ch1 in "LRUD":
dx, dy = dct[ch1]
if (x + dx, y + dy) in d and d[(x +... |
Java | UTF-8 | 713 | 2.046875 | 2 | [] | no_license | package pe.com.interbank.pys.aperturatcv2.microservices.domain;
import com.fasterxml.jackson.annotation.JsonProperty;
public class DatosCliente {
private Cliente cliente;
private ListaIntegranteType integrantes;
public DatosCliente(@JsonProperty("cliente") Cliente cliente,
@JsonProperty("integrantes") ListaInt... |
Markdown | UTF-8 | 5,147 | 2.546875 | 3 | [] | no_license | ---
description: "Recipe of Perfect Red lobster cheddar bay biscuit Finale"
title: "Recipe of Perfect Red lobster cheddar bay biscuit Finale"
slug: 430-recipe-of-perfect-red-lobster-cheddar-bay-biscuit-finale
date: 2020-08-30T15:10:39.597Z
image: https://img-global.cpcdn.com/recipes/5650084866293760/751x532cq70/red-lob... |
Python | UTF-8 | 1,327 | 3.21875 | 3 | [] | no_license | from collections import deque
from discord_bot.discord_interface.config import config
from discord_bot.discord_interface.audioelements.dummy import Dummy
class Playlist:
"""Stores the youtube links of songs to be played and already played and offers basic operation on the queues"""
def __init__(self):
... |
Java | UTF-8 | 394 | 2.84375 | 3 | [] | no_license | package com.freedom.composite;
/**
* 叶子对象,叶子对象不再包含其他对象
*
* @author liuf
* date: 2020-02-05
*/
public class Leaf extends Component {
private String name = "";
/**
* 示意方法,子叶子对象的操作
*/
@Override
public void printStruct(String preStr) {
System.out.println("叶子对象的操作" + preStr);
}
}
|
Java | UTF-8 | 8,061 | 2.328125 | 2 | [
"Apache-2.0"
] | permissive | package net.minestom.server.listener;
import net.minestom.server.MinecraftServer;
import net.minestom.server.data.Data;
import net.minestom.server.entity.Entity;
import net.minestom.server.entity.GameMode;
import net.minestom.server.entity.Player;
import net.minestom.server.event.player.PlayerBlockInteractEvent;
impor... |
Java | UTF-8 | 1,060 | 2 | 2 | [] | no_license | package com.intuit.demo.model;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Data
@Table(name = "Player")
public class Player
{
@Id
@Column
private String playerID;
@Column
private Strin... |
Java | UTF-8 | 786 | 3.203125 | 3 | [] | no_license |
public class PalindromeNumber {
public boolean isPalindrome(int x) {
if(x < 0)
{
return false;
}
int head = x;
int tail;
int count = 0;
while(head >= 10)
{
head = head/10;
count++;
}
while (count >= 1)
... |
C++ | UTF-8 | 929 | 2.734375 | 3 | [] | no_license | int vermelho=8;
int verde=10;
int amarelo=6;
char leitura;
void setup() {
Serial.begin(9600);
pinMode(vermelho,OUTPUT);
pinMode(verde,OUTPUT);
pinMode(amarelo,OUTPUT);
Serial.println("digite uma tecla");
}
void loop() {
if(Serial.available()>0){
leitura=Serial.read();
Serial.print("Tecla digitada => ");... |
Swift | UTF-8 | 1,976 | 3.234375 | 3 | [] | no_license | import UIKit
import HanziPinyin
extension String {
subscript (i: Int) -> Character {
return self[self.index(self.startIndex, offsetBy: i)]
}
subscript (i: Int) -> String {
return String(self[i] as Character)
}
subscript (r: Range<Int>) -> String {
let start = index... |
TypeScript | UTF-8 | 411 | 3.75 | 4 | [
"MIT"
] | permissive | /**
* @category 字符 string
* @function 数字补零操作
* @param {unknown} value 值
* @return {boolean}
* @example
* isString(5) => false
* @example
* isString('111') => true
*/
export function isString(value: unknown): boolean {
const _toString = Object.prototype.toString
const type: string = _toString.call(value).s... |
Markdown | UTF-8 | 4,040 | 2.625 | 3 | [] | no_license | ---
description: "Recipe of Any-night-of-the-week Sundubu Jjigae (Spicy Tofu Stew)"
title: "Recipe of Any-night-of-the-week Sundubu Jjigae (Spicy Tofu Stew)"
slug: 341-recipe-of-any-night-of-the-week-sundubu-jjigae-spicy-tofu-stew
date: 2020-08-09T14:37:33.239Z
image: https://img-global.cpcdn.com/recipes/2620365_de4984... |
Python | UTF-8 | 1,889 | 2.703125 | 3 | [] | no_license | from fonction_reference import reference
import cv2
import time
import numpy as np
nom_fichier = "videos_test/video_rasp_1.avi"
capture = cv2.VideoCapture(nom_fichier)#Ouverture du fichier vidéo
while cv2.waitKey(15)!=27:
debut = time.clock()
has_frame, img_init = capture.read()
if not has_frame:
... |
C++ | UTF-8 | 1,062 | 3.3125 | 3 | [] | no_license | #ifndef Rectangle_HEADER
#define Rectangle_HEADER
/**
* File : Rectangle.h
* Author : Kazune Takahashi
* Created : 8/21/2019, 3:57:01 PM
* Powered by Visual Studio Code
*/
#include <iostream>
#include <string>
#include <sstream>
#include "Shape.h"
#include "TwoDimensional.h"
class Rectangle : public Shape, ... |
Java | UTF-8 | 1,027 | 2.15625 | 2 | [] | no_license | package dionysus.wine.vo;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
public class Customer {
private int customerId;
private String customerRrn;
private String customerAddress;
private String customerName;
private String customerTel;
... |
Markdown | UTF-8 | 1,503 | 3.703125 | 4 | [] | no_license | # TimeWarp
## Time ranges from natural language
TimeWarp makes describing recurring time ranges easy! It has **no external dependencies** and is useful for articulating dates, times, and recurrances for natural language processing.
## Usage
```go
import (
"bytes"
"github.com/takeinitiative/timewarp"
)
func ... |
C++ | UTF-8 | 359 | 2.59375 | 3 | [] | no_license | #ifndef SUBJECT_HPP
#define SUBJECT_HPP
#include <vector>
#include <list>
#include "Observer.hpp"
class Subject
{
//Lets keep a track of all the shops we have observing
std::vector<Observer*> list;
public:
void attach(Observer *product);
void detach(Observer *product);
void notif... |
Java | UTF-8 | 1,163 | 2.140625 | 2 | [] | no_license | package pe.oh29oh29.develogm.controller.main;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import pe.oh29oh29.develogm.model.Post;
import pe.oh29oh29.develogm.model.request.PostReq;
import pe.oh29oh29.de... |
Markdown | UTF-8 | 1,884 | 3.5 | 4 | [] | no_license | # 一、题目
你的任务是计算 a^b 对 1337 取模,a 是一个正整数,b 是一个非常大的正整数且会以数组形式给出。
**示例 1:**
```
输入:a = 2, b = [3]
输出:8
```
**示例 2:**
```
输入:a = 2, b = [1,0]
输出:1024
```
**示例 3:**
```
输入:a = 1, b = [4,3,3,8,5,2]
输出:1
```
**示例 4:**
```
输入:a = 2147483647, b = [2,0,0]
输出:1198
```
**提示:**
- 1 <= a <= 2^31 - 1
- 1 <= b... |
Python | UTF-8 | 2,671 | 4.03125 | 4 | [] | no_license | """Sua organização acaba de contratar um estagiário para trabalhar no Suporte de Informática, com a intenção de fazer
um levantamento nas sucatas encontradas nesta área. A primeira tarefa dele é testar todos os cerca de 200 mouses que
se encontram lá, testando e anotando o estado de cada um deles, para verificar o que ... |
TypeScript | UTF-8 | 509 | 2.640625 | 3 | [
"MIT"
] | permissive | import { ISpecification } from '../specification/specification.interface';
import { IDbSet, IQueryable } from './interfaces';
export type DeepPartial<T> = {
[P in keyof T]?: T[P] extends (infer U)[]
? DeepPartial<U>[]
: T[P] extends ReadonlyArray<infer U2>
? ReadonlyArray<DeepPartial<U2>>
: DeepParti... |
Python | UTF-8 | 393 | 3.5 | 4 | [] | no_license | #!/bin/python
counter = 0
while True:
try:
s = str(input())
o = ''
for i in range(len(s)):
if s[i] == '"':
if counter % 2 == 0:
o += '``'
else:
o += '\'\''
counter += 1
else:
... |
C++ | UTF-8 | 1,237 | 3.609375 | 4 | [] | no_license | #include <stdio.h>
#include <string.h>
#include "Matrix.h"
// macro to access value using ptr to matrix
#define MATRIX_VAL(matrix, row, col) (*((int *)matrix->pMatrix + (row * matrix->num_col) + col))
/*
* Function to print a matrix of any size
*/
void Matrix_print(Matrix_instance_t *matrix) {
int row... |
Go | UTF-8 | 849 | 2.765625 | 3 | [] | no_license | package connectors
import (
)
// define interface for auto-updating of resources. all connectors
// implement the CollectData() function, which ingests a collection
// of BusinessMetadata instances and returns a serious of BusinessUpdate
// items that contain updated business information
//
// Additionally, each con... |
Python | UTF-8 | 712 | 2.90625 | 3 | [] | no_license | import sys
sys.stdin = open('격자판의숫자이어붙이기.txt','r')
def dfs(r, c, num):
if len(num) == 7:
if num not in result:
result.append(num)
return
dr = [1, -1, 0, 0]
dc = [0, 0, 1, -1]
for x in range(4):
nr = r + dr[x]
nc = c + dc[x]
if 0 <= nr < len(arr) an... |
TypeScript | UTF-8 | 2,027 | 2.671875 | 3 | [] | no_license | import * as ws from 'ws';
import * as express from "express";
import {Player, PlayerRegistry} from "../player";
class ConnectionHandler {
playerRegistry: PlayerRegistry;
player?: Player;
socket: ws;
constructor(playerRegistry: PlayerRegistry, socket: ws) {
this.playerRegistry = playerRegistry;... |
Java | UTF-8 | 692 | 1.789063 | 2 | [] | no_license | package org.banyan.gateway.helios.data.jpa.repository.channel;
import org.banyan.gateway.helios.data.jpa.domain.channel.InterfaceConfig;
import org.banyan.gateway.helios.data.jpa.domain.pk.InterfaceConfigPk;
import org.springframework.data.repository.CrudRepository;
import java.util.List;
import java.util.Set;
/**
... |
Markdown | UTF-8 | 2,786 | 3.015625 | 3 | [] | no_license | ###### telegraph_arduino_temboo
#Arduino Telegraph - Code System project from Systems class @CCA

###YouTube Videos
[Final Demo 1](https://youtu.be/Q5agbIDerKQ)
[Final Demo 2](https://youtu.be/oKgJvz0VeJY)
[Early Prototype](https:... |
C# | UTF-8 | 710 | 2.609375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace suma
{
[DesignTimeVisible(false)]
public partial class MainPage : ContentPage
{
public MainPage()
{
In... |
Java | UTF-8 | 4,193 | 2.765625 | 3 | [] | no_license | import java.util.ArrayList;
public class serializeStringToArray {
// Aufgabe unklar - es wird nicht deultlich erklärt, ob nur zeilenweise oder aber auch zeilenübergreifend zu suchen ist. Letzteres ist der Fall (input2 & adjacent2)
public static void main(String[] args) {
int count = 13;
String splitString = "/n";... |
Python | UTF-8 | 3,674 | 3.984375 | 4 | [] | no_license | #!/usr/bin/env python
# 140211 Raoul Meuldijk
# http://en.wikipedia.org/wiki/Mandelbrot_set
def mandel(x0, y0):
""" Iterate the Mandelbrot function, returns the number of
iterations until x^2 + y^2 > 4 or 200 iterations.
"""
x = 0
y = 0
iteration = 0
max_iteration = 200
while ( x*x + y*y <= (2*2) and itera... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.