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 | 1,298 | 2.578125 | 3 | [] | no_license | const mongoose = require('mongoose');
mongoose.Promise = require('bluebird');
const Schema = mongoose.Schema;
const TaskSchema = new Schema(
{
name: {
type: String,
maxlength: 36,
required: [true, 'Task name cannot be blank.']
},
description: {
type: String,
maxlength: 160,
... |
Java | UTF-8 | 766 | 2.296875 | 2 | [] | no_license | package ru.solomatin.xmltask;
import android.app.Application;
import ru.solomatin.xmltask.Dependency.DaggerNetworkComponent;
import ru.solomatin.xmltask.Dependency.NetworkComponent;
import ru.solomatin.xmltask.Dependency.NetworkModule;
/**
* Application. Инициализируем и храним здесь DaggerNetworkComponent
*/
publ... |
JavaScript | UTF-8 | 803 | 2.546875 | 3 | [] | no_license | var db = require("../models");
module.exports = function (app) {
// Load index page
app.get("/", function(req, res){
res.render("index");
})
// Load workshop page
app.get("/workshop", function(req, res){
res.render("workshop")
})
// Load chapter page
app.get("/chapter", function(req, res)... |
Java | UTF-8 | 333 | 2.0625 | 2 | [] | no_license | package com.promise.apps.server.model;
import lombok.Data;
/**
* The basic information about a server. It should be able to be used to distinguish servers.
*/
@Data
public class ServerBasicInfo {
public AssetInfo assetInfo;
public String type;
public ServerBasicInfo() {
assetInfo = new AssetInf... |
Python | UTF-8 | 646 | 3.5625 | 4 | [] | no_license | class Day:
def __init__(self, date="", day="", technician_id=""):
self.date = date
self.day = self.day_of_the_week(day)
self.technician_id = technician_id
def day_of_the_week(self, day):
days = {
0: "Δε",
1: "Τρ",
2: "Τε",
3: "Πε",... |
C | UTF-8 | 2,769 | 3.265625 | 3 | [
"MIT"
] | permissive | #ifndef MATRIZ_VECTOR_H
#define MATRIZ_VECTOR_H
#include <stdio.h>
#include <math.h>
#include "memo.h"
/*
Esta librería contiene muchas operaciones básicas que
se realizan con matrices y vectores
*/
#define max(a, b) \
({ __typeof__ (a) _a = (a); \
__typeof__ (b) _b = (b); \
_a > _b ? _a : _b; })... |
Java | UTF-8 | 1,015 | 1.953125 | 2 | [] | no_license | package example.micronaut;
import io.micronaut.context.ApplicationContext;
import io.micronaut.runtime.server.EmbeddedServer;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
public class ViesVatValidatorFunctio... |
Java | UTF-8 | 1,290 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | package kame.spring.chap03.annot;
import java.util.HashMap;
import java.util.Map;
import kame.spring.chap03.core.Article;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.... |
JavaScript | UTF-8 | 2,399 | 2.625 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-unknown",
"DOC",
"FreeBSD-DOC",
"MIT",
"AGPL-3.0-only"
] | permissive | /****************************************************************************
* Copyright 2021 EPAM Systems
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org... |
JavaScript | UTF-8 | 928 | 2.765625 | 3 | [] | no_license | function createDOM(name, attrs) {
if (name == "text") {
const element = document.createTextNode(attrs);
return element;
}
const element = document.createElement(name);
if (!_.isEmpty(attrs)) {
for (let key in attrs) {
if (key == "textContent") {
elemen... |
Java | UTF-8 | 912 | 2.5625 | 3 | [
"BSD-3-Clause"
] | permissive | package org.secureauth.restapi.examples;
import org.secureauth.sarestapi.SAAccess;
import org.secureauth.sarestapi.data.ResponseObject;
public class AdaptiveAuth {
// Define our User Variables
private static String user = "user";
// Required for connectivity to Appliance
private static String applianceHost = "h... |
Java | UTF-8 | 4,935 | 3.328125 | 3 | [] | no_license | import java.util.*;
public class BookingTableController {
private ArrayList<Table> tablesAvailable;
private ArrayList<Table> tablesAssigned;
private int pendingRequests;
private int totalPersonsPending;
public BookingTableController()
{
tablesAvailable = new ArrayList<>();
tablesAssigned = new ArrayList<>... |
Python | UTF-8 | 12,644 | 2.96875 | 3 | [] | permissive | import random
import os
import glob
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
"""
Generates numpy data that can be input into the model one epoch at a time
+ trials are the list of possible sets of trials that can be shown to the model
+ numTrials represents the number of trials per ep... |
C# | UTF-8 | 2,621 | 2.8125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ImageProcessToolBox
{
class TransformByExp : PointTemplate, IImageProcess
{
private Bitmap _SourceImage;
private int... |
JavaScript | UTF-8 | 5,096 | 2.71875 | 3 | [
"WTFPL"
] | permissive | const EventEmitter = require("events");
const uuidv4 = require("uuid/v4");
const { BombersplashWorld } = require("../physics");
const { getMapStartPositions, getMapCollisionRects } = require("tiled-utils");
const Player = require("./Player");
const Bomb = require("./Bomb");
const Score = require("./Score");
const st... |
Markdown | UTF-8 | 5,488 | 2.515625 | 3 | [] | no_license | ## Вилла «Алина»
%%%carousel:alina%%%
Вилла «Алина» в Алуште предлагает отдых в Крыму на берегу моря — вне зависимости от сезона. Расположение — самое выгодное — вблизи инфраструктура профессорского уголка, дороги, набережная и пляжи. Вилла Алина с собственным пляжем в Алуште расположена на первой полосе от моря; пля... |
C# | UTF-8 | 5,074 | 3.703125 | 4 | [
"MIT"
] | permissive | using System;
using System.Collections.Generic;
namespace IExp.LexicalAnalysis
{
/// <summary>
/// It is the class performing the lexical analysis,
/// that is the process of converting a sequence of characters into a sequence of tokens.
/// </summary>
public class Scanner
{
#region ME... |
C | UTF-8 | 510 | 3.0625 | 3 | [] | no_license | #include<stdio.h>
#include<windows.h>
#define row 7
#define col 13
void Print()
{
for (int i = 0; i < row; i++)
{
for (int j = 0; j < col / 2 - i; j++)
{
printf(" ");
}
for (int k = 0; k < 2 * (i + 1) - 1; k++)
{
printf("*");
}
printf("\n");
}
for (int i = 0; i < row - 1; i++)
{
for (int j... |
Java | UTF-8 | 9,125 | 2 | 2 | [] | no_license | package com.abwebmobile.karl.zslombard.allFragments;
import android.graphics.Color;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.view.LayoutInflater;
i... |
Go | UTF-8 | 1,382 | 2.84375 | 3 | [] | no_license | package controllers
import (
"github.com/dgrijalva/jwt-go"
"github.com/gin-gonic/gin"
"go-music/repositories"
"go-music/utils"
"net/http"
"time"
)
const SECRET_KEY = "kelvinlam_1986"
type AccountController struct {
AccountRepository repositories.IAccountRepository
}
func NewAccountController(repo repositorie... |
Java | UTF-8 | 2,958 | 2.4375 | 2 | [] | no_license | package com.trs.media.download;
import android.app.Service;
import android.content.Intent;
import android.os.*;
import android.widget.ProgressBar;
import com.trs.media.download.entity.LoadInfo;
import java.util.HashMap;
import java.util.Map;
/**
* Created by wbq on 14-8-1.
*/
public class DownloadService extends S... |
Java | UTF-8 | 399 | 2.328125 | 2 | [
"Apache-2.0"
] | permissive | package org.onap.so.client.exception;
public class UnexpectedDataException extends Exception {
public UnexpectedDataException() {}
public UnexpectedDataException(String message, String system) {
super("Unexpected data found in " + system + ". " + message);
}
public UnexpectedDataException(S... |
Java | UTF-8 | 238 | 1.671875 | 2 | [] | no_license | package com.example.agnents.repositories;
import com.example.agnents.models.Transporter;
import org.springframework.data.jpa.repository.JpaRepository;
public interface TransporterRepository extends JpaRepository<Transporter, Long> {
}
|
Python | UTF-8 | 593 | 2.640625 | 3 | [] | no_license | import csv, sys, random
cids = [701829, 32086821185414, 419344, 22144, 660822, 756597474414199, 304466804484872]
data = []
with open('order_messages_demo.csv', "rb") as file:
reader = csv.reader(file, delimiter=',')
for index, row in enumerate(reader):
if index is 0:
new_row = ['cid:Int32']
else:
new_row ... |
Go | UTF-8 | 596 | 3.015625 | 3 | [
"Apache-2.0"
] | permissive | package shash
import (
"crypto/rand"
"crypto/sha256"
"errors"
)
const (
keyLen = 32
)
func keyHash(password string) ([]byte, []byte, error) {
salt := make([]byte, keyLen)
_, err := rand.Read(salt)
if err != nil {
return nil, nil, err
}
input := append([]byte(password), salt...)
hash := sha256.Sum256(inpu... |
Java | UTF-8 | 1,230 | 2.40625 | 2 | [] | no_license | package com.cn.tools.mlog.formatter;
import android.util.Log;
import com.cn.tools.mlog.LogLevel;
import com.cn.tools.mlog.MLogSettings;
import com.cn.tools.mlog.WorkMode;
/**
* ${TODO} What the class does
*
* @author: yanchao
* @date: 8/25/16-3:05 PM
* ${TAGS}
*/
public abstract class LogFormatter {
public... |
Markdown | UTF-8 | 1,043 | 2.53125 | 3 | [
"CC-BY-4.0"
] | permissive | # Metadaten eines Anbieters im CSV-Format
Ausgangsdaten: CSV-Format des Anbieters "Lynda"
Ziel: Transformation in TSV mit Spaltenbezeichnungen gemäß [finc-Schema](https://github.com/finc/index/blob/master/schema.xml)
## Hinweise zur Verarbeitung in OpenRefine
* Für kleinere Korrekturen bietet sich die Transformation... |
C++ | UTF-8 | 2,514 | 3.15625 | 3 | [] | no_license | #include <memory> /* for gcc 4.9.2, also have to define -std=c++11 */
#include "gtest/gtest.h"
#include "gmock/gmock.h"
/* include the prototype of mock function */
#include "xdev.h"
using namespace ::testing;
/**
* XDevMock
* GMock macro to define the mock API
*
* MOCK_METHOD1: the function take one parameter... |
C | UTF-8 | 358 | 3.125 | 3 | [] | no_license | #include <stdio.h>
int main() {
int n;
scanf(" %d", &n);
int nodds = 0, last_even, last_odd;
for (int i = 0; i < n; i++) {
int a;
scanf(" %d", &a);
if (a%2) {
nodds++;
last_odd = i + 1;
} else
last_even = i + 1;
}
printf("%d", ... |
Shell | UTF-8 | 591 | 2.90625 | 3 | [
"WTFPL",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | #!/bin/sh
PATH=/usr/sbin:/usr/bin:/sbin:/bin
# We check for this file in stage3 to halt or reboot
install --mode=755 /dev/null /run/runit.stopit
rm -f /run/runit.reboot /run/runit.kexecreboot
# Proceed with shutdown process
printf "\nSystem is going down...\n" | wall --nobanner
/sbin/runit-init 0
# Don't give the ... |
C# | UTF-8 | 5,221 | 2.828125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Diagnostics;
namespace ComCorpAssessment
{
public partial class MainWi... |
Python | UTF-8 | 3,361 | 2.65625 | 3 | [] | no_license | from FinanceDataReader import DataReader
from preprocess import *
from indicator import *
from dataset import *
from sklearn.preprocessing import MinMaxScaler
from keras.callbacks import EarlyStopping
from keras.callbacks import ModelCheckpoint
import tensorflow as tf
SHUFFLE_SIZE = 50
TRAIN_BATCH_SIZE = 1... |
C++ | UTF-8 | 20,432 | 2.90625 | 3 | [] | no_license | #include "ProblemSolver.h"
#include <lapacke.h>
#include <cmath>
#include "ErrorMargin.h"
#define NUM_OF_TRIES 3
using namespace std;
using namespace Eigen;
ProblemSolver::ProblemSolver(SylvesterPolynomial * SP, unsigned int B, unsigned int d):degree(d), mdIsInvertible(true), Solved(false), numOfSolutions(0)
{ ... |
Java | UTF-8 | 1,494 | 1.539063 | 2 | [] | no_license | package demo.copy.baisi.ui;
public class Consts {
//锟接口凤拷锟截斤拷锟�
public static final int RESPONSE_BACK_CODE = 0;
public static final String BASEURL="http://45.78.24.178:8080/dang/";
public static final String BAISI_URL = "http://route.showapi.com/255-1?showapi_appid=24726&showapi_sign=be678ef28e294c15813cf3... |
Markdown | UTF-8 | 1,949 | 2.515625 | 3 | [] | no_license | ---
nome: Matheus Catelani Schumann
titulo: Pai é quem cria
---
Eu e meu tio somos um exemplo disso. Nasci em 2002. Meus pais, Cleide e Roberto, não eram casados e também não moravam juntos, mas ele sempre esteve por perto até 2006, quando faleceu. Como eu tinha apenas quatro anos, minha mãe se encarregou de me contar... |
Markdown | UTF-8 | 1,534 | 3.359375 | 3 | [] | no_license | # [Kvass and the Fair Nut][title]
## Problem Description
Detail instraction can be found [here][title].
## Solution
```java
private static long minLevel(long[] volumes, long capacity) {
int n = volumes.length;
long sum = 0;
int min = 0;
for (int i = 0; i < n; i++) {
sum += volumes[i];
... |
C | UTF-8 | 390 | 3.375 | 3 | [] | no_license | #include<stdio.h>
void main()
{
int n, a[100], i, poz, nr;
printf("n=");
scanf_s("%d", &n);
for (i = 0; i<n; i++)
scanf_s("%d", &a[i]);
printf("Numarul cautat este ?\n");
scanf_s("%d", &nr);
poz = -1;
for (i = 0; i<n; i++)
if (a[i] == nr)
poz = i;
if (poz >= 0) printf("%d este in vector pe pozitia : %d ... |
SQL | UTF-8 | 939 | 4.625 | 5 | [] | no_license | SELECT
s.id, s.day,
(COUNT(sc.state='PENDING') + (select COUNT(1) from captain) - COUNT(sc.state = 'ACCEPTED') - COUNT(sc.state = 'REJECTED')) pendingCount,
COALESCE(sum(sc.state = 'ACCEPTED'), 0) acceptedCount,
COALESCE(sum(sc.state = 'REJECTED'), 0) rejectedCount
FROM schedule s
LEFT JOIN schedule_to_captai... |
Markdown | UTF-8 | 111,949 | 2.59375 | 3 | [] | no_license | # 开放API规范
#### 版本 3.0.0
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [BCP 14](https://tools.ietf.org/html/bcp14) [RFC2119](https://tools.ietf.org/html/rfc2119) ... |
C++ | UTF-8 | 319 | 2.796875 | 3 | [] | no_license | #pragma once
#include "IRacer.h"
#include "CPersonImpl.h"
class CRacer : public CPersonImpl<IRacer>
{
public:
CRacer(std::string name, size_t awardsCount)
: CPersonImpl(name)
, m_awardsCount(awardsCount)
{}
size_t GetAwardsCount()const final
{
return m_awardsCount;
}
private:
size_t m_awardsCount;
};
|
JavaScript | UTF-8 | 2,496 | 2.671875 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | var app = angular.module('App', [
angularChartist,
'ui.select', 'ngSanitize'
]);
app.factory('dataService', function($http) {
var data = undefined;
return {
get: function(cb) {
if (!data) {
$http({
url: '/js/data/data.json',
method: "GET"
})
.then(function(response) {
data = respo... |
Markdown | UTF-8 | 7,334 | 2.8125 | 3 | [
"MIT"
] | permissive | # Bjork :「上帝啊,这个困难正合我意」—— 合意困难
原文:[Desirable difficulties, after Bjork (andymatuschak.org)](https://notes.andymatuschak.org/z49u8mtc9wZoY7siV7nz4V3PG2oMkNBn7AgUk)
培训中如果刻意引入困难,效果往往更加显著。
下列实验是 [Robert A. Bjork](https://notes.andymatuschak.org/zcHyJy8EutFjUfJcEUw7sYLJ4UVTmR3NDsYS)(1994年) 所举的例子,来说明合意困难提升长期表现:
- 将性质不同的... |
Java | UTF-8 | 1,342 | 1.984375 | 2 | [] | no_license | package com.example.bunny.ass3;
import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
im... |
JavaScript | UTF-8 | 586 | 2.53125 | 3 | [] | no_license | import React, { useEffect, useState } from 'react';
const Search = (props) => {
const [search,setSearch] = useState("")
useEffect(()=> {
props.setSearchTerm(search)
}, [search])
const handleSearchChange = (events) => {
setSearch(events.target.value);
}
return (
... |
Java | UTF-8 | 438 | 1.578125 | 2 | [] | no_license | package com.smy.redis;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
/**
* @author smy
*/
@SpringBootApplication
@EnableCaching
public class RedisApp {
public static void main(St... |
PHP | UTF-8 | 2,236 | 2.6875 | 3 | [] | no_license | <?php
namespace frame;
class Html
{
protected $_CSS = [];
protected $_JS = [];
public function addCss($name='', $match=true)
{
$matchPath = '';
if ($match) {
if (env('APP_VIEW_MATCH')) {
$matchPath = (IS_MOBILE ? 'mobile' : 'computer').DS;
}
if (empty($name)) {
$_route = router()->getRoute(... |
Java | UTF-8 | 342 | 2.34375 | 2 | [] | no_license | package frc.robot.commands;
public class ShootingAutoTimed extends ShootingAuto{
public ShootingAutoTimed(){
super();
}
@Override
public void initialize(){
super.initialize();
setTimeout(9);
}
@Override
public boolean isFinished(){
return super.isFinished() ||... |
Java | UTF-8 | 2,322 | 2.171875 | 2 | [] | no_license | package persistencia;
// Generated Nov 16, 2015 3:40:15 PM by Hibernate Tools 4.3.1.Final
import java.math.BigDecimal;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
... |
Python | UTF-8 | 118 | 2.765625 | 3 | [] | no_license | def myvalue(data):
for i in range (1,10):
print data[i]
yield data[i]
myvalue("my name is meena")
print data[i]
|
PHP | UTF-8 | 817 | 2.6875 | 3 | [] | no_license | <?php
namespace App\Domain\User;
use Illuminate\Database\Eloquent\Model as AbstractModel;
use Illuminate\Auth\Authenticatable;
use Illuminate\Contracts\Auth\Authenticatable as AuthContract;
use Illuminate\Auth\Passwords\CanResetPassword;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
clas... |
Markdown | UTF-8 | 1,595 | 3.453125 | 3 | [] | no_license | ## Making a plan
1. Make a drawing of your app. Simple "wireframes"
2. Once you have a drawing, name the HTML elements you'll need to realize your vision
3. For each HTML element ask: Why do I need this?
4. Once we know _why_ we need each element, think about how to implement the "Why" as a "How"
5. Is there some stat... |
Swift | UTF-8 | 301 | 2.625 | 3 | [] | no_license | //
// JSONDecodable.swift
// MovieNight
//
// Created by Jun Kakeno on 11/5/18.
// Copyright © 2018 Jun Kakeno. All rights reserved.
//
import Foundation
protocol JSONDecodable {
//Potocole to enable models that adopt this protocole to be initialized by passing a json
init?(json: [String: Any])
}
|
Java | UTF-8 | 1,250 | 3.640625 | 4 | [] | no_license | package com.venkat.microservice;
import java.util.concurrent.Callable;
public class Test {
public int doFactorial(int n) {
if(n==0) {
return 1;
} else {
return doFactorial(n-1)*n;
}
}
public void inverseStar() {
for(int i=3; i > 0; i--) {
for(int j=0; j < i; j++)
System.out.print("*");
... |
Java | UTF-8 | 280 | 2.34375 | 2 | [] | no_license | package Creational.FactoryPattern.Yanmo.第4版工厂方法的应用.Product;
public class ConcreteExportFile implements BaseExportFileApi {
public boolean export(String data) {
System.out.println("导出数据"+data+"到文本文件");
return true;
}
}
|
Python | UTF-8 | 1,129 | 3.265625 | 3 | [] | no_license | import json
def search_for_similar_uris(similarities, uri):
'''similarities is the data to search (similarities),
uri is the URI to search for '''
if not uri in similarities.keys():
return None
relevant_uris = similarities[uri]
language_dict = {}
for rel_uri in relevant_uris:
... |
Python | UTF-8 | 313 | 2.984375 | 3 | [] | no_license | n = int(input())
for i in range(n):
arr = list(map(int, input().split(',')))
posno=[num for num in arr if num>0]
negno=[num for num in arr if num<0]
zerono=[num for num in arr if num==0]
print(len(posno)/n)
print(len(negno)/n)
print(len(zerono)/n)
break
'''
6
-4 3 -9 0 4 1 ''' |
Swift | UTF-8 | 2,323 | 2.75 | 3 | [] | no_license | //
// LessonViewController.swift
// Learn
//
// Created by Johann Kerr on 4/25/19.
// Copyright © 2019 Johann Kerr. All rights reserved.
//
import UIKit
import Down
class LessonViewController: UIViewController, Storyboardable {
var lesson: Lesson?
var completeBtn = UIButton()
var markDownView: DownVie... |
Shell | UTF-8 | 885 | 2.828125 | 3 | [] | no_license | #!/bin/bash
LOG='/tmp/xfcecustoms.log'
function main(){
# для очистки всех опций
date
echo 'flush layouts'
setxkbmap -layout 'us,ru' -option ''
# для добавления опции переключения по нужным клавишам
echo 'set new layouts'
setxkbmap -layout 'us,ru' -option 'grp:lctrl_lshift_toggle,compose:ralt,grp_led:scroll'... |
C# | UTF-8 | 1,997 | 2.71875 | 3 | [
"MIT"
] | permissive | namespace Headless
{
using System.Collections.Generic;
using System.Xml.XPath;
using Headless.Activation;
/// <summary>
/// The <see cref="HtmlCheckBox" />
/// class is used to represent a HTML checkbox.
/// </summary>
[SupportedTag("input", "type", "checkbox")]
public clas... |
Java | UTF-8 | 1,709 | 2.109375 | 2 | [] | no_license | package com.weixin.service.task;
import java.util.List;
import org.quartz.SchedulerException;
import com.weixin.bean.ScheduleJob;
public interface SchedulerTaskService {
/**
* 添加任务
*
* @param scheduleJob
* @throws SchedulerException
*/
public void addJob(Schedule... |
C# | UTF-8 | 7,341 | 2.8125 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-generic-cla",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | //
// Copyright 2012 Hakan Kjellerstrand
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or ag... |
Java | UTF-8 | 941 | 3.828125 | 4 | [] | no_license | package com.tsguild.foundations.Factorizor;
import java.util.Scanner;
public class Factorizor {
public static void main(String[] args) {
System.out.println("What number would you like to factor? ");
Scanner inputReader = new Scanner(System.in);
int userFactor = inputReader.nextInt();
... |
Markdown | UTF-8 | 1,915 | 2.6875 | 3 | [] | no_license | ---
title: "Azure Functions Recipes"
author_name: Anthony Chu - MSFT
layout: post
hide_excerpt: true
---
[Anthony Chu - MSFT](https://social.msdn.microsoft.com/profile/Anthony Chu - MSFT) 5/3/2018 7:37:31 AM Recently, we released a collection of over 50 tips and tricks for Azure Functions that we're calling "[F... |
Java | UTF-8 | 5,470 | 2.015625 | 2 | [] | no_license | package tree.giving.givingtree;
import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.NavigationView;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7... |
C++ | UTF-8 | 1,002 | 2.546875 | 3 | [] | no_license | #ifndef SHIKEN_USER_DAO_H
#define SHIKEN_USER_DAO_H
#include <shiken/config.h>
#include <shiken/entities/User.h>
#include "Dao.h"
namespace shiken {
// -------------------------------------------------------------------------- //
// UserDao
// --------------------------------------------------------------------------... |
JavaScript | UTF-8 | 1,309 | 3.8125 | 4 | [] | no_license | /** @format */
// Reverse Link list
// Node Constructor
class Node {
constructor(element, next = null) {
this.element = element;
this.next = next;
}
}
// Link list constructor
class linkList {
constructor() {
// set the head
this.head = null;
}
add(element) {
var node = new Node(element);
if (!this... |
TypeScript | UTF-8 | 2,615 | 2.53125 | 3 | [
"MIT"
] | permissive | import nock from 'nock'
import { join } from 'path'
import fs from 'fs'
import rka, { Config } from '../src'
import { RokkaApi } from '../src/apis'
const nockBack = nock.back
nockBack.setMode('record')
nockBack.fixtures = join(__dirname, 'fixtures/requests/')
const responseDir = join(__dirname, 'fixtures/answers/')
//... |
Python | UTF-8 | 326 | 3.3125 | 3 | [
"MIT"
] | permissive | # Code to Measure time taken by program to execute.
import Allmodul as module
# store starting time
begin = module.time.time()
# program body starts
# program body ends
module.time.sleep(1)
# store end time
end = module.time.time()
# total time taken
print(f"Total runtime of the program is {end - begi... |
Java | UTF-8 | 506 | 2.0625 | 2 | [] | no_license | package gr.uoa.di.tded.labisp.gstam.services;
import gr.uoa.di.tded.labisp.gstam.services.impl.Service2Impl;
import gr.uoa.di.tded.labisp.gstam.domains.Cart;
import java.io.IOException;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
@WebService()
public class Service2 {
@Web... |
C# | UTF-8 | 3,293 | 2.890625 | 3 | [] | no_license | using System;
using System.Text;
using System.Web;
using System.IO;
using System.Net;
namespace WXService.HttpUtility
{
public class RequestUtility
{
/// <summary>
/// 读取请求对象的内容
/// 只能读一次
/// </summary>
/// <param name="request">HttpRequest对象</param>
/// <return... |
Java | UTF-8 | 5,183 | 3.078125 | 3 | [] | no_license | package files;
//import java.nio.file.FileAlreadyExistsException;
import java.util.Map;
import java.util.Queue;
import exceptions.FileAlreadyExistsException;
import exceptions.FileDoesNotExistException;
import exceptions.InvalidArgumentException;
import java.util.ArrayList;
import java.util.Collections;
import java.ut... |
C | UTF-8 | 440 | 3.140625 | 3 | [] | no_license | /*
* poj 2013
* guzhoudiaoke@126.com
* 2011-09-22
*/
#include <stdio.h>
int main()
{
int n, i, t = 1;
char str[15][26];
while (1)
{
scanf("%d", &n);
if (n == 0)
break;
for (i = 0; i < n; i++)
scanf("%s", str[i]);
printf("SET %d\n", t);
for (i = 0; i < n; i+=2)
printf("%s\n", str[i]);
... |
Java | UTF-8 | 229 | 3.046875 | 3 | [] | no_license | package com.javaapi.test.test.javafeature.version5.generictype.sample3;
public class Bird extends Animal {
public Bird(String name) {
super(name);
}
public void fly() {
System.out.println(getName() + " can fly.");
}
}
|
Java | UTF-8 | 739 | 2.140625 | 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 privatecondo.controller;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JComboBox... |
Java | UTF-8 | 1,522 | 2.09375 | 2 | [] | no_license | package rs.ac.uns.ftn.informatika.mbs2.vezbe09.primer01.server.servlet;
import java.io.IOException;
import java.util.Set;
import javax.ejb.EJB;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
imp... |
PHP | UTF-8 | 1,884 | 2.78125 | 3 | [
"MIT"
] | permissive | <?php
class ReportersController extends \BaseController {
/**
* Display a listing of reporters
*
* @return Response
*/
public function index()
{
$reporters = Reporter::all();
return View::make('reporters.index', compact('reporters'));
}
/**
* Show the form for creating a new reporter
*
* @ret... |
Markdown | UTF-8 | 10,666 | 3.5 | 4 | [] | no_license |
# Hanging by a Thread: Concurrency on an Arduino
## Allison Basore and Anusha Datar
# Project Vision
The goal of our project was to write the appropriate firmware to support threading on an Arduino Uno. In doing so, we hoped to implement several different methods of handling concurrent processes and create interesti... |
Markdown | UTF-8 | 1,472 | 3.203125 | 3 | [
"MIT"
] | permissive | ### Add topic context menus to default 📧context menus by writing a plugin.
The following example demonstrates adding a menu item. Clicking on the menu pops up the key and style of the current topic.
```jsx
function onClickMyMenu(props) {
return function() {
const { topicKey, controller, model } = props;
al... |
Rust | UTF-8 | 635 | 2.59375 | 3 | [
"Apache-2.0"
] | permissive | use rand::{self, rngs::StdRng, thread_rng, SeedableRng};
const TEST_RNG_SEED: [u8; 32] = [
1, 0, 12, 0, 0, 6, 3, 0, 1, 0, 10, 0, 22, 32, 7, 3, 2, 0, 54, 6, 12, 11, 0, 0, 3, 0, 0, 0, 0,
0, 2, 92,
];
pub fn test_rng(is_deterministic: bool) -> StdRng {
// Allow to change setting via environment variable.
... |
PHP | UTF-8 | 1,103 | 2.625 | 3 | [
"MIT"
] | permissive | <?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateModelsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('models', function (Blueprint $table) {
$tab... |
SQL | UTF-8 | 5,134 | 3.890625 | 4 | [] | no_license | CREATE DATABASE IF NOT EXISTS onlinecontrol CHARACTER SET utf8 COLLATE utf8_unicode_ci;
GRANT ALL PRIVILEGES ON onlinecontrol.* TO root@localhost IDENTIFIED BY 'root';
USE onlinecontrol;
CREATE TABLE IF NOT EXISTS persistent_logins (
username VARCHAR(64) NOT NULL,
series VARCHAR(64) PRIMARY KEY,
token V... |
C++ | UTF-8 | 1,310 | 2.984375 | 3 | [
"Zlib"
] | permissive | #include "Math.hpp"
#include <engine/core/math/Matrix4f.hpp>
#include <engine/core/math/Vector3f.hpp>
#include <cmath>
namespace glPortal {
const float Math::PI_RND=3.1415926535897932384626433832795028841971693993751058209749445923078164062862089;
float Math::toDegrees(float radians) {
return radians * (180... |
Python | UTF-8 | 659 | 3.59375 | 4 | [] | no_license | #!/usr/bin/env python3
char_name = input(' Which character do you want to know about? (Wolverine, Harry Potter, Captain America)')
char_stat = input(' What statistic do you want to know about? (real name, powers, archenemy)')
heroes= {
"wolverine":
{"real name": "James Howlett",
"powers": "regeneration",
... |
PHP | UTF-8 | 1,967 | 2.640625 | 3 | [
"MIT"
] | permissive | <?php
namespace Ojs\JournalBundle\Entity;
use Gedmo\Translatable\Translatable;
use Ojs\CoreBundle\Entity\GenericEntityTrait;
use Prezent\Doctrine\Translatable\Annotation as Prezent;
/**
* Article key-value attributes
*/
class ArticleAttribute implements Translatable
{
use GenericEntityTrait;
private $arti... |
C++ | UTF-8 | 1,812 | 3.71875 | 4 | [
"Unlicense",
"LicenseRef-scancode-public-domain"
] | permissive | #include "external/ppp2code/file/std_lib_facilities.h"
double add(double x, double y)
{
if ((x > 0 && y > numeric_limits<double>::max() - x) || (x < 0 && y < numeric_limits<double>::min() + x)) {
throw overflow_error { "Overflow detected (x = " + to_string(x) + ", y = " + to_string(y) + ")" };
}
return x +... |
Python | UTF-8 | 200 | 3.109375 | 3 | [] | no_license | import pylab
xVals = [1, 2, 3, 4]
yVals1 = [1, 2, 3, 4]
pylab.plot(xVals, yVals1, 'b-', label = 'first')
yVals2 = [1, 7, 3, 5]
pylab.plot(xVals, yVals2, 'r--', label = 'second')
pylab.legend() |
Java | UTF-8 | 524 | 1.617188 | 2 | [] | no_license | package com.ruoyi.web.controller.common.xiaoyiApi;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import java.io.Serializable;
/**
* @author CJ
* @date 2019/10/12
*/
@ToString
@Getter
@Setter
public class QueryLiveCourseDetailRequest implements ... |
Java | UTF-8 | 2,364 | 2.046875 | 2 | [] | no_license | /**
* $Revision$
* $Date$
*
* Copyright 2013 SoftCognito.org.
*
* All rights reserved. Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*... |
C++ | UTF-8 | 655 | 2.9375 | 3 | [] | no_license | #include "utils.h"
#ifdef StringtoInteger
#include <iostream>
#include <vector>
int atoi1(const char *str)
{
long long ans = 0;
bool postive = true;
while(*str == ' ')
{
str++;
}
if(*str == '+')
{
str ++;
}
else if(*str == '-')
{
postive = false;
str ++;
}
while(*str >= '0' && *str <= '9')
{
... |
Java | UTF-8 | 1,639 | 2.03125 | 2 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /*
* $Id$
*
* Copyright 2001-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless... |
Java | UTF-8 | 3,514 | 3.125 | 3 | [] | no_license | package OldFiles;
import java.util.ArrayList;
import java.util.List;
//import com.brs.event.EventData.EventName;
import com.brs.event.EventName;
import OldFiles.Event.EventBuilder;
public class Campaign {
//Event:
private Event event;
//private HistoricEventBuilder historicEventBuilder;
private List<Player>... |
Java | UTF-8 | 4,474 | 2.3125 | 2 | [
"Apache-2.0"
] | permissive | package com.highway2urhell.transformer;
import javassist.CtClass;
import javassist.CtMethod;
public class Struts1Transformer extends AbstractLeechTransformer {
public Struts1Transformer() {
super("org/apache/struts/action/ActionServlet");
addImportPackage(collectPackages());
}
public sta... |
C++ | UTF-8 | 25,335 | 2.984375 | 3 | [
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0"
] | permissive | #include "core/objectsystem.h"
#include "core/uri.h"
#include <mutex>
/*!
\typedef Object::ObjectList
Synonym for list<Object *>.
*/
/*!
\typedef Object::LinkList
Synonym for list<Link *>.
*/
inline bool operator==(const Object::Link &left, const Object::Link &right) {
bool result = true;
... |
Python | UTF-8 | 12,258 | 2.71875 | 3 | [] | no_license | import urllib2
import sys
from urlparse import urlparse
from urlparse import urljoin
import json
import re
import MyUrl
import Auditor
import CrawlRecord
from bs4 import BeautifulSoup
import numpy as np
import robotparser
from datetime import datetime
from collections import deque
class PageRankCrawler:
def __ini... |
Java | UTF-8 | 1,611 | 2.140625 | 2 | [
"MIT"
] | permissive | package uk.gov.hmcts.reform.fpl.service.translations;
import org.junit.jupiter.api.Test;
import uk.gov.hmcts.reform.fpl.model.CaseData;
import uk.gov.hmcts.reform.fpl.model.common.DocumentReference;
import uk.gov.hmcts.reform.fpl.model.event.UploadTranslationsEventData;
import static org.assertj.core.api.AssertionsFo... |
Java | UTF-8 | 2,531 | 3.453125 | 3 | [
"Apache-2.0"
] | permissive | package com.example.practise.basestructure_16;
import com.example.practise.basestructure_16.common.Graph;
import com.example.practise.basestructure_16.common.Node;
import java.util.*;
/**
* @author:haokanghao
* @date: 2021/5/28 09:25
* @desc: 宽度优先遍历
*/
public class Code_01BFS {
// 宽度优先遍历
public static v... |
Markdown | UTF-8 | 28,491 | 2.828125 | 3 | [
"Apache-2.0"
] | permissive | # Thundra Lambda Warmup
Warmup support for AWS Lambda functions to prevent cold starts as much as possible.
## Setup
Take the following steps to setup warmup support:
* Thundra provides a Lambda function called `thundra-lambda-warmup` on the user end to trigger Lambda functions with warmup messages periodically. Th... |
Java | UTF-8 | 2,435 | 2.09375 | 2 | [] | no_license | package com.ying.administrator.masterappdemo.mvp.contract;
import com.ying.administrator.masterappdemo.base.BaseModel;
import com.ying.administrator.masterappdemo.base.BasePresenter;
import com.ying.administrator.masterappdemo.base.BaseResult;
import com.ying.administrator.masterappdemo.base.BaseView;
import com.ying... |
Ruby | UTF-8 | 2,357 | 3.515625 | 4 | [] | no_license | #可以在正则表达式 后面携带参数 i->忽略大小写 m->匹配多行 x->忽略空白字符
reg1 = /abc/
reg2 = /abc/i
p reg1 =~ 'ABCD' #nil
p reg2 =~ 'ABCD' #0
#在正则表达式中 我们使用()建立子模式,然后可以通过$数字进行捕获(后向引用)
/^\w+\s*(\w+)\s*(\w+)/ =~ "I love you"
p $1 #love
p $2 #you
#但有时 如果我们改变了匹配中()的数量,会导致引用部分索引变化
#假设我们不希望发生这种情况,我们可以把后加的索引 使用 ?: 告知不捕获
/^\w+\s*(\w+)(\s... |
JavaScript | UTF-8 | 918 | 2.6875 | 3 | [
"MIT"
] | permissive | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
$(document).ready(inicializar);
var lat;
var lon;
function inicializar() {
$('#print').click(function () {
$.ajax({
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.