language stringclasses 15
values | src_encoding stringclasses 34
values | length_bytes int64 6 7.85M | score float64 1.5 5.69 | int_score int64 2 5 | detected_licenses listlengths 0 160 | license_type stringclasses 2
values | text stringlengths 9 7.85M |
|---|---|---|---|---|---|---|---|
C# | UTF-8 | 1,521 | 2.5625 | 3 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | using Spice.ViewModels.Fields;
namespace Spice.WebAPI.Tests.Fields.Factories
{
internal static class ViewModelFactory
{
public static CreateFieldViewModel CreateValidCreationModel()
{
return new CreateFieldViewModel
{
Name = "Field A",
De... |
C# | UTF-8 | 764 | 2.75 | 3 | [] | no_license | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class EnemySpawner : MonoBehaviour
{
// Parameters
[SerializeField] Attacker[] enemies;
[SerializeField] float spawnIntMin;
[SerializeField] float spawnIntMax;
bool keepSpawning = true;
int enemyToSpawn;
IEnumerator Start(... |
Python | UTF-8 | 2,074 | 2.875 | 3 | [] | no_license | from http.client import HTTPConnection
conn = None
regKey = 'daaae38eedaa6adf9766e73211c81cb1'
server = "apis.daum.net"
host = "smtp.gmail.com" # Gmail SMTP 서버 주소.
port = "587"
def userURIBuilder(server, **user):
str = "https://" + server + "/contents/movie" + "?"
for key in user.keys():
str += key +... |
Java | UTF-8 | 824 | 3.609375 | 4 | [] | no_license | package com.biz.control;
public class Control13 {
public static void main(String[] args) {
// TODO Auto-generated method stub
//급여액이 3000이하이면 6%
//급여액이 3000초과 10000 이하이면 9%
//급여액이 1억을 초과하면 12%
int intPay = 12000;
if(intPay <= 3000) {
System.out.println("세금 : "
+ (intPay * .06));
//이미 i... |
C++ | UTF-8 | 1,685 | 2.578125 | 3 | [
"MIT"
] | permissive | #ifndef KERNEL_INTERSECTION_HPP
#define KERNEL_INTERSECTION_HPP
#include "kernel_types/triangle.hpp"
#include "kernels/backend/kernel.hpp"
#include "kernels/backend/vector.hpp"
#include "kernels/matrix.hpp"
#include "kernels/types.hpp"
namespace nova {
// Use woop transformation to transform ray to unit triangle spa... |
PHP | UTF-8 | 758 | 2.5625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Traits;
use Illuminate\Support\Str;
trait CurlTrait
{
protected function rapidapiCurl(array $data)
{
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => $data['rapidapiUrl'],
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLO... |
Java | UTF-8 | 2,308 | 2.625 | 3 | [] | no_license | package com.kamoulcup.mobile.addict.config;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import android.content.Context;
import android.content.res.AssetManager;
public final class Configuration
{
/**
* Nom du fichier de conf.
*/
private static final St... |
Markdown | UTF-8 | 1,013 | 3.046875 | 3 | [
"MIT"
] | permissive | # FromJson
TODO: Write a gem description
## Requirements
ORMs:
- ActiveRecord
ODMs:
- Mongoid
## Installation
Add this line to your application's Gemfile:
gem 'from_json'
And then execute:
$ bundle
Or install it yourself as:
$ gem install from_json
## Usage
To use `from_json`, FromJson needs ba... |
Java | UTF-8 | 492 | 2.375 | 2 | [] | no_license | package com.sample.stockexchange.adapter;
import com.sample.stockexchange.entity.BuyOrderSet;
import com.sample.stockexchange.entity.SellOrderSet;
import com.sample.stockexchange.entity.Stock;
import java.util.Map;
/**
* Interface for persisting incoming orders based stock. For simplicity's sake,
* just a map for ... |
SQL | UTF-8 | 857 | 2.546875 | 3 | [
"BSD-3-Clause"
] | permissive | -- phpMyAdmin SQL Dump
-- version 3.1.4
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Aug 02, 2011 at 01:03 AM
-- Server version: 5.5.14
-- PHP Version: 5.3.4
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_S... |
C++ | WINDOWS-1251 | 1,999 | 3.375 | 3 | [] | no_license | /*
.
*/
#include<iostream>
#include<Windows.h>
using namespace std;
void main()
{
SetConsoleCP(1251);
SetConsoleOutputCP(1251);
int a, b, p, q, r, s;
int S, s1, s2;//S(), s1(.1), s2(.2)
cout << " a: ";
cin >> a;
cout << " b: ";
cin >> b;
cout << " p: ";
cin >> p;
cout << " q: ... |
Java | UTF-8 | 699 | 3.640625 | 4 | [] | no_license |
package exercise11;
/**
*
* @author Ibrahim Olanigan
*/
public class Factory extends FactoryBuilder{
@Override
public Dog CreateDog(String number) {
if(number.equals("2"))
return new Breed2();
else if(number.equals("3"))
return new Breed3();
return ... |
C++ | UTF-8 | 942 | 3.390625 | 3 | [] | no_license | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
struct Interval
{
int start, end;
};
bool compare(Interval i1, Interval i2)
{
return (i1.start < i2.start);
}
int main()
{
int n, a, b;
cout << "Enter no of values: ";
cin >> n;
Interval arr[n];
cout << "Enter Values: \n";
... |
C++ | UTF-8 | 4,594 | 3.515625 | 4 | [
"MIT"
] | permissive | #include <iostream>
using namespace std;
template <class T>
class Node
{
public:
Node<T> *lchild;
int data;
int height;
Node<T> *rchild;
};
template <class T>
class Tree
{
public:
Node<int> *root = NULL;
int NodeHeight(Node<T> *p)
{
int hl, hr;
hl = p && ... |
Java | UTF-8 | 3,070 | 2.90625 | 3 | [] | no_license |
package chord;
import peersim.core.Node;
import peersim.core.CommonState;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.Queue;
//clase que representa el comportamiento del usuario
public class Usuario{
long id;
ListaTareas lista;
ListaTareas colaAgregar;
int actual;
boolea... |
Python | UTF-8 | 2,097 | 3.703125 | 4 | [] | no_license | # school = "Digital School"
# print(school)
"Good Morning"
student1 = "Andrea"
student2 = "Zach"
student3 = "Michael"
student4 = "Rick"
# formatting = "Good Morning: {2} {3} {0} {0}".format(student1, student2, student3, student4)
# print(formatting)
# formatting = "Good mor\ning: {Andrea} {Zach} ".format(Andrea = ... |
Markdown | UTF-8 | 9,239 | 2.796875 | 3 | [] | no_license | ---
layout: post
title: "The future paradise of programming thanks to AWS Lambda functions : let's send a newsletter for a Jekyll github pages site with a Lambda"
date: 2015-12-26 23:00:51
categories: cloud
---
# Introduction
[AWS Lambda](http://docs.aws.amazon.com/lambda) is the future of programming :
- no more... |
Python | UTF-8 | 780 | 4.40625 | 4 | [
"Apache-2.0"
] | permissive | # Paul Caulfield, 2019
# My program takes a user input string and outputs every second word.
x=input("Please enter a sentence: ")
# x is the string input by the user.
secondword = (' '.join(x.split()[::2]))
# splits sentence "x" into words using whitespace as the delimiter - reference https://www.geeksforgeeks.org/py... |
Java | UTF-8 | 1,966 | 2.671875 | 3 | [] | no_license | package com.test.testNG;
import org.testng.annotations.AfterClass;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.AfterSuite;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.BeforeSui... |
JavaScript | UTF-8 | 646 | 3.625 | 4 | [] | no_license | /*
Al presionar el botón pedir números hasta que el usuario quiera,
sumar los que son positivos y multiplicar los negativos.*/
function mostrar()
{
var respuesta;
var sumaPositivos;
var multiplicacionNegativos;
sumaPositivos=0;
multiplicacionNegativos=1;
respuesta=true;
var numero;
do{
numero = parseIn... |
Java | UTF-8 | 997 | 2.640625 | 3 | [] | no_license | package dbiadun.MultiplexApp.helpers;
import java.time.LocalDateTime;
public class ReservationOutputData {
private int reservationId;
private double price;
private LocalDateTime expirationTime;
public ReservationOutputData() {
}
public ReservationOutputData(int reservationId, double price,... |
Java | UTF-8 | 13,378 | 1.640625 | 2 | [
"Apache-2.0"
] | permissive | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... |
C# | UTF-8 | 394 | 3.390625 | 3 | [] | no_license | using System;
namespace NavData
{
class Circle : Shape
{
private double r;
public Circle(double r)
{
Console.WriteLine("Init a Circle object");
this.r = r;
}
public override double Area()
{
Console.WriteLine("Calling Area ... |
JavaScript | UTF-8 | 720 | 2.640625 | 3 | [
"MIT"
] | permissive | 'use strict';
const paramNameMap = Object.freeze({
_: 'title',
y: 'year'
});
const normalizeName = name => {
const nameList = name.split(' ');
let normalizedList = nameList.map(currName => {
return encodeURI(currName);
});
normalizedList = normalizedList.join('+');
return normalizedList.toString()... |
C | UTF-8 | 18,235 | 2.90625 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include "hashtable.h"
#include "string.h"
const string hashtable_stack = "hashtable.c";
HashTable * getHT(int len)
{
if(len <= 0)
{
char buf[200];
sprintf_s(buf, "Out of bounds Error while trying to create a HashTable; negative length! Inputted length:... |
JavaScript | UTF-8 | 3,933 | 2.8125 | 3 | [] | no_license | import React, { useState, useEffect } from 'react';
import Axios from 'axios';
function ControlPannel() {
const [file,setFile] = useState(null)
const [listeTitle,setlisteTitle] = useState([])
const [listeEp, setlisteEp] = useState([])
const [adder, setAdder] = useState(false)
const [titreDatabase... |
C++ | UTF-8 | 927 | 3.140625 | 3 | [] | no_license | class Solution {
public:
bool wordPattern(string pattern, string str) {
unordered_map<char, string> w_str_map;
vector<string> str_vec = split_str(str);
if (pattern.length() != str_vec.size()) return false;
set<string> occur_set;
for (int i = 0; i < pattern.size(); i++) {
if (w_str_map.find(pattern[i]) =... |
Markdown | UTF-8 | 29,014 | 3.21875 | 3 | [] | no_license | # PT Master Mandiri v Yamazaki Construction (S) Pte Ltd
**Case Number** :Suit 155/
**Decision Date** :06 May 2000
**Tribunal/Court** :High Court
**Coram** :Judith Prakash J
**Counsel Name(s)** :Jeffrey Beh and Kelvin Tan (Lee Bon Leong & Co) for the plaintiffs; Thomas Lei (Chor Pee & Partners) for the defen... |
C++ | UTF-8 | 7,357 | 3.0625 | 3 | [] | no_license | #ifndef WAITQUEUE_H
#define WAITQUEUE_H
#include "abstractqueue.h"
#include <QMap>
#include <QMutex>
#include <QWaitCondition>
#define WAIT_DEFAULT_QUEUE_MAX_SIZE 20
/**
* if buffer overflow, will wait.
*/
template <typename T>
class WaitQueue: public AbstractQueue<T>{
typedef typename AbstractQueue<T>::Queue... |
Java | UTF-8 | 1,722 | 2.40625 | 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 cardholders;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Prope... |
C++ | UTF-8 | 1,731 | 2.640625 | 3 | [] | no_license | #ifndef __AZURITE__INNER__STATE_MACHINE
#define __AZURITE__INNER__STATE_MACHINE
#include <stack>
#include <queue>
#include <functional>
#include <memory>
#include <optional>
#include <string>
#include <optional>
namespace Azurite {
class Game;
class AState;
struct Event;
// State Manager Class
... |
Python | UTF-8 | 2,840 | 3.25 | 3 | [
"Apache-2.0"
] | permissive | '''Functions that are generic enough to not belong in any class'''
import numpy as np
def read(filelist):
'''Read in and concatenate a list of numpy files'''
data = []
for f in sorted(filelist):
x = np.load(f)
if len(data) == 0: data = x.copy()
else: data = np.concatenate([data, x]... |
Markdown | UTF-8 | 2,589 | 2.796875 | 3 | [] | no_license | Action planning
## Motivation
- We are going to die.
- Knowing your "Why"
## Discipline
You will never stay in same motivation.
> "Amateurs sit and wait for inspiration, the rest of us just get up and go to work."
> "We are what we repeatedly do."
Productivity is doing the right things consistently.
Momentum and i... |
Shell | UTF-8 | 432 | 3.21875 | 3 | [] | no_license | #! /bin/bash
#cat <<End-of
l="line 3"
read -p "press any key:" k
cat <<End-of-message
-------------------------------------
This is line 1 of the message.
This is line 2 of the message.
This is $l of the message.
This is line 4 of the message.
This is the last line of the message.
$k
----------------------------------... |
Java | UTF-8 | 6,185 | 2.484375 | 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 DAO;
import Conexion.Conexion;
import com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException;
imp... |
Java | UTF-8 | 6,119 | 2.640625 | 3 | [] | no_license | package com.cg.migrationapp.controller;
import java.io.IOException;
import java.sql.Date;
import java.sql.SQLException;
import java.time.LocalDate;
import java.util.ArrayList;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servl... |
C++ | UTF-8 | 1,567 | 2.78125 | 3 | [] | no_license | #include "Triangle.h"
Triangle::Triangle()
{
_triangleVertBuffer = 0;
_vertices = 0;
}
Triangle::~Triangle()
{
}
bool Triangle::Initialize(ID3D11Device* device, ID3D11DeviceContext* deviceContext)
{
HRESULT hr;
_indexCount = 3;
//Create the vertex buffer
Vertex v[] =
{
Vertex(0.0f, 0.5f, 0.5f, 1.0f, 0.0... |
C# | UTF-8 | 699 | 2.671875 | 3 | [] | no_license | using System;
using System.Web;
using AjaxControlToolkit;
public class CombineScriptsHandler : IHttpHandler
{
/// <summary>
/// ProcessRequest implementation outputs the combined script file
/// </summary>
/// <param name="context"></param>
public void ProcessRequest(HttpContext context)
{
... |
Java | UTF-8 | 1,048 | 2.265625 | 2 | [] | no_license | package me.lusu007.lobbysystem.Listener;
import me.lusu007.lobbysystem.System.main;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.PotionSplashEvent;
import org.bukkit.potion.PotionEffect;
/**
* ... |
Python | UTF-8 | 4,001 | 2.953125 | 3 | [] | no_license | # for a dict of arrays (dd), all same array size, write an arff file, converting complex data to magnitude and phase
""" for complex, had to unroll the loop to write a line of data - slows down about 7x!!
"""
import os
import numpy as np
from numpy.random.mtrand import uniform
# first, arrange a debug one way or an... |
Java | UTF-8 | 406 | 1.78125 | 2 | [] | no_license | package com.wit.hnxft.mapper;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import com.wit.fxp.nxft.domain.model.order.NxftOrder;
import com.wit.hnxft.model.HnxftOrderModel;
@Mapper
public interface HnxftOrderMapper {
HnxftOrderMapper INSTANCE = Mappers.getMapper(HnxftOrderMapper.class);
... |
C++ | UTF-8 | 1,719 | 2.59375 | 3 | [] | no_license | /*----------------------------------------------------------------------------*/
/* */
/* Module: main.cpp */
/* Author: Clara Gehm ... |
Java | UTF-8 | 4,098 | 2.171875 | 2 | [] | no_license | //USER INPUTS SHAPE
package com.umbrella.umbrella;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.support.v4.app.ActivityCompat;
import android.suppor... |
C++ | UTF-8 | 1,158 | 3.328125 | 3 | [
"MIT"
] | permissive | #include<vector>
#include<algorithm>
#include<iostream>
using namespace std;
class Solution {
public:
int islandPerimeter(vector<vector<int>>& grid) {
// 由于1 <= row, col <= 100, 故不需要判断空
int m = grid.size();
int n = grid[0].size();
int area = 0;
int conn = 0; // 每个格子的neighbor... |
Java | UTF-8 | 3,230 | 2.296875 | 2 | [] | no_license | package util;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.Select... |
Markdown | UTF-8 | 2,153 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | * * *
本项目是华为2019年软件精英挑战赛的[初赛题目](https://codecraft.huawei.com/Generaldetail)的实现,初赛排名**西北赛区 41 名**
[项目地址:https://github.com/WFrame0224/SDK_python](https://github.com/WFrame0224/SDK_python)
* * *
**目录**
- [1. 运行说明](#1-运行说明)
- [2. 程序数据结构](#2-程序数据结构)
- [3. 程序文档说明](#3-程序文档说明)
- [3.1 程序函数说明](#3-1-程序函数说明)
- [3.2 程序逻辑简要... |
Java | UTF-8 | 1,275 | 1.757813 | 2 | [] | no_license | import com.tencent.mobileqq.hotpatch.NotVerifyClass;
import com.tencent.mobileqq.utils.HttpDownloadUtil;
import com.tencent.qphone.base.util.QLog;
import cooperation.qzone.font.FontManager;
import java.io.File;
public class ymc
implements Runnable
{
public ymc(FontManager paramFontManager, String paramString, int ... |
JavaScript | UTF-8 | 744 | 2.984375 | 3 | [] | no_license | exports.trimMobile = (mobile) => {
mobile = mobile.trim()
mobile = mobile.split(" ").join("")
mobile = mobile.split("-").join("")
mobile = mobile.split("(").join("")
mobile = mobile.split(")").join("")
if (mobile.length > 9) {
switch (true) {
case mobile.startsWith('061'):
... |
Java | UTF-8 | 767 | 2.28125 | 2 | [] | no_license | package com.kesar.jetpackgank;
import android.annotation.SuppressLint;
import android.content.Context;
/**
* Global
*
* @author andy <br/>
* create time: 2019/2/20 15:08
*/
public class Global {
@SuppressLint("StaticFieldLeak")
private static Global sInstance;
private Context mContext;
private ... |
PHP | UTF-8 | 9,514 | 2.765625 | 3 | [] | no_license | <?php
namespace App\Controllers\Auth;
use Respect\Validation\Validator as v;
use App\Controllers\Controller;
use DB;
use App\Auth\Auth;
use App\Classes\UserActivity;
class AuthController extends Controller
{
/*******************************************************************************************************... |
Markdown | UTF-8 | 1,220 | 3.125 | 3 | [
"MIT"
] | permissive | # _BlackJack counter_
#### _05/10/2019_
#### By _**Olha Wysocky**_
## Description
_This is a web application that helps players of blackjack to count the chances of winning and suggest how much should they bet._
## Known Bugs
_No known bugs._
## Specs
- _Each card has an assigned value._
- _2 through 6 is +1_... |
Python | UTF-8 | 1,399 | 3.1875 | 3 | [] | no_license | # nltk & sklearn is used only for one time preprocessing, it does not need to be available in the server
import json
import pickle
from sklearn.metrics import pairwise_distances
from sklearn.feature_extraction.text import TfidfVectorizer
import nltk, string
'''
This script computes similarity for each pair of idioms ... |
SQL | UTF-8 | 181 | 3.171875 | 3 | [] | no_license | /* Problem Statement:
Give the name of the 'Peace' winners since the year 2000, including 2000.
*/
-- Solution:
SELECT winner FROM nobel
WHERE subject = 'Peace' AND yr >= 2000; |
Java | UTF-8 | 443 | 2.015625 | 2 | [] | no_license | package net.metrosystems.mylibrary3.data.repository;
import net.metrosystems.mylibrary3.data.model.entity.Book;
import net.metrosystems.mylibrary3.data.model.entity.Library;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface Libra... |
C | UTF-8 | 1,129 | 3.171875 | 3 | [] | no_license |
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <pthread.h>
void *runner(void *param);
int sum = 0;
int main(int argc,char** argv)
{
int n = atoi(argv[1]);
pthread_t tid;
pthread_attr_t attr;
pthread_attr_init(&attr);
pthread_create(&tid,&attr,runner,argv[1]);
pthread_... |
Markdown | UTF-8 | 777 | 2.828125 | 3 | [] | no_license | Pyg Scroller Demo
=================
Pyg Scroller Demo is an approach to creating a 2D world that can be explored, built on pygcurse and pygame. It features an image converter that creates a CSV map tile file, a shape creator, and an interpreter for hard-coded pixels. Pyg Scroller Demo's greatest strength is the delight... |
Java | UTF-8 | 2,880 | 2.0625 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2019 DeNA Co., Ltd.
*
* 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 agreed ... |
Java | UTF-8 | 172 | 2 | 2 | [] | no_license | package com.assessment.springboot_exception;
public class TransportNotFound extends RuntimeException{
public TransportNotFound(String msg) {
super(msg);
}
}
|
Python | UTF-8 | 331 | 2.90625 | 3 | [
"MIT"
] | permissive | import threading
import time
def run(n):
print("task", n)
time.sleep(1)
print('2s')
time.sleep(1)
print('1s')
time.sleep(1)
print('0s')
time.sleep(1)
if __name__ == '__main__':
# Python 多线程
t1 = threading.Thread(target=run, args=("t1",))
t2 = threading.Thread(target=run, args=("t2",))
t1.start()
t2.sta... |
Python | UTF-8 | 1,593 | 2.59375 | 3 | [] | no_license | from datetime import datetime, timedelta
from app_config import SECONDS_IN_HOUR, HOUR_FOR_CALC, MIDNIGHT, PROXIMITY_COLUMN, COMMENTS_AMOUNT_COLUMN, \
COMMENTS_AMOUNT_KEY, PUBLISH_TIME_KEY
from stories_util import get_top_stories
import pandas as pd
import seaborn as sn
import matplotlib.pyplot as plt
import numpy a... |
Java | UTF-8 | 112 | 1.851563 | 2 | [] | no_license | package com.tcGroup.trainingCenter.domain.enumeration;
public enum IterationUnit {
SECONDS,
QUANTITY
}
|
C++ | UTF-8 | 549 | 3.140625 | 3 | [] | no_license | #include <iostream>
#include <iomanip>
int main (int argc, const char * argv[]){
using namespace std;
/*int numeros[10];
for (int i=0; i<10; i++)
numeros[i]= 10 * (i+1);
cout << "Indice\tValor\n------\t------\n";
for (int i=0;i<10;i++)
cout << setw(6) << i << "\t" << setw(5) << numeros[i] << endl;
*/
... |
PHP | UTF-8 | 363 | 2.875 | 3 | [
"MIT"
] | permissive | <?php
namespace PhpJsonRpc\Server\Stub\ValueObject;
class Name
{
/**
* @var string
*/
private $value;
/**
* @param string $value
*/
public function __construct($value)
{
$this->value = $value;
}
/**
* @return string
*/
public function toNative()
... |
C | UTF-8 | 2,438 | 4.0625 | 4 | [] | no_license | #include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include "ListBaseStack.h"
// 연산자의 우선순위 정보 반환
// 값이 클수록 높은 우선순위
int GetOpPrec(char op)
{
switch(op)
{
case '*':
case '/':
return 5; // 가장 높은 우선순위
case '+':
case '-':
return 3;
case '(':
return 1; // 가장 낮은 우선순위
}
return -1; ... |
Java | UTF-8 | 33,163 | 2.34375 | 2 | [] | no_license | /*
* ClassicRules.java
*
* Created on July 30, 2005, 9:15 PM
*
*/
package org.invade.rules;
import java.util.ArrayList;
import java.util.Collections;
import java.util.EnumSet;
import java.util.List;
import org.invade.Board;
import org.invade.Card;
import org.invade.PlayableDeck;
import org.invade.CommonBoardEvent... |
C++ | UTF-8 | 1,464 | 2.578125 | 3 | [] | no_license | #ifndef L_H
#define L_H
//! The Laplace operator class
/*!
This class provides operators for computing the Laplacian
It can be applied on fourier transformed sets of wave functions
means on sets of fourier coefficients of plane wave functions
*/
//#include "checkOperatorSize.h"
#include "main.h"
#include "latexCo... |
JavaScript | UTF-8 | 898 | 2.515625 | 3 | [] | no_license | import {
GET_USER_CHAT,
GET_FULL_CHAT,
SEND_MESSAGE,
FILTER_CHAT,
} from "./chat.types";
const INITIALSTATE = {
userChats: [],
chats: [],
filtered: null,
};
const Chat = (state = INITIALSTATE, action) => {
const { type, payload } = action;
switch (type) {
case GET_USER_CHAT:
return {
... |
C++ | UTF-8 | 836 | 2.609375 | 3 | [
"MIT"
] | permissive | #pragma once
#include <iostream>
#include <string>
#include <vector>
#include "../utils/assets/Resource.h"
#include "../utils/scene/SceneManager.h"
#include "Tile.h"
class Grid {
public:
Grid();
bool loadMap(std::shared_ptr<Resource> data, std::shared_ptr<SceneManager> scene);
//
int getWidth();
int getHeig... |
Java | UTF-8 | 523 | 2.140625 | 2 | [] | no_license | package com.example.demo.controller;
import com.example.demo.dto.SiteInfo;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController... |
Ruby | UTF-8 | 594 | 2.59375 | 3 | [
"MIT"
] | permissive | require 'httparty'
class Push
def self.push_indefinitely()
polls_per_second = AppConfig.twitter_polls_per_hour / 60.0 / 60.0
desired_pause = 1.0 / polls_per_second
loop do
time_at_start = Time.now
push_once
poll_duration = Time.now - time_at_start
if desired_pause - poll_duration >... |
SQL | UTF-8 | 335 | 2.671875 | 3 | [
"Apache-2.0"
] | permissive |
CREATE TABLE DELEGATE_INFO(
ID BIGINT NOT NULL,
ASSIGNEE VARCHAR(200),
ATTORNEY VARCHAR(200),
START_TIME DATETIME,
END_TIME DATETIME,
PROCESS_DEFINITION_ID VARCHAR(100),
TASK_DEFINITION_KEY VARCHAR(100),
STATUS INTEGER,
TENANT_ID VARCHAR(64),
CONSTRAINT PK_DELEGATE_INFO PRIMARY KEY(ID)
) ENGINE=INNODB... |
Markdown | UTF-8 | 3,253 | 3.125 | 3 | [] | no_license | # 摘要
* 现维护项目中使用的表单验证
>strtus1的xml验证插件 + ActionForm。
>>xml插件验证的问题
>>>得给每一个action的每一个表单属性做配置,现在超过2000多行。根据需求增改页面都要有输入->确认->完成页面。增和改其实是个重复的逻辑。因为这些原因导致配置文件里有两份同样的配置。
>>ActionForm的问题
>>>ActionForm里做的是xml难以实现的验证。比如验证是否同名(需要操作数据库),或者一个表单属性涉及到其他表单属性。经常维护发现,很多都是重复性的代码,而且,遇到几十个表单属性的情况,简直就是灾难。
* spring
>项目里已经导入spring 3.x
>>sprin... |
Markdown | UTF-8 | 2,417 | 3.6875 | 4 | [] | no_license | #### 变量的类型
`undefined`, `number`, `string`, `boolean`属于简单的值类型.函数、数组、对象、null、new Number(10)都是对象。他们都是引用类型。
> 一切引用类型都是对象,对象是属性的集合
```js
typeof "x" //string
typeof 10 //number
typeof true //boolean
typeof x //undefine
typeof null //object
typeof function(){} //function
function(){} instanceof Object //true
... |
PHP | UTF-8 | 653 | 2.515625 | 3 | [] | no_license | <?php
namespace php_boilerplate\plugins\other;
use \marshall\core\Menu as Menu;
use \marshall\core\MenuItem as MenuItem;
class _plugin extends \marshall\core\BasePlugin {
private $name = "Other Links";
public function getPluginName(){
return $this->name;
}
public function addMenuItems(){
$node = ... |
Markdown | UTF-8 | 1,284 | 3.0625 | 3 | [
"MIT"
] | permissive | # README.md
koa2的一个中间件,用于处理vue-router使用history模式返回index.html,让koa2支持SPA应用程序。 \
我只是一个搬运工,让它兼容Koa2而已。详细说明请到原作者项目库查看\
[bripkens作者的connect-history-api-fallback](https://github.com/bripkens/connect-history-api-fallback)
## Install
```bash
$ npm install --save 'koa2-connect-history-api-fallback'
```
## Use
在... |
Python | UTF-8 | 1,612 | 3.25 | 3 | [] | no_license | import numpy as np
import matplotlib.pyplot as plt
import csv
category = ["Ecological Well-being", "Health & Human Services", "Arts & Culture", "Community Building", "Environment"]
arr = np.empty((0, 6), str)
moneyGranted = [[0]*5 for _ in range(6)]
moneyRequested = [[0]*5 for _ in range(6)]
perFull = [[0]*5 f... |
Markdown | UTF-8 | 6,911 | 2.875 | 3 | [] | no_license | # EzDrive: An iOS platform for car-sharing
This repo holds the source code for a project completed for NUS Orbital Program held during the summer of 2018.
Embarassingly, there are no commits for this project because at the time of creating this application, I was not yet
familiar with source control and thus did not ... |
Java | UTF-8 | 463 | 2.703125 | 3 | [] | no_license | @Override public void update(Command command) throws IllegalArgumentException {
if (command instanceof OpenClosedType) {
state=(OpenClosedType)command;
}
else {
final String updatedValue=command.toString();
if (openString.equals(updatedValue)) {
state=OpenClosedType.OPEN;
}
else if (clos... |
Go | UTF-8 | 308 | 3.328125 | 3 | [] | no_license | package cyclelinkedlist
type ListNode struct {
Val int
Next *ListNode
}
func hasCycle(head *ListNode) bool {
slowP := head
fastP := head
for slowP != nil && fastP != nil && fastP.Next != nil {
slowP = slowP.Next
fastP = fastP.Next.Next
if slowP == fastP {
return true
}
}
return false
}
|
JavaScript | UTF-8 | 1,947 | 2.625 | 3 | [] | no_license | import React, { Component } from 'react';
import { connect } from "react-redux";
import './style.css';
import {addTask, chngId} from "../../actions"
const mapDispatchToProps = dispatch => {
return {
addTask: task => dispatch(addTask(task)),
chngId: id => dispatch(chngId(id)),
};
};
const mapStateToProps... |
Java | UTF-8 | 3,630 | 1.984375 | 2 | [
"Apache-2.0",
"GPL-2.0-only",
"EPL-2.0",
"CDDL-1.0",
"MIT",
"BSD-3-Clause",
"Classpath-exception-2.0"
] | permissive |
package com.commercetools.api.predicates.query.subscription;
import java.util.function.Function;
import com.commercetools.api.predicates.query.*;
public class ResourceUpdatedDeliveryPayloadQueryBuilderDsl {
public ResourceUpdatedDeliveryPayloadQueryBuilderDsl() {
}
public static ResourceUpdatedDelivery... |
Markdown | UTF-8 | 533 | 2.515625 | 3 | [] | no_license | # This is the front-end of click-stream analysis
The click-stream software a.k.a Divolte collector is going to collect data from this web-site.
# How to use this
- The `environment.yml` file has all dependencies in it
> Use setup the flask environment create a new environment using `environment.yml` file
- Open ... |
Java | UTF-8 | 7,936 | 2.46875 | 2 | [] | no_license | package com.tminions.app.screenController;
import com.tminions.app.Utils.AlertBox;
import com.tminions.app.controllers.ConflictsController;
import com.tminions.app.models.ConflictModel;
import com.tminions.app.models.ResolvedConflictModel;
import javafx.collections.FXCollections;
import javafx.collections.ObservableLi... |
Java | UTF-8 | 856 | 2.25 | 2 | [] | no_license | package com.jsd.blibiliclient.di.module;
import com.jess.arms.di.scope.ActivityScope;
import dagger.Module;
import dagger.Provides;
import com.jsd.blibiliclient.mvp.contract.TabCategoryContract;
import com.jsd.blibiliclient.mvp.model.TabCategoryModel;
@Module
public class TabCategoryModule {
private TabCategor... |
Java | UTF-8 | 1,030 | 2.171875 | 2 | [] | no_license | package com.example.smartutor.model;
import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;
import java.time.LocalDateTime;
import java.util.List;
@Dao
public interface LessonDao {
... |
PHP | UTF-8 | 668 | 2.703125 | 3 | [] | no_license | <?php
class Member{
private $database;
function Member(){
// $this->database = new db();
}
/*根据username取得所有字段的值*/
public function getMemberMsgByUsername($username){
$sql = "select * from ".DBPREFIX."member where username='".$username."'";
return DB::get_all($sql);
}
/*根据数组插入新会员*/
... |
Java | UTF-8 | 614 | 1.921875 | 2 | [] | no_license | package org.takeback.util.task.schedule;
import java.io.PrintStream;
import org.joda.time.DateTime;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
public class Task
implements Job
{
public void execute(JobExecutionContext jobExecutionContext)
throws Job... |
TypeScript | UTF-8 | 1,615 | 2.90625 | 3 | [] | no_license | import { MTask, ITask } from "./task.model";
import { MTag } from "./tag.model";
type stringOrNull = string | null;
export class MListOfTasks {
public listId: number;
public title: string;
public tag: MTag;
public color: stringOrNull;
public isFavorite: boolean;
public isFixed: boolean;
pu... |
Java | UTF-8 | 302 | 1.765625 | 2 | [] | no_license | package DOMNodes;
public interface IDOMEdgeNode extends IDOMNode {
IDOMClassNode getFrom();
IDOMClassNode getTo();
void addAttribute(String dotAttrName, String property);
String getAttribute(String graphvizKey);
String attributeMapToString();
void set(IDOMClassNode start, IDOMClassNode end);
}
|
Java | UTF-8 | 1,905 | 1.59375 | 2 | [] | no_license | /*
* Copyright (c) 2016 Brett Profitt.
*
* This file is part of the Elgg support plugin for JetBrains PhpStorm IDE.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of t... |
Java | UTF-8 | 403 | 2.859375 | 3 | [] | no_license | package com.dlh.zambas.executor;
public class WorkerThread implements Runnable{
private String command;
public WorkerThread(String command) {
this.command = command;
}
@Override
public void run(){
try {
Thread.sleep(1000);
System.out.println(Thread.currentThread().getName()+ " is running **** " ... |
Java | UTF-8 | 3,579 | 2.8125 | 3 | [] | no_license | package com.ssitcloud.common.util;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.util.Date;
import org.apache.commons.beanutils.BeanUtils;
import org.springframework.util.StringUtils;
import com.mongodb.BasicDBObject;
import com.mongodb.DBObject;
import com.mongodb.W... |
Python | UTF-8 | 2,321 | 4.09375 | 4 | [] | no_license | """
1156. Swap For Longest Repeated Character Substring (Medium)
Given a string text, we are allowed to swap two of the characters in the string. Find the length of the longest substring with repeated characters.
Example 1:
Input: text = "ababa"
Output: 3
Explanation: We can swap the first 'b' with the last 'a', or... |
PHP | UTF-8 | 4,232 | 2.6875 | 3 | [] | no_license | <?
/**
* The Galleries controller class.
*
* @author Yarick
* @version 0.1
*/
class Controller_Backend_Galleries extends Controller_Backend_Standard
{
/**
* @see parent::getModelName()
*/
protected function getModelName( $method = null )
{
if ( in_array( $method, array('items', 'addi', 'editi', 'deli'... |
C | GB18030 | 2,495 | 2.6875 | 3 | [] | no_license | #include "led.h"
#include "beep.h"
#include "delay.h"
#include "usart.h"
extern int time; // ٶ
extern int speed_falg; // ƿƱ־λ
extern int led_speed_num; // ĸ
extern int led_speed_arr_flag[]; // Ƶı־
extern int led_arr_flag[]; // Ƶı־
// תǰҪļҪ
// תʱgofindȻ
void LED_Init(void)
{
// GPIOϢṹ
GPIO_InitTypeDef GPIO_InitStru... |
C++ | UTF-8 | 482 | 2.71875 | 3 | [] | no_license | //UVa Problem-11634(Generate random numbers)
//Accepted
//Running time: 0.120 sec
#include<iostream>
#include<set>
using namespace std;
int main(){
int n;
while(cin>>n && n){
set<int>suru;
suru.insert(n);
while(true){
n=n*n;
n/=100;
n%=10000;
... |
Java | UTF-8 | 313 | 2.75 | 3 | [] | no_license | package com.logical;
public class ReturnTest {
//type instance-varibale;
int var=10;
//type methodname(parameter-list) {
//}
public static void main(String[] args) {
boolean t=true;
System.out.println("Before the Return.");
if(t) return;
System.out.println("is this line will execute?");
}
}
|
JavaScript | UTF-8 | 1,110 | 3.421875 | 3 | [] | no_license | export const toRomNum = (num) => {
const numVals = [
["M", 1000],
["D", 500],
["C", 100],
["L", 50],
["X", 10],
["V", 5],
["I", 1],
];
let start;
for (let i = 0; i < numVals.length; i++) {
if (numVals[i][1] < num + 1) {
start = i;
break;
}
}
if (!start && s... |
Markdown | UTF-8 | 3,510 | 4.0625 | 4 | [] | no_license | 自己在写代码时对this的指向总是靠猜的,这里整理一下。
this是什么?
> 在函数内部,有两个特殊的对象:arguments和this。this引用的是函数据以执行的环境对象。this对象是在运行时基于函数的执行环境绑定的。
this有什么用处?
> this用于在js函数调用时指明函数调用上下文,建立函数内部与调用上下文之间的联系。此处尤其需要注意的是,只有当函数调用时,this建立的上下文联系才存在;仅仅定义函数而不调用,this所建立的上下文联系并不存在。并且这种上下文联系的类型,决定于函数调用的方式。
### 函数调用方式
+ 方法调用模式
+ 函数调用模式
+ 构造器调用模式
+ apply/cal... |
PHP | UTF-8 | 3,370 | 2.90625 | 3 | [] | no_license | <?php
/**
* Objeto referente a la tabla de base de datos 'responsabilidad'.
*
* @author Emanuel Carrasco
* @copyright
* @license
*/
namespace Application\Model\Entity;
/**
* Define el objeto Responsabilidad y el intercambio de información con el hydrator.
*/
class Responsabilidad
{
private $rpo_id;
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.