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 |
|---|---|---|---|---|---|---|---|
JavaScript | UTF-8 | 236 | 3.875 | 4 | [] | no_license | const valores = []
for (var i = 0; i < 10; i++)
{
valores.push(function(){
console.log(i)
})
}
//Quando a função é chamada, o loop já foi executado, e a variável sobrescrita.
valores[2]()
valores[5]()
valores[8]() |
TypeScript | UTF-8 | 275 | 3.484375 | 3 | [
"MIT"
] | permissive | // union types
var values : number | number[];
values = [123, 123908, 132, 231313131312322132123, 123123213,312312]
type int = number;
type float = number;
type long = number;
type double = number;
type stringArray = string[];
type numberArray = number[];
var x = "123";
|
JavaScript | UTF-8 | 2,804 | 4.03125 | 4 | [] | no_license | // Whats your BMI //
// var ericsNewMass = 113.3980925;
// var ericsOldMass = 127.0058636;
// var ericsHeight = 1.9;
// var ericsOldBMI = ericsOldMass / (ericsHeight * ericsHeight);
// var ericsNewBMI = ericsNewMass / (ericsHeight * ericsHeight);
// console.log(ericsOldBMI);
// console.log(ericsNewBMI);
// var isH... |
Java | UTF-8 | 9,853 | 1.828125 | 2 | [] | no_license | /* */ package com.adventnet.appmanager.snapshot.bean;
/* */
/* */ import com.adventnet.appmanager.db.AMConnectionPool;
/* */ import com.adventnet.awolf.data.DatasetProduceException;
/* */ import com.adventnet.awolf.data.DatasetProducer;
/* */ import java.io.Serializable;
/* */ import java.s... |
Markdown | UTF-8 | 844 | 3.390625 | 3 | [] | no_license | # helpers.js
A collection of small JavaScript helper functions for various use cases. All of these little snippets solve problems that are very common, but don't have a widespread decent implementation.
---
__baseURL__
Grabs only the base of any given URL. You can also hide the TLD.
```js
baseURL('http://www.maxvo... |
C# | UTF-8 | 1,198 | 3.859375 | 4 | [] | no_license | using System;
namespace HexadecimalToDecimal
{
class HexadecimalToDecimal
{
static void Main()
{
Console.Write("Hexadecimal = ");
string hex = Console.ReadLine();
long result = 0;
for (int i = 0, j = 0, k=hex.Length-1; i < hex.Length; i++,k--)
... |
C++ | UTF-8 | 899 | 3.265625 | 3 | [] | no_license | #include "Point.h"
Point::Point(const Point & pt)
{
*this=pt;
}
Point& Point::operator=(const Point & pt)
{
_x=pt._x;
_y=pt._y;
num=pt.num;
return *this;
}
const int Point::get_num(void) const
{
return num;
}
const double Point::get_x(void) const
{
return _x;
}
const double Point::get_y... |
JavaScript | UTF-8 | 2,084 | 2.84375 | 3 | [] | no_license | "use strict"
let cu_name_input = document.getElementById("cu_name");
let cu_abbrev_input = document.getElementById("cu_abbrev");
let cu_page_input = document.getElementById("cu_page");
let add_info_input = document.getElementById("additional_info");
let sub_btn = document.getElementById('sub_btn');
function validate... |
Python | UTF-8 | 918 | 2.671875 | 3 | [] | no_license | import requests
import json
import random
from PIL import Image
import os
#minecraft block data
mc_resp = requests.get('http://minecraft-ids.grahamedgecombe.com/items.json')
block_data = json.loads(mc_resp.text)
print(block_data)
for icon in os.listdir('items'):
pass
image = Image.open('items/17-1.png')
rgb_im =... |
JavaScript | UTF-8 | 452 | 3.421875 | 3 | [] | no_license | /**
* @param {string} s
* @return {string[]}
*/
var findRepeatedDnaSequences = function (s) {
if (s.length <= 10) {
return [];
}
var arr = new Set();
var i = 0;
var strings = {};
while (i <= s.length - 10) {
const target = s.substr(i, 10);
if (strings[target]) {
arr.add(target);
} ... |
C++ | UTF-8 | 24,408 | 2.703125 | 3 | [] | no_license | #include "Parser.h"
Parser::Parser(std::ostream& _errorStream) : errorStream(_errorStream) {};
std::pair<ParseEnum::EResult, std::map<std::string, Airport*> > Parser::parseFile(const char* fileName) {
TiXmlDocument xmlFile;
std::map<std::string, Airport*> allAirports;
if (!xmlFile.LoadFile(fileName)) {
... |
C# | UTF-8 | 2,016 | 2.890625 | 3 | [] | no_license | using Chambers.Partners.Domain.Factories;
using Chambers.Partners.Domain.Providers;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Chambers.Partners.Domain.Services
{
public class GameService : IGameService
{
private IGameFactory _factory;
private ... |
Ruby | UTF-8 | 628 | 3.140625 | 3 | [] | no_license | #---
# Excerpted from "Programming Ruby",
# published by The Pragmatic Bookshelf.
# Copyrights apply to this code. It may not be used to create training material,
# courses, books, articles, and the like. Contact us if you are in doubt.
# We make no guarantees that this code is fit for any purpose.
# Visit http://www... |
C++ | UTF-8 | 4,006 | 3.03125 | 3 | [] | no_license | /*
* File: parser.cpp
* Author: wutingyi
*
* Created on September 27, 2016, 1:29 PM
*/
#include <cstdlib>
#include <iostream>
#include <sstream>
#include <string>
#include <typeinfo>
#include <iomanip>
#include <cstring>
#include <fstream>
#include "Rparser.hpp"
#include "Node.hpp"
#include "Resistor.hpp"
usi... |
C | UTF-8 | 166 | 2.765625 | 3 | [] | no_license | #include<stdio.h>
#include<conio.h>
void main()
{
int input1,input2;
scanf("%d%d",&input1,&input2);
for(i=input1;i<input2;i++)
{
if(i%2!=0)
{
printf("\t%d",i);
}
}
}
|
Java | UTF-8 | 16,898 | 2.140625 | 2 | [] | no_license | /**
*
*/
package controllers.vm;
import helpervm.OfferingHelper;
import helpervm.VMHelper;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Concurren... |
Java | UTF-8 | 1,948 | 2.4375 | 2 | [] | no_license | package com.city.oa.controller;
import com.city.oa.dto.CommonResult;
import com.city.oa.model.Photo;
import com.city.oa.service.PhotoService;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServle... |
Java | UTF-8 | 582 | 1.84375 | 2 | [] | no_license | package session1;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
public class searchingELement {
public static void main(String[] args) throws InterruptedException {
// TODO Auto-generated method stub
System.setProperty("webdriver.ch... |
Markdown | UTF-8 | 11,230 | 3.125 | 3 | [] | no_license | 
> 天街小雨润如酥,草色遥看近却无。最是一年春好处,绝胜烟柳满皇都。 —— 唐.韩愈 《早春呈水部张十八员外二首》
### 引子
几个月之前,chunpu小编曾经在《[震惊! 滑动验证码竟然能这样破解](https://mp.weixin.qq.com/s/NDIEaAhMHdrC3l9DV8z00g)》一文中给大家展示了使用支持WebDriver标准的Firefox破解滑动验证码的示例,脑洞之大,构思之巧,笔法幽默,叹为观止,也极大的燃起了笔者对此的兴趣。
这篇文章就带大家使用目前较为流行的Puppeteer完成这件... |
C# | UTF-8 | 843 | 2.53125 | 3 | [
"MIT"
] | permissive | namespace SassSharp.Model.Nodes
{
internal class MixinNode : ScopeNode
{
private readonly VariableNode[] _args;
public MixinNode(string name, VariableNode[] args)
{
Name = name;
_args = args;
}
public string Name { get; set; }
public v... |
Python | UTF-8 | 676 | 3.5625 | 4 | [
"MIT"
] | permissive | ''' Scraped from http://quotes.toscrape.com '''
from bs4 import BeautifulSoup
import requests
URL = 'http://quotes.toscrape.com/page/'
i = 1
def get_soup(url):
res = requests.get(url)
soup = BeautifulSoup(res.text,'lxml')
return soup
def quotes(soup):
global i
all_quotes = soup.find_all('div',{'class':'quote'}... |
PHP | UTF-8 | 849 | 2.875 | 3 | [] | no_license | <?php
namespace srag\CustomInputGUIs\Certificate\LearningProgressPie;
/**
* Class CountLearningProgressPie
*
* @package srag\CustomInputGUIs\Certificate\LearningProgressPie
*
* @author studer + raimann ag - Team Custom 1 <support-custom1@studer-raimann.ch>
*/
class CountLearningProgressPie extends AbstractLear... |
Java | UTF-8 | 986 | 2.09375 | 2 | [] | no_license | package net.slipp.controller;
import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.spring... |
JavaScript | UTF-8 | 356 | 3.5 | 4 | [] | no_license | for (let i = 0; i < 99; i++){
console.log("counting up to 99")
}
for (let i = 99; i >= 0; i--){
console.log("counting down from 99")
}
for (let i = 0; i < 98; i += 2){
console.log("even ascending")
}
for (let i = 98; i >= 0; i -= 2){
console.log("even descending")
}
for (let i = 99; i >= 0; i -= 2){... |
Swift | UTF-8 | 1,574 | 3.265625 | 3 | [] | no_license | //
// DesignCodeNeumorphism.swift
// learn_Neumorphism_SwiftUI
//
// Created by Ashish Tyagi on 04/09/20.
// Copyright © 2020 Ashish Tyagi. All rights reserved.
//
import SwiftUI
let color = Color(red: 232/255, green: 238/255, blue: 246/255)
struct DesignCodeNeumorphism: View {
var body: some View {
G... |
JavaScript | UTF-8 | 2,964 | 3 | 3 | [] | no_license | import React, { Component } from 'react';
import axios from 'axios';
import { FormGroup, ControlLabel, FormControl, Button } from 'react-bootstrap';
export default class GivePoints extends Component {
constructor(props) {
super(props);
//bind this context
this.givePoints = this.givePoints.bind(this);
... |
Java | UTF-8 | 1,523 | 2.609375 | 3 | [] | no_license | package com.company;
public class Creature {
public int getHitpoints() {
return hitpoints;
}
public void setHitpoints(int hitpoints) {
this.hitpoints = hitpoints;
}
public int getStrength() {
return strength;
}
public void setStrength(int st... |
Markdown | UTF-8 | 2,544 | 2.703125 | 3 | [] | no_license |
# Exercise 4.4.2 Explore the dataset with Tableau
Start Tableau

In "Connect To a Server" select "PostgreSQL":

In the connection dialog, specify **publicisglobalemeaptrsd.platform-query... |
Python | UTF-8 | 2,382 | 3.109375 | 3 | [
"Python-2.0",
"BSD-2-Clause",
"MIT",
"BSD-3-Clause"
] | permissive | from pcc.AST.compiled_object import CompiledObjectType, CompiledObject
from pcc.AST.statement import Statement
from pcc.AST.expression import Expression
class CompoundStatement(Statement):
def __init__(self, depth):
super(CompoundStatement, self).__init__(depth)
def __str__(self):
string = s... |
Python | UTF-8 | 530 | 2.578125 | 3 | [] | no_license | from flask import Flask, render_template
import time, json, threading
app = Flask(__name__)
alive = 0
data = {}
@app.route("/")
def index():
return render_template("index.html")
@app.route("/keep_alive", methods=["GET"])
def keep_alive():
global alive, data
alive += 1
keep_alive_count = str(ali... |
Markdown | UTF-8 | 3,800 | 2.859375 | 3 | [
"BSD-3-Clause"
] | permissive | # Stalis Stream Service
[](https://goreportcard.com/report/github.com/Stalis/sittme-test-excercise)
## Описание
SSS - заготовка микросервиса, предназначенного для потоковых трансляций данных на любые устройства и сервисы
## Запус... |
SQL | UTF-8 | 1,050 | 3.078125 | 3 | [] | no_license | DROP TABLE IF EXISTS `sf_comment`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sf_comment` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`commentable_model` varchar(30) DEFAULT NULL,
`commentable_id` int(11) DEFAULT NULL,
`comment_namespace... |
Java | UTF-8 | 1,532 | 1.84375 | 2 | [] | no_license | package com.mydataway.demo1;
import com.mydataway.utils.SpringContextHolder;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.boot.web.ser... |
C++ | UTF-8 | 1,627 | 3.4375 | 3 | [] | no_license | #include "IOManager.h"
IOManager::IOManager()
{
}
IOManager::~IOManager()
{
}
/*************************************************
The write function is used to write the log
information to the output file. The parameters are
a string, which is the log information, and the
path of the output file.
********************... |
Markdown | UTF-8 | 3,578 | 2.53125 | 3 | [] | no_license | SerialDV
========
**Warning**
Since kernel 4.4.52 the default for FTDI devices (that is in the ftdi_sio kernel module) is not to set it as low latency. This results in the ThumbDV dongle not working anymore because its response is too slow to sustain the normal AMBE packets flow. The solution is to force low latency ... |
Java | UTF-8 | 1,096 | 2.734375 | 3 | [] | no_license | package ladder;
import ladder.domain.LadderCompensation;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
import static org.assertj.core.api.Assertions.assertThat;
import static org.ass... |
Java | UTF-8 | 17,161 | 2.390625 | 2 | [] | no_license | package net.markmakinen.duckclient;
import android.app.DatePickerDialog;
import android.app.TimePickerDialog;
import android.content.DialogInterface;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v4.widget.SwipeRefreshLayout;
import and... |
PHP | UTF-8 | 3,096 | 2.703125 | 3 | [
"MIT"
] | permissive | <?php
namespace Devlabs91\GenericOtaHotelApiService\EnumType;
/**
* This class stands for GlobalIndicatorType EnumType
* Meta informations extracted from the WSDL
* - documentation: Specifies the global travel area.
* @subpackage Enumerations
*/
class GlobalIndicatorType
{
/**
* Constant for value 'AP'
... |
Java | UTF-8 | 2,034 | 2.34375 | 2 | [] | no_license | package com.example.restaurant.controllers;
import javax.ws.rs.PathParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.we... |
Markdown | UTF-8 | 1,741 | 2.578125 | 3 | [] | no_license | ## iOS Music App - Get music of your mood
This is a iOS Music App written in Swift 2.0. It returns a list of songs depending on user's mood.
This app is built with MVVM architectural pattern.
## Screenshots

## Descriptions
-... |
Java | UTF-8 | 1,322 | 2.125 | 2 | [] | no_license | package com.example.dimitare.ridecelldemo.utils;
import android.annotation.SuppressLint;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import com.example.dimitare.ridecelldemo.ViewMod... |
Markdown | UTF-8 | 1,938 | 3.3125 | 3 | [] | no_license | # 幂等性是什么意思
[参考文章](https://www.cnblogs.com/javalyy/p/8882144.html)
>HTTP/1.1中对幂等性的定义是:一次和多次请求某一个资源对于资源本身应该具有同样的结果(网络超时等问题除外)。也就是说,其任意多次执行对资源本身所产生的影响均与一次执行的影响相同。
简单来说,就是每次调用服务,同一方法不管重复操作同一资源多少次,产生的结果应该是相同的,比如删除一条记录,同一用户不管重复请求多少次,服务端应该都只进行过一次删除操作
## 常见场景
支付、分布式等场景,比如对一份订单的支付操作,用户短时间重复发起几次支付订单的操作,服务端支付的结果都是一样的,只会进行一次支付。分... |
Java | UTF-8 | 192 | 1.664063 | 2 | [] | no_license | package javaPropertiesFile;
public class Run {
public static void main(String[] args)
{
String data = JProperties.getProData("password");
System.out.println(data);
}
}
|
Java | UTF-8 | 895 | 2.515625 | 3 | [] | no_license | package ec.edu.epn.Project;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;
public class NeuronalRedTest {
private NeuronalRed neuronalRed;
@Before
public void SetUpNeuronalRed() {
System.out.println("Set up Red Neuronal");
... |
Java | UTF-8 | 1,573 | 3.34375 | 3 | [] | no_license | package com.javarush.test.level18.lesson10.home04;
/* Объединение файлов
Считать с консоли 2 имени файла
В начало первого файла записать содержимое второго файла так, чтобы получилось объединение файлов
Закрыть потоки. Не использовать try-with-resources
*/
/*
c:\11.txt
c:\2.txt
c:\3.txt
*/
import java.io.*;
public c... |
Java | UTF-8 | 15,294 | 1.835938 | 2 | [] | no_license | package com.yongyida.robot.hardware.test.item.led;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import ... |
Go | UTF-8 | 1,242 | 2.953125 | 3 | [] | no_license | package ingestion
import (
"io"
"net/http"
"testing"
"github.com/stretchr/testify/assert"
)
func Test_jobService_Retrieve(t *testing.T) {
setup()
defer teardown()
test := struct {
wantJobs []Job
wantErr bool
}{
wantJobs: []Job{
Job{
ID: 146859,
Name: "Auror",
Status: "open",
... |
Java | UTF-8 | 423 | 2.796875 | 3 | [] | no_license | package rlnitsua.array;
import java.util.ArrayList;
import java.util.List;
public class DestinationCity {
public String destCity(List<List<String>> paths) {
List<String> list = new ArrayList<>();
for (List<String> path : paths) {
list.add(path.get(1));
}
for (List<Strin... |
C# | UTF-8 | 2,300 | 3.4375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace _06StoreBoxes
{
class Program
{
static void Main(string[] args)
{
List<Box> boxes = new List<Box>();
double totalPrice = 0.00;
while (t... |
Markdown | UTF-8 | 1,670 | 3.015625 | 3 | [] | no_license | # zkp_gui

## Приклад виконання протоколу ZK EC:
Нехай
`Е751(–1, 188)`;
`G` = (1, 375);
`Q` = (2, 373);
`р` = 751,
що відповідає кривій `у^2 = х^3 – х + 188`.
Припустимо, що користувач А вибирає секретні ключ... |
C++ | UTF-8 | 20,139 | 3.21875 | 3 | [] | no_license | /*
Assignment: Project #4
Author: Matthew Bierman
Course: CS 2336.004 (Computer Science II)
Instructor: Mr. Jason Smith
Date Due: November 16, 2016 at 11:59pm
//TRIG FUNCTIONS
*/
#include <fstream>
#include <sstream>
#include <string>
#include <stdlib.h>
#include <cmath... |
Python | UTF-8 | 2,793 | 2.640625 | 3 | [] | no_license | # -*- coding:utf-8 -*-
import jieba.analyse
from SubmarketMerge.tools.utils import load, dump, clear_brand, read
from SubmarketMerge.component.readData import *
class CutMethod(object):
"""Cut Method"""
def __init__(self):
"""Init"""
def cut(self):
"""Cut Function"""
raise NotIm... |
Shell | UTF-8 | 942 | 2.984375 | 3 | [
"MIT"
] | permissive | remote_url=$(git remote get-url origin)
repo_name=$(basename -s .git $remote_url)
repo_path=$(dirname $remote_url)
author_handle=${repo_path##*:}
author_handle=${author_handle##*/}
executable_name=$(echo $repo_name | perl -pe 's/(^|-|_| |%20)(\w)/uc($2)/ge' )
author_name=$(git config user.name)
author_email=$(git confi... |
Python | UTF-8 | 701 | 3.828125 | 4 | [
"MIT"
] | permissive | def pot(x, n):
if (n == 0):
return(1)
if (n == 1):
return(x)
if (n % 2 == 0):
half = pot(x, n / 2)
return(half * half)
else:
half = pot(x, (n - 1) / 2)
return(half * half * x)
x, n = map(int, input().split())
print(pot(x, n))
def compare(x... |
Python | UTF-8 | 548 | 2.859375 | 3 | [] | no_license | #!/usr/bin/env python
# ========= Import required modules =====================
# for using system commands
import sys
# for using os commands like list directeries etc
import os
# for mathematical functions specially matriices
import numpy as np
# for general maths
from math import *
ans = 0
for i in range(10000... |
C | UTF-8 | 2,989 | 3.046875 | 3 | [] | no_license | #include <stm32f4xx.h>
/*
* @tasks Set SYSCLK 1/2 of maximal
* Flash LEDs from 1 to 3 in endless loop
* On button press change SYSCLK source from HSE to HSI and back
*/
#define SWITCH_DELAY ((uint32_t)2000000)
typedef enum blink_mul_e {
BLINK_MUL_FAST = 1,
BLINK_MUL_LONG = 3,
... |
TypeScript | UTF-8 | 635 | 2.71875 | 3 | [] | no_license | import { ActionTypes } from "./types";
import firebase from "firebase";
export interface Item {
id: string;
title: string;
image: string;
price: number;
rating: number;
}
interface AddToBasketAction {
type: ActionTypes.ADD_TO_BASKET;
payload: Item;
}
interface RemoveFromBasketAction {
type: ActionTyp... |
Java | UTF-8 | 108 | 1.6875 | 2 | [] | no_license | package com.ustglobal.atmmachine;
public class machine {
void slot(ATM a) {
a.card();
a.info();
}
}
|
Java | UTF-8 | 3,665 | 2.6875 | 3 | [] | no_license | package uk.co.gossfunkel.citadel.net;
import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.SocketException;
import java.net.UnknownHostException;
import uk.co.gossfunkel.citadel.Game;
import uk.co.gossfunkel.citadel.entity.m... |
C# | UTF-8 | 164 | 2.53125 | 3 | [] | no_license | namespace AutofacPresentation
{
public class BadSpeaker : ISpeaker
{
public string Say()
{
return @"Bye:\";
}
}
} |
Python | UTF-8 | 3,227 | 2.703125 | 3 | [] | no_license | import requests
import json
from webdriver_manager.chrome import ChromeDriverManager
from bs4 import BeautifulSoup as bs
from splinter import Browser
import pandas as pd
import os
import time
import pymongo
def init_browser():
executable_path = {'executable_path' : '/usr/local/bin/chromedriver'}
return Brow... |
C++ | UTF-8 | 2,087 | 3 | 3 | [
"BSL-1.0"
] | permissive | #ifndef NEOPIXEL_UNO_HPP
#define NEOPIXEL_UNO_HPP
#include "hwlib.hpp"
#include "neopixel.hpp"
/// @file
/// \brief
/// implementations for Adafruit ws2812 for Arduino Uno
/// \details
/// This class is an implemtation of the abstract neopixel class
///
/// This implementation can be used for the Arduino Uno
///
//... |
Java | UTF-8 | 1,186 | 2.09375 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright (C) allesklar.com AG
* All rights reserved.
*
* Author: juergi
* Date: 09.06.12
*
*/
package com.jmelzer.data.model.ui;
import com.jmelzer.data.model.ModelBase;
import javax.persistence.*;
import java.util.ArrayList;
import java.util.List;
@Entity
@Table(name = "view")
public c... |
Go | UTF-8 | 667 | 3.265625 | 3 | [
"MIT"
] | permissive | package main
import "testing"
func TestMostCommonWord(t *testing.T) {
tcs := []struct {
inParagraph string
inBanned []string
out string
}{
{"Bob hit a ball, the hit BALL flew far after it was hit.", []string{"hit"}, "ball"},
{"a", []string{""}, "a"},
{"a b a", []string{""}, "a"},
{"a b a",... |
PHP | UTF-8 | 979 | 2.59375 | 3 | [
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-proprietary-license",
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | <?php
namespace Kirby\Panel\Collections;
use Exception;
use Kirby\Panel\Event;
use Kirby\Panel\Models\User;
class Users extends \Users {
public function __construct() {
parent::__construct();
$this->map(function($user) {
return new User($user->username());
});
}
public function topbar(... |
Java | UTF-8 | 1,716 | 1.929688 | 2 | [] | no_license |
package com.teratech.achat.jaxrs.ifaces.operations;
import com.megatimgroup.generic.jax.rs.layer.ifaces.GenericService;
import com.teratech.achat.model.operations.DemandePrix;
import com.teratech.achat.model.operations.ReponseFournisseur;
import java.util.List;
import javax.ws.rs.Consumes;
import javax.ws.rs.PUT;
imp... |
Markdown | UTF-8 | 778 | 2.6875 | 3 | [] | no_license | # Yape
## Proyecto final Sprint5
Yape es la nueva aplicación del Banco de Crédito del Perú, con la que tendrás la libertad de usar tu dinero como quieras, ya que pagar con ella es más rápido, sin pretextos y fácil. Solo con Yape podrás convertir tus planes en experiencias únicas, sin números de cuenta ni token.
## Req... |
C# | UTF-8 | 1,987 | 3.125 | 3 | [
"MIT"
] | permissive | namespace _1.Logger.Core
{
using _1.Logger.Factories;
using _1.Logger.Interfaces;
using System;
public class Controller
{
private FactoryAppender factoryAppender;
public Controller()
{
this.factoryAppender = new FactoryAppender();
}
public void... |
Java | UTF-8 | 1,529 | 2.3125 | 2 | [] | no_license | package com.example.rabbtmq.parent.consumer;
import com.example.rabbtmq.parent.common.TagConstant;
import com.example.rabbtmq.parent.provider.ChannelUtil;
import com.rabbitmq.client.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springfr... |
Go | UTF-8 | 9,952 | 2.546875 | 3 | [
"MIT"
] | permissive | package spider
import (
"database/sql"
"github.com/esrrhs/go-engine/src/loggo"
_ "github.com/mattn/go-sqlite3"
"net/url"
"sync"
"time"
)
type DB struct {
gdb *sql.DB
lock sync.Mutex
gInsertStmt *sql.Stmt
gSizeStmt *sql.Stmt
gLastStmt *sql.Stmt
gFindStmt *sql.Stmt
gDeleteStmt *sql.Stm... |
Java | UTF-8 | 823 | 1.9375 | 2 | [] | no_license | package com.eat.better.service;
import java.util.List;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import com.eat.better.entity.User;
import com.eat.better.service.dto.user.UserDTOGet;
import com.eat.better.service.dto.user.UserDTOPost;
import com.eat.bette... |
TypeScript | UTF-8 | 537 | 2.75 | 3 | [] | no_license | import {Request} from 'express';
/**
* Custom request object that includes body and session objects unlike native express Request
* @author Jānis Radiņš
*/
export interface CustomRequest extends Request {
/**
* Once body-parser is added there's body property in request but no signature of it in incoming Req... |
C++ | UTF-8 | 1,581 | 3.046875 | 3 | [] | no_license | #ifndef __TIME_SERIES_MOD_H__
#define __TIME_SERIES_MOD_H__
#include <vector>
#include <algorithm> // std::find_if
#include <math.h>
class TimeSeriesMod
{
protected:
struct Tpv{
Tpv() = delete;
Tpv(double _t, double _pRes, double _pSys, double _pO2, double _lvol,
bool _valveA, bool... |
C++ | UTF-8 | 2,801 | 2.875 | 3 | [
"BSD-2-Clause"
] | permissive | /**
* Copyleft (c) 2014
* @Author: Ke, Xianda
* @Date: 2014-08-31
*
* implement a stl::vector like container: xtl:vetcor
*
*
*
* */
/**
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is... |
Java | UTF-8 | 673 | 3.53125 | 4 | [] | no_license | package Collection;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class ListConcept
{
public static void main(String[] args)
{
/*List<String> list=new ArrayList<>();
list.add("amrit");
list.add("samar");
list.add("preeti");
Iterator iterator=list.... |
Python | UTF-8 | 832 | 3.375 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Fri Dec 13 20:18:35 2019
@author: Arnab Das
"""
import numpy as np
x1n = [1,2,3,4]
x2n = [5,6,7,8]
xn = x1n + np.multiply(1j,x2n)
print("xn: "+str(xn))
"""DFT """
N = len(xn)
dft = []
for k in range(N):
mult = 0
mult1 = 0
for n in range(N):
... |
Python | UTF-8 | 1,416 | 3.09375 | 3 | [] | no_license | from unionfind import UnionFind as uf
import sys
import random as r
class Percolation:
def __init__(self, n):
self.grid= [[0 for i in range(n)] for j in range(n)]
self.u = uf(n**2)
def showGrid(self):
for i in range(len(self.grid)):
print(self.grid[i])
... |
Java | UTF-8 | 776 | 2.390625 | 2 | [] | no_license | package com.apifest.oauth20;
import org.codehaus.jackson.annotate.JsonProperty;
import org.codehaus.jackson.annotate.JsonUnwrapped;
import org.codehaus.jackson.map.annotate.JsonSerialize;
import org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion;
/**
* Access token decorated with the CSRF state attribute.
*
... |
Java | UTF-8 | 511 | 2.046875 | 2 | [] | no_license | package com.hank.library.util;
import rx.Subscriber;
public abstract class HttpSubscriber<T> extends Subscriber<T> {
@Override
public void onCompleted() {
_complete();
}
@Override
public void onError(Throwable e) {
_complete();
onError(e.getMessage());
}
@Overrid... |
C | UTF-8 | 332 | 3.53125 | 4 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
#include<ctype.h>
#include<math.h>
int main(){
double a,b,c,t;
printf("Digite os lados dos triangulo \n");
scanf("%lf, %lf", &a,&b);
printf("Digite o valor do angulo \n");
scanf("%lf", &t);
c=sqrt(pow(b,2)+pow(a,2)-2*a*b*cos(t));
printf("O terceiro lado e = %lf \n", c);
return EXIT... |
Python | UTF-8 | 589 | 2.828125 | 3 | [] | no_license | import pyaudio
import numpy as np
CHUNK = 2**11
RATE = 44100
p=pyaudio.PyAudio()
stream=p.open(format=pyaudio.paInt16,channels=1,rate=RATE,input=True,
frames_per_buffer=CHUNK)
while 1: #go for a few seconds
data = np.fromstring(stream.read(CHUNK),dtype=np.int16)
peak=np.average(np.abs... |
Java | UTF-8 | 3,960 | 2.71875 | 3 | [] | no_license | package com.jpmc.tutorial.service.impl.calculators;
import com.jpmc.tutorial.exception.SimpleStockException;
import com.jpmc.tutorial.exception.StockPriceCalculationException;
import com.jpmc.tutorial.model.Side;
import com.jpmc.tutorial.model.Stock;
import com.jpmc.tutorial.model.StockType;
import com.jpmc.tutorial.m... |
JavaScript | UTF-8 | 633 | 2.5625 | 3 | [] | no_license | import { useDispatch } from 'react-redux';
import { decrement, increment } from './redux/ducks/counter';
const Counter = () => {
//const [count, setCount] = useState(3);
const dispatch= useDispatch();
const handleIncrement=()=>{
dispatch(increment());
}
const handleDecrement =() =>{... |
Java | UTF-8 | 351 | 1.796875 | 2 | [
"Apache-2.0"
] | permissive | package com.example.daniel.thesis_v10;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class hardGameActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layou... |
PHP | UTF-8 | 781 | 3 | 3 | [] | no_license | <?php
interface Zwas_Cache_Interface {
/**
* Save data in cache
*
* @param string $id Access key for storing/fetching data
* @param mixed $data Data to cache
* @param integer $ttl Time to leave (seconeds)
* @return boolean true if data stored succesfully, otherwise false
*/
public function store(... |
Python | UTF-8 | 960 | 4.1875 | 4 | [
"MIT"
] | permissive | def mult(x, y):
result_mult = 0
i = 0
while i < y: # Here I choose 'y' (witch is the base) to show how many times 'x' going to be sum with itself.
i += 1
result_mult += x
return result_mult
def expo():
base = int(input("Type a base: "))
expo = int(input("Type an exponen... |
Markdown | UTF-8 | 436 | 3.75 | 4 | [] | no_license | # ReversibleNumbers
Some positive integers n have the poperty that the sum [n + reverse(n)] consists entirely of odd (decimal) digits. For instance, 36 + 63 = 99 and 409 + 904 = 1313. We will call such numbers reversible; so 36, 63, 409 and 904 are reversible. Leading zeros are not allowed in either n or reverse(n).
... |
JavaScript | UTF-8 | 875 | 2.765625 | 3 | [
"MIT"
] | permissive | function check() {
var flexbox = false;
var x = document.createElement('div');
x.style.display = 'box';
if (x.style.display == 'box') flexbox = true;
x.style.display = '-webkit-box';
if (x.style.display == '-webkit-box') flexbox = true;
x.style.display = '-moz-box';
if (x.style.d... |
C# | ISO-8859-1 | 16,352 | 2.59375 | 3 | [
"Apache-2.0"
] | permissive | using System;
using System.Collections;
using System.Text;
namespace BoletoNet
{
#region Enumerado
public enum EnumCarteiras_Itau
{
EscritualEletronicaSimples = 112,
EscritualEletronicaSimplesNossoNumeroLivre = 115,
EscritualEletronicaCarne = 104,
EscritualEletronicaDolar ... |
Shell | UTF-8 | 1,296 | 3.21875 | 3 | [
"BSD-3-Clause"
] | permissive | #!/bin/bash
# Copyright 2019 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# To check for violations:
# $ ./tools/clippy
#
# To fix violations where possible:
# $ ./tools/clippy --fix
set -e
cd "$(dirname $0)/.."
# ... |
Python | UTF-8 | 150 | 2.859375 | 3 | [] | no_license | n = int(input())
a = list(map(int, input().split(" ")))
kisuu = 1
kake = 1
for i in a:
kake *= 3
if i % 2 == 0:
kisuu *= 2
print(kake - kisuu) |
C++ | UTF-8 | 1,525 | 2.9375 | 3 | [
"MIT"
] | permissive | // Water Drop FX for Neopixel Strips
// This is the water drop effect written in C and included in an Arduino script.
// Notes: This won't run on a ATTiny85 for over 50 pixels (it runs out of memory as each pixel takes 3 bytes).
// Include the Adafruit NeoPixel Library
#include <Adafruit_NeoPixel.h>
// Include the wa... |
C++ | UTF-8 | 2,546 | 3.34375 | 3 | [] | no_license | #pragma once
#include "vector.hpp"
namespace math
{
template <typename T, std::size_t COLS, std::size_t ROWS>
class base_matrix
{
public:
constexpr static std::size_t columns() { return COLS; }
constexpr static std::size_t rows() { return ROWS; }
constexpr static base_matrix<T, COLS, ROWS> uniform_scale(c... |
C# | UTF-8 | 1,390 | 3.140625 | 3 | [] | no_license | using System.IO;
namespace RawParserUWP.Model.Format.Reader
{
class MemoryBufferedStream : BinaryReader
{
byte[] _buffer;
long _bufferSize;
long _bufferPosition;
public MemoryBufferedStream(Stream s, long b) : base(s)
{
_bufferSize = b;
_buffer... |
JavaScript | UTF-8 | 3,916 | 3.40625 | 3 | [] | no_license | var input = document.getElementById('input');
var question_list = Array();
var idx_list = Array();
const previous_btn = document.querySelector('.previous-btn');
const next_btn = document.querySelector('.next-btn');
const question = document.querySelector('.questions');
const second = document.querySelector('.second');... |
Java | UTF-8 | 3,256 | 2.34375 | 2 | [] | no_license | package com.skilldistillery.caravan.controllers;
import java.security.Principal;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigi... |
Python | UTF-8 | 1,405 | 3.140625 | 3 | [] | no_license | # """
# Author: Michael Gardner
# Date: 12/15/16
# Advent of Code
# adventofcode.com
# problem 1
# """
import hashlib
def md5(string):
m= hashlib.md5(string).hexdigest()
#print m
return m
class comparer(object):
'''
remembers self.n
__call__() allows the class instance to be called as a funct... |
Markdown | UTF-8 | 16,672 | 2.5625 | 3 | [] | no_license | # Zookeeper学习
参考:
[几句话了解Zookeeper工作原理](https://mp.weixin.qq.com/s?__biz=MzI0MDQ4MTM5NQ==&mid=2247486974&idx=1&sn=4fac86401700b11970a194cbd5ccaabb&chksm=e91b68e2de6ce1f4e5c29bdcd1a026563c5dcd6b1f36cee4ec1b0c3e045ece81925e53a465a1&scene=0#rd)
[ZooKeeper概念](https://mp.weixin.qq.com/s?__biz=MjM5ODI5Njc2MA==&mid=2655818... |
Java | UTF-8 | 1,578 | 1.929688 | 2 | [] | no_license | package org.mediawiki.pages;
import org.mediawiki.utilities.Driver;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;
import org.openqa.selenium.support.ui.Expect... |
Python | UTF-8 | 2,651 | 2.671875 | 3 | [] | no_license | # coding = utf-8
"""
云教学教师端布置作业功能
作者:郭伟伟
日期:20191112
"""
from selenium import webdriver
import time
browser = webdriver.Firefox()
browser.get("http://hd.ruizhiedu.com:8888/pallasa_cloudteach/teacher/index/index")
browser.maximize_window() # 将浏览器最大化显示
browser.find_element_by_id("username").send_keys("01019992gww")... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.