language stringclasses 15
values | src_encoding stringclasses 34
values | length_bytes int64 6 7.85M | score float64 1.5 5.69 | int_score int64 2 5 | detected_licenses listlengths 0 160 | license_type stringclasses 2
values | text stringlengths 9 7.85M |
|---|---|---|---|---|---|---|---|
Java | UTF-8 | 1,495 | 2.6875 | 3 | [] | no_license | package com.cashstar.util;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import java.io.Serializable;
@AllArgsConstructor
@NoArgsConstructor
public class ApiResponse<T> implements Serializable {
private static final long serialVersionUID = 5011111620028706233L;
private String message;
... |
JavaScript | UTF-8 | 1,027 | 3.015625 | 3 | [
"MIT"
] | permissive | 'use strict';
////////////////////////////////////////////////////////////////////////////////
/// A filter to generate a new array with the in _input specified parameters.
/// This filter is primarly needed for the ng-reapeat directive.
/// Usage examples:
///
/// <div ng-repeat="n in [10] | makeRange">Do something 0... |
JavaScript | UTF-8 | 2,097 | 3.546875 | 4 | [] | no_license | /* globals binarysearchtree*/
(function(){
'use strict';
describe('Binary Search Tree', function(){
describe('nodes', function(){
beforeEach(function(){
this.node = new binarysearchtree.Node();
});
it('has attributtes left, right and data, node is an object instance of Node', functi... |
JavaScript | UTF-8 | 2,482 | 2.640625 | 3 | [] | no_license | TrelloClone.Routers.Boards = Backbone.Router.extend({
initialize: function (options) {
this.$rootEl = options.$rootEl;
},
routes: {
"": "boardsIndex",
"boards/new": "newBoard",
"boards/:id": "showBoard",
"lists/:id": "showList",
"cards/:id": "showCard",
"boards/:board_id/lists/new": "... |
Java | UTF-8 | 5,803 | 1.890625 | 2 | [] | no_license | package cn.qingchengfit.student.item;
import android.support.graphics.drawable.VectorDrawableCompat;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.TextView;
import cn.qingchengfit.saascommon.filter.model.Content;
impor... |
SQL | UTF-8 | 912 | 2.640625 | 3 | [
"Apache-2.0"
] | permissive | /*
Navicat MySQL Data Transfer
Source Server : LinuxMySQL
Source Server Version : 50713
Source Host : 192.168.1.249:3306
Source Database : JCharm
Target Server Type : MYSQL
Target Server Version : 50713
File Encoding : 65001
Date: 2016-07-26 22:21:15
*/
SET FOREIGN_... |
C++ | UTF-8 | 13,922 | 3.484375 | 3 | [] | no_license |
#include "SVD.h"
#include <assert.h>
#include <algorithm>
#include <math.h>
#include <cmath>
#include <stddef.h>
namespace SVD
{
//------------------------------------------------------------------------------
/** @brief Computes the eigenvectors of symmetric square matrix with a SVD.
@details The singular valu... |
C++ | UTF-8 | 3,316 | 2.75 | 3 | [] | no_license | #include "DynamicLightManager.h"
namespace arcane { namespace graphics {
// TODO: Add functionality so it can update with an entity's position and orientation
DynamicLightManager::DynamicLightManager()
: m_DirectionalLight(glm::vec3(0.0f, 0.0f, 0.0f), glm::vec3(0.0f, 0.0f, 0.0f), glm::vec3(0.0f, 0.0f, 0.0f), glm... |
C++ | UTF-8 | 1,408 | 3.328125 | 3 | [] | no_license | //
// main.cpp
// Direct Address Table
//
// Created by Alexis Quinto on 6/10/20.
// Copyright © 2020 Alexis Quinto. All rights reserved.
//
#include <iostream>
#define MAX_SIZE 1000
#define NIL 0
class Node {
public:
int key;
int satellite;
Node(int k, int s) {
key = k;
satellit... |
C# | UTF-8 | 569 | 2.703125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace OperacaoCaixa.Core.Models
{
public class Pessoa
{
[Key]
public string Id { get; set; }
public string Identidade { get; set; }
public string Nome { get; set; }
/// <su... |
Java | UTF-8 | 6,469 | 2.40625 | 2 | [] | no_license | package uk.co.codingcraft.armstrong.model;
import org.apache.commons.lang.builder.ToStringBuilder;
import javax.persistence.*;
import java.util.Collection;
import java.util.Date;
import java.util.Set;
@Entity
@Table(name = "feeds")
public class Feed {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Colum... |
Markdown | UTF-8 | 9,353 | 3.1875 | 3 | [] | no_license | ---
layout: post-normal
title: The Economics of Information
date: 2014-10-20 09:00:11
tag:
categories:
- microeconomics
excerpt:
permalink: /information
comments: true
---
Neoclassical economics: a particular approach to economics with a particular set of assumptions about market participants and associate... |
SQL | UTF-8 | 2,247 | 3.234375 | 3 | [
"Apache-2.0"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.4.10
-- http://www.phpmyadmin.net
--
-- Client : localhost:8889
-- Généré le : Mar 10 Avril 2018 à 14:56
-- Version du serveur : 5.5.42
-- Version de PHP : 7.0.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTE... |
C++ | UTF-8 | 5,928 | 2.65625 | 3 | [] | no_license | #include "GLTexture.h"
namespace hj
{
GLTexture::GLTexture(const glm::ivec3& dimensions, GLint internalformat, GLint format,
GLenum dataType, Filter filter)
: dimensions_(dimensions)
, format_(format)
, internalformat_(internalformat)
, dataType_(dataType)
, filter_(filter)
, wrapping_(GL... |
Java | UTF-8 | 7,331 | 2.59375 | 3 | [] | no_license | package javaMVCViews;
import javaMVCControllers.*;
import java.awt.BorderLayout;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JSplitPane;
import javax.swing.JDesktopPane;
import javax.swing.JInternalFrame;
import java.awt.Di... |
Markdown | UTF-8 | 1,239 | 3.484375 | 3 | [] | no_license | - “is preceded by” = “comes after” = [2] ← [1] (replace phrase by “comes after” or an arrow/←)
- ex 1: “2 is preceded by 1” = “2 comes after 1” = “2 ← 1” (1 then 2) = 1, 2
- ex 2: “A is preceded by B” = “A comes after B” = “A ← B” (B then A) = B, A
- Lena is preparing for an important coding competition that is... |
Java | UTF-8 | 1,764 | 1.984375 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2010-2011 the original author or authors.
*
* 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 ap... |
C++ | UTF-8 | 281 | 2.71875 | 3 | [] | no_license |
#include "Exceptions/UnknownValueException.hpp"
UnknownValueException::UnknownValueException(const std::string& strValue) throw()
: AException("Unknown value: '" + strValue + "'. Possibles values 'U', '0' and '1'") { }
UnknownValueException::~UnknownValueException() throw() { } |
C++ | WINDOWS-1250 | 18,658 | 3.25 | 3 | [] | no_license | #include "Tree.h"
using namespace std;
//-------KOSTRUKTORY I DESTRUKTORY-------------
Tree::Tree() {
root = nullptr;
valueFunction = 0;
}
Tree::Tree(const Tree &other) {
root = new Node(*other.root);
valueFunction = other.valueFunction;
}
Tree::~Tree() {
delete root;
}
//-----------OPERATORY---------
... |
Java | UTF-8 | 1,326 | 3.59375 | 4 | [
"MIT"
] | permissive | package aula11;
public class Professor extends Pessoa{ //Herança, Professor herda (extends) da classe abstrata Pessoa
//Atributos
private String especialidade;
private float salario;
//Metodos
public void inforProfessor(){
System.out.println("Especialista em: " + this.getEspecialidade... |
PHP | UTF-8 | 1,579 | 2.640625 | 3 | [
"MIT"
] | permissive | <?php
/**
* Created by PhpStorm.
* User: 天宇
* Date: 2019/5/5
* Time: 22:36
*/
namespace App\Http\Models\currency;
use Illuminate\Database\Eloquent\Model;
class CapitalModel extends Model
{
/*资金表*/
protected $table = 'capital';
protected $guarded = ['id'];
/**
* 交易类别
*
* @var array
... |
Python | UTF-8 | 299 | 3.203125 | 3 | [] | no_license |
def triplet(vsota):
for b in range (1, vsota // 2):
for a in range (1, vsota):
c = vsota - b - a
if c ** 2 == (a ** 2) + (b ** 2):
zmnozek = a * b * c
return(zmnozek)
break
return False
print (triplet(1000))
|
C++ | UTF-8 | 4,370 | 3.265625 | 3 | [] | no_license | #include<cppstdlib.hpp>
typedef vector<vector<char>> BOARD;
typedef pair<int,int> XY;
class Solution {
public:
void solve(vector<vector<char>> &board) {
if (board.size()==0)return;
wanderEast(board);
wanderSouth(board);
wanderWest(board);
... |
Python | UTF-8 | 1,523 | 3.984375 | 4 | [] | no_license | # 숫자야구
import random
class Baseball:
def __init__(self):
self.ans = ""
self.result = []
print("Baseball 클래스 객체 생성")
def setAns(self):
nums = list(range(1, 10))
for i in range(3):
a = random.choice(nums)
self.ans = self.ans ... |
Ruby | UTF-8 | 256 | 2.5625 | 3 | [] | no_license | class Location < ActiveRecord::Base
validates :lat, presence: true
validates :long, presence: true
def self.nearby(lat,lon)
where("lat > ?", lat-0.01) && where('lat < ?', lat+0.01) && where("long > ?",lon-0.01) && where('long < ?',lon+0.01)
end
end
|
C++ | UTF-8 | 3,851 | 2.890625 | 3 | [] | no_license | #include "game.h"
#include <algorithm>
#include <cassert>
#include <cstdint>
#include <cstdio>
#include <string>
#include <tuple>
#include "game_bot.h"
Game::Game() {
reset();
_load_game_history();
}
void Game::reset() {
_grid.reset();
_game_status_string = "";
_statistics.start_new_game();
}
b... |
TypeScript | UTF-8 | 5,376 | 2.796875 | 3 | [
"MIT"
] | permissive | import { Texture } from '../textures/Texture';
import { BaseRenderTexture } from './BaseRenderTexture';
import type { MSAA_QUALITY } from '@pixi/constants';
import type { Rectangle } from '@pixi/math';
import type { Framebuffer } from '../framebuffer/Framebuffer';
import type { IBaseTextureOptions } from '../textures/... |
JavaScript | UTF-8 | 5,762 | 2.53125 | 3 | [] | no_license | /**
* Route Mappings
* (sails.config.routes)
*
* Your routes map URLs to views and controllers.
*
* If Sails receives a URL that doesn't match any of the routes below,
* it will check for matching files (images, scripts, stylesheets, etc.)
* in your assets directory. e.g. `http://localhost:1337/images/foo.jpg`... |
C | UTF-8 | 605 | 2.515625 | 3 | [] | no_license | #include "sensors.h"
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include <unistd.h>
#include <pthread.h>
int main(int argc, char *argv[]) {
int n, *who;
int count = 0;
srand(time(NULL));
pthread_t sen[NUM_OF_SENSORS];
pthread_mutex_init(&lock, NULL);
pthread_cond_init(&self, NULL);
while... |
Java | UTF-8 | 765 | 2.5625 | 3 | [
"MIT"
] | permissive | package io.devfactory.core.di;
import org.junit.Test;
import java.util.Calendar;
import static org.junit.Assert.assertEquals;
public class DateMessageProviderTest {
@Test
public void 오전() throws Exception {
DateMessageProvider provider = new DateMessageProvider();
assertEquals("오전", provide... |
Java | UTF-8 | 656 | 2.34375 | 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 expression;
import tools.*;
import java.io.*;
/**
*
* @author Denisa
*/
public class ConstExp extends exp implements Seriali... |
C# | UTF-8 | 1,591 | 2.78125 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | using System.Collections;
using System.Collections.Generic;
namespace NuGet.CommandLine.Test.Caching
{
public class CachingValidations : IEnumerable<CachingValidation>
{
private readonly IDictionary<CachingValidationType, CachingValidation> _validations
= new Dictionary<CachingValidationTyp... |
Shell | UTF-8 | 728 | 3.515625 | 4 | [
"Apache-2.0"
] | permissive | #!/bin/sh
# maven version
HIGH_VERSION='3'
LOW_VERSION='.6.0'
if [ -n "$1" ]; then
HIGH_VERSION=$1
fi
if [ -n "$2" ]; then
LOW_VERSION=$2
fi
echo $HIGH_VERSION$LOW_VERSION
# download Maven
MAVEN_FILE="apache-maven-$HIGH_VERSION$LOW_VERSION-bin.tar.gz"
cd /usr && \
wget http://mirror.bit.edu.cn/apache/m... |
Ruby | UTF-8 | 1,033 | 2.578125 | 3 | [] | no_license | class Player < ActiveRecord::Base
include BCrypt
validates :name, uniqueness: true, presence: true
validates :password, presence: true
has_secure_password
attr_accessor :position, :keys, :gems, :coins, :steps, :current_level
def password
@password ||= Password.new(password_digest)
end
def ... |
C++ | UTF-8 | 1,377 | 2.578125 | 3 | [
"MIT"
] | permissive | #include <glow/RenderBufferObject.h>
#include <cmath>
#include <glow/Error.h>
#include <glow/ObjectVisitor.h>
namespace glow
{
RenderBufferObject::RenderBufferObject()
: Object(genRenderBuffer())
{
}
RenderBufferObject::~RenderBufferObject()
{
if (ownsGLObject())
{
glDeleteRenderbuffers(1, &m_id);
CheckGLErr... |
Java | UTF-8 | 717 | 2.359375 | 2 | [] | no_license | package com.rockbite.bootcamp.shop;
import com.rockbite.bootcamp.product.ProductCategory;
import com.rockbite.bootcamp.product.ProductStack;
import com.rockbite.bootcamp.product.ProductType;
import java.util.HashMap;
/**
* Simple interface to host shop API methods
* **/
public interface IShop {
HashMap<Produ... |
Rust | UTF-8 | 906 | 3.609375 | 4 | [] | no_license | use rand::Rng;
pub fn qsort(elements: &[i32]) -> Vec<i32> {
if elements.is_empty() {
return vec![];
}
let pivot_i = rand::thread_rng().gen_range(0..elements.len());
let pivot = elements[pivot_i];
let mut smaller: Vec<i32> = Vec::with_capacity(elements.len());
let mut bigger: Vec<i32> =... |
Java | UTF-8 | 2,354 | 2.21875 | 2 | [] | no_license | /**
* This file is part of
*
* CRAFTY - Competition for Resources between Agent Functional TYpes
*
* Copyright (C) 2014 School of GeoScience, University of Edinburgh, Edinburgh, UK
*
* CRAFTY is free software: You can redistribute it and/or modify it under the
* terms of the GNU General Public License as publ... |
C | UTF-8 | 1,279 | 3.4375 | 3 | [] | no_license | #include <string.h>
#include "Queue.h"
#define Queue_index(queue, distance) ((queue->front + (distance)) % queue->capacity)
void Queue_init(struct Queue* queue, unsigned int elem_size, void* memory, unsigned int capacity)
{
queue->elem_size = elem_size;
queue->memory = (char*)memory;
queue->capacity = cap... |
JavaScript | UTF-8 | 3,204 | 2.53125 | 3 | [] | no_license |
function degs(rads){
return rads*(180/Math.PI)
}
function rads(degs){
return degs*(Math.PI/180)
}
function move(obj,pos,spd,multiplier,twntype,twninout,callback,delay){
// console.log('move operation')
var start = {x: obj.position.x, y: obj.position.y, z: obj.position.z}
var dist = multiplier*((Math.abs(obj.posit... |
C++ | UTF-8 | 1,447 | 2.703125 | 3 | [
"MIT"
] | permissive | // https://codefights.com/interview-practice/task/bdatSZvuKFyjJ8eYw
vector<vector<int>>adj;
vector<int>color;
int totColors;
const int MAX_COLORS_ALLOWED = 5;
bool isSafe(int node,int colr){
for(int i=0;i<adj[node].size();i++){
if(color[adj[node][i]]==colr)return false;
}
return true;
}
bool colorGraphUtil... |
C++ | UTF-8 | 23,735 | 2.609375 | 3 | [] | no_license | /* Copyright (C)
*
* Copyright 2013 Matthew Everett Hoggan
*
* 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 appli... |
C++ | UTF-8 | 1,546 | 2.53125 | 3 | [
"MIT"
] | permissive | #pragma once
#include "Output/MessageSender.h"
#include "Input/MessageReceiver.h"
#include "Input/ConnectionReceiver.h"
#include "../../Models/MessageModels/Message.h"
#include "../../Models/MessageModels/Messages/PrivateMessage.h"
#include "../../Models/MessageModels/Messages/GroupMessage.h"
//#include "../../Models... |
Python | UTF-8 | 344 | 3.28125 | 3 | [] | no_license | class prime_num:
def prime_num(y):
"""y as function to calculate prime numbers from 0 to n"""
if count > 1:
""" count is any number greater than 1"""
if count == count%1:
return count
"""count is only divisible by 1"""
elif count == count%count:
"""count is only divisible by itself"""
r... |
C++ | UTF-8 | 9,697 | 2.75 | 3 | [
"MIT",
"GPL-2.0-only",
"LicenseRef-scancode-unknown-license-reference",
"GPL-3.0-only",
"LGPL-2.1-or-later",
"LGPL-2.0-or-later",
"EPL-1.0",
"LicenseRef-scancode-generic-exception",
"GPL-1.0-or-later",
"BSL-1.0",
"LGPL-2.0-only",
"BSD-2-Clause"
] | permissive | /** \file
* \brief declaration and implementation of FaceArray class
*
* \author Carsten Gutwenger
*
* \par License:
* This file is part of the Open Graph Drawing Framework (OGDF).
*
* \par
* Copyright (C)<br>
* See README.md in the OGDF root directory for details.
*
* \par
* This program is free software;... |
Java | UTF-8 | 1,272 | 3.25 | 3 | [] | no_license | package mine.test.question;
import mine.test.domain.ListNode;
import org.junit.Test;
import java.util.ArrayList;
import java.util.List;
public class 两两交换链表中的节点 {
@Test
public void run() {
ListNode l1 = new ListNode(1);
l1.next = new ListNode(2);
l1.next.next = new ListNode(3);
... |
Python | UTF-8 | 1,987 | 2.625 | 3 | [] | no_license | import os
from PyQt5 import QtWidgets, uic
from PyQt5.QtWidgets import QFileDialog
nome_arquivo = None
def CarregarArquivo():
global nome_arquivo
nome_arquivo = janela.lineEdit.text()
if nome_arquivo=="":
return
try:
arq = open(nome_arquivo, 'r')
janela.campotexto_arquivo.setPl... |
Markdown | UTF-8 | 1,602 | 2.796875 | 3 | [] | no_license | ## Ingredients
* 6 eggs
* 8 cloves garlic
* 1 bunch cilantro (or pennyroyal or mint, depending on taste)
* 6 slices alentejano bread (stale), or thick rustic bread baked over a wood fire
* ¼ cup olive oil
* 8 cups water
* Salt
* Pepper
## Ingredients - HALF
* 3 eggs
* 4 cloves garlic
* 1/2 bunch cilantro (or pennyroya... |
Java | UTF-8 | 2,766 | 2.703125 | 3 | [] | no_license | package hr.fer.zemris.java.hw13.model;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.pe... |
Java | UTF-8 | 239 | 1.765625 | 2 | [] | no_license | package com.bm.web.service;
import com.bm.web.pojo.Book;
import java.util.List;
public interface BookService {
List<Book> findAll();
void deleteBook(String bno);
void addBook(Book book);
void updateBook(Book book);
}
|
C | GB18030 | 1,242 | 2.75 | 3 | [] | no_license | #include "stm32f10x.h"
#include "key.h"
#include "sys.h"
#include "delay.h"
#include "led.h"
#include "timer.h"
//ʼ
//PA15PC5 ó
void KEY_Init(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC,ENABLE);//ʹPORTA,PORTCʱ
GPIO_PinRemapConfig(GPIO_Remap_SWJ_JTAGDisable, ENABLE)... |
Python | UTF-8 | 960 | 4.28125 | 4 | [] | no_license | # tic tac toe
# What are the things/nouns in the game? board, x's, o's, blanks, lines
# What are the actions/verbs? whose turn it is, piece being added, next person's turn
# What properties and parameters for each? location, type added, result(win or whatnot)
# How can we support any board size?
# How can we support ... |
JavaScript | UTF-8 | 3,127 | 3.046875 | 3 | [] | no_license | "use strict";
const con = document.querySelector('.con');
const scoreshow = document.querySelector('.score')
let blackarr = [];
let blackdivarr = [];
let score = 0
var timer;
let startflag = 0; //1表示开始
(function changescreen() {
let a = window.screen.width / 1650;
document.body.style.zoom = a;
})();
function... |
Markdown | UTF-8 | 5,449 | 3.109375 | 3 | [] | no_license | # Flask-Vue Example
This is a simple example of how to use Vue in a non-SPA context. At the first commit is a simple Flask app serving simple html pages to 2 routes, `/index` and `/about`. The main repository is after integration with Vue, with changes I will explain here.
## Initial State
Initially there is a file ... |
Rust | UTF-8 | 10,099 | 2.71875 | 3 | [] | no_license | extern crate arrayvec;
extern crate find_folder;
extern crate vecmath;
extern crate piston_window;
use arrayvec::ArrayVec;
use piston_window::*;
use vecmath::*;
const HEIGHT: u32 = 480u32;
const WIDTH: u32 = 640u32;
const LINE_WIDTH: f64 = 2.0;
const BOARD_WIDTH: usize = 8;
const CELL_WIDTH: f64 = HEIGHT as f64 / BO... |
PHP | UTF-8 | 1,158 | 2.65625 | 3 | [] | no_license | <?php
/**
* Copyright (C) StormGames, Inc - All Rights Reserved
* Unauthorized copying of this file, via any medium is strictly prohibited
* Proprietary and confidential
* Written by Eren Ahmet Akyol <ahmederen123@gmail.com>, July 2019
*/
declare(strict_types=1);
namespace StormGames\SGCore\commands;
use poc... |
C# | UTF-8 | 1,840 | 2.84375 | 3 | [] | no_license | using Microsoft.ML.Runtime.Api;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace DemandForBikeSharing
{
public class BikeSharingDemandData
{
[ColumnName("Score")]
public float PredictedCount;
}
public class BikeSharingDemandSample
{
[Column("... |
C++ | UTF-8 | 1,294 | 2.734375 | 3 | [
"MIT"
] | permissive | /**
* \file
* \brief Unit Test for Device
* \author Uilian Ries <uilianries@gmail.com>
*/
#ifndef SMARTAQUARIUM_DUMMY_DEVICE_HPP_
#define SMARTAQUARIUM_DUMMY_DEVICE_HPP_
#include "device/device.hpp"
namespace smartaquarium {
namespace test {
/**
* \brief Unit Test for Device
*/
class dummy_device : publi... |
Go | UTF-8 | 2,752 | 3.0625 | 3 | [
"MIT"
] | permissive | //
// Check commit message according to angularjs guidelines:
// https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit#
//
// Copyright 2014 TLD dotHIV Registry GmbH.
// @author Markus Tacker <m@dotHIV.org>
//
package validator
import (
"fmt"
"regexp"
"strings"
)
type CommitMessageVa... |
PHP | UTF-8 | 2,340 | 3.59375 | 4 | [] | no_license | <?php
define('BR', '<br />');
//
// Exercices autour des tableaux
//
// 1.
// Créer un tableau vide.
// Remplissez ce tableau avec les valeurs de 1 à 1000.
$tab = [];
for ($i = 1; $i < 1001; $i++){
$tab[] = $i;
}
// a) En parcourant le tableau, affichez tous les multiples de 3.
// b) En parcourant le tableau, affi... |
Java | UTF-8 | 234 | 1.929688 | 2 | [] | no_license | package com.light.common.result;
/**
* @ClassName IStatusCode
* @Description: 状态接口
* @Author Administrator
* @Date 2021/1/7 19:59
**/
public interface IStatusCode {
int getStatusCode();
String getMessage();
}
|
PHP | UTF-8 | 5,209 | 3.046875 | 3 | [] | no_license | <style>
table {
font-family: arial, sans-serif;
border-collapse: collapse;
width: 100%;
}
td, th {
border: 1px solid #dddddd;
text-align: left;
padding: 8px;
}
tr:nth-child(even) {
background-color: #dddddd;
}
</style>
<!--
The following... |
C# | UTF-8 | 7,645 | 2.625 | 3 | [] | no_license | using System;
using System.Collections;
using System.Collections.Generic;
using System.Web;
using System.Linq;
using EPiServer.Logging.Compatibility;
namespace Creuna.Episerver.RedirectHandler.Core.CustomRedirects
{
/// <summary>
/// A collection of custom urls
/// </summary>
public class CustomRed... |
PHP | UTF-8 | 2,126 | 2.65625 | 3 | [] | no_license | <?php
/**
* -- Consigne --
* Vous travaillez pour un cinéma et devez créer une base de données de film.
* Votre base de données s’appellera « exercice_3 ».
* Vous devrez ensuite créer un script qui permettra d’ajouter et d’afficher des films.
* Suivez les étapes.
*/
// Inclusion de base
require_once('./inc/ini... |
PHP | UTF-8 | 784 | 2.6875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | <?php
class State
{
function __construct()
{
$this->tableName='state_mst';
$this->CI =& get_instance();
$this->CI->load->model('AdminModel');
}
function createState($state)
{
$data['state_name'] = $state;
return $this->CI->AdminModel->insertData($data,$this->tableName);
}
function checkState($sta... |
Java | UTF-8 | 140 | 1.960938 | 2 | [] | no_license | package com.evideo.kmbox.exceptionhandler;
public interface ExceptionHandlerInterface {
public void handle(Exception ex);
}
|
Java | UTF-8 | 1,122 | 2.3125 | 2 | [
"Apache-2.0",
"DOC"
] | permissive | /**
* THINGS/THINGER 2009
* Copyright Erich P Gatejen (c) 2001 through 2009 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/... |
PHP | UTF-8 | 1,372 | 2.53125 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
/**
* first entrance for all http request
* all it does is to include coslib/head.php
* which then will bootstrap your application
*/
// define a base path
$path = dirname(__FILE__);
$path = realpath($path . "/../");
// make it work on both windows and unix
if (DIRECTORY_SEPARATOR != '/') {
$path = str... |
JavaScript | UTF-8 | 716 | 2.625 | 3 | [] | no_license | const EventListener = function (obj) {
let Register = {};
obj.on = function (type , method) {
if(Register.hasOwnProperty(type)){
Register[type].push(method);
}else {
Register[type]=[method];
}
};
obj.fire= function (type) {
if (Register.hasOwnProperty(type))... |
TypeScript | UTF-8 | 2,466 | 2.96875 | 3 | [] | no_license | import validateResultBuilder, { Validation } from "./validateResultBuilder";
export default function validate(jsonString: string): Validation {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let json: Record<string, any> = {};
const validateBuilder = validateResultBuilder();
try {
json = J... |
Java | UTF-8 | 591 | 2.890625 | 3 | [] | no_license | package com.codeclan.example.vending_machine.models;
public class Coin {
private CoinType coinType;
private Long id;
public Coin(CoinType coinType){
this.coinType = coinType;
}
public Coin(){
}
public CoinType getCoinType() {
return coinType;
}
public void setC... |
Markdown | UTF-8 | 1,562 | 4.375 | 4 | [] | no_license |
---
layout: post
title: Optional arguments
date: 2017-11-23
---
### Optional arguments
I were asked to Create a function that sums two arguments together. If only one argument is provided, then return a function that expects one argument and returns the sum. For example, addTogether(2, 3) should return 5, and addT... |
Java | UTF-8 | 919 | 2.21875 | 2 | [] | no_license | package com.example.dtdorganizer.controller;
import com.example.dtdorganizer.model.Food;
import com.example.dtdorganizer.model.User;
import com.example.dtdorganizer.service.UserService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.CrossOrigin;
import o... |
Java | UTF-8 | 3,236 | 2.25 | 2 | [] | no_license | package application.repository;
import application.Entity.UserJob;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org... |
Go | UTF-8 | 3,016 | 2.9375 | 3 | [
"Beerware"
] | permissive | package engine
import (
"fmt"
"github.com/go-gl/glow/gl-core/4.4/gl"
"io"
"os"
"strings"
)
type ShaderKind uint32
const (
VertexShader ShaderKind = gl.VERTEX_SHADER
TessControlShader = gl.TESS_CONTROL_SHADER
TessEvaluationShader = gl.TESS_EVALUATION_SHADER
GeometryShader ... |
C++ | UTF-8 | 456 | 2.90625 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <algorithm>
#include <execution>
using namespace std;
int main()
{
std::vector<int> longVector;
// Find element using parallel execution policy
auto result1 = std::find(std::execution::par, std::begin(longVector), std::end(longVector), 2);
// Sort eleme... |
Python | UTF-8 | 926 | 3.0625 | 3 | [] | no_license | from collections import *
import itertools
import random
import sys
import re
f = open("map.txt").read().strip("\n")
d = {
"N": (0, -1),
"E": (1, 0),
"S": (0, 1),
"W": (-1, 0)
}
positions = []
x, y = 5000, 5000
m = defaultdict(set)
prev_x, prev_y = x, y
distances = defaultdict(int)
dist = 0
for c in ... |
C++ | UTF-8 | 1,134 | 2.59375 | 3 | [] | no_license | #ifndef __PLOTTER_HPP__
#define __PLOTTER_HPP__
#include <string>
#include <vector>
#include "nlohmann/json.hpp"
struct canvas{
std::string name;
int height;
int width;
std::string title;
std::string histclass;
};
struct marker{
int style;
int color;
float size;
};
struct line{
int style;
int co... |
Markdown | UTF-8 | 3,591 | 2.671875 | 3 | [
"CC-BY-4.0",
"MIT"
] | permissive | ---
title: Практическое руководство. Обрезка изображения
ms.date: 03/30/2017
dev_langs:
- csharp
- vb
helpviewer_keywords:
- images [WPF], cropping
- cropping images [WPF]
ms.assetid: c6bba109-c6e7-4cf8-bfe6-9cf8d01bb4fc
ms.openlocfilehash: 46c559356447688e52508b823cc260c13128208f
ms.sourcegitcommit: 3d5d33f3... |
SQL | UTF-8 | 1,895 | 4.65625 | 5 | [] | no_license |
-- 1. To get salary information join salary and employees tables
SELECT employees.emp_no,
employees.last_name,
employees.first_name,
employees.gender,
salaries.salary
FROM employees
INNER JOIN salaries ON
employees.emp_no = salaries.emp_no;
-- 2. To get employees hired in 1986
SELECT * from employees
WHERE EXTR... |
Markdown | UTF-8 | 14,287 | 2.515625 | 3 | [] | no_license | ---
title: "Guide pratique pour créer des groupes de sécurité réseau en mode classique à l’aide d’Azure CLI | Microsoft Docs"
description: "Découvrez comment créer et déployer des groupes de sécurité réseau en mode classique à l"aide de l’interface de ligne de commande Azure"
services: virtual-network
document... |
Markdown | UTF-8 | 788 | 2.671875 | 3 | [
"Apache-2.0"
] | permissive | # Jarnite Battle Grounds
*Jarnite Battle Grounds - A Text-Based Adventure Game*
## About the Game
Jarnite Battle Grounds is a Text-Based Adventure Game created and developed by Tech4K Studios and b1he.
You spawn in a 5x5 map, battling with 3 other NPCs to win the hacker race. There are various tools and hacks scatte... |
Go | UTF-8 | 14,842 | 3.09375 | 3 | [
"MIT"
] | permissive | // Package dataflatten contains tools to flatten complex data
// structures.
//
// On macOS, many plists use an array of maps, these can be tricky to
// filter. This package knows how to flatten that structure, as well
// as rewriting it as a nested array, or filtering it. It is akin to
// xpath, though simpler.
//
// ... |
C# | UTF-8 | 3,012 | 3.0625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
namespace DDLogReader
{
public class LogWriter : IDisposable {
private FileStream File {get;set;}
private TextWriter Writer {get;set;}
private Random Rng { get; } = new Random();
private i... |
JavaScript | UTF-8 | 123 | 2.6875 | 3 | [] | no_license | const ul = document.body.firstElementChild.nextElementSibling;
const firstLi = ul.firstElementChild;
console.log(firstLi); |
Python | UTF-8 | 4,387 | 3.625 | 4 | [
"Apache-2.0"
] | permissive | '''
Complex Arithmetic
Number 1+ sqrt(-1)
Rectangular ComplexRI(1,1)
Polar ComplexMA(sqrt(2),pi/4)
'''
# Use c omplex numers to preform computation whole data values x.add(y). x.mul(y)
# add complex number real and imaginary parts real, imag, ComplexRI
# multiply complex number ... |
Markdown | UTF-8 | 1,312 | 3.4375 | 3 | [
"BSD-3-Clause",
"CC-BY-SA-4.0",
"CC-BY-4.0"
] | permissive | ---
id: 5900f3f21000cf542c50ff05
challengeType: 5
title: 'Problem 134: Prime pair connection'
videoUrl: ''
localeTitle: 'Problema 134: conexión de primer par'
---
## Description
<section id="description"> Considere los primos consecutivos p1 = 19 y p2 = 23. Se puede verificar que 1219 es el número más pequeño, de modo... |
Ruby | UTF-8 | 2,298 | 2.703125 | 3 | [] | no_license | class Transaction < ActiveRecord::Base
# attr_accessible :date_of, :transaction_type, :description, :amount, :transaction_cleared, :account_id, :category_id, :notes, :to_transaction_id, :from_transaction_id, :balance_to_date
belongs_to :account
belongs_to :category
before_save :format_debit_amount, if: :debit?
... |
Python | UTF-8 | 1,644 | 2.875 | 3 | [] | no_license | from pwn import *
char = [48,49,50,51,52,53,54,55,56,57,97,98,99,100,101,102]
def setValue(data,position,value):
arr = bytearray(data)
arr[position] = char[int(value / 16)]
arr[position + 1] = char[int(value % 16)]
return bytes(arr)
def accept(input):
server.recvuntil('cipher = ')
server.send... |
Java | UTF-8 | 946 | 3.21875 | 3 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Alumnos;
/**
*
* @author Jesus Andres
*/
public class AlumnoPrimaria extends Alumnos{
private int grado;
... |
Python | UTF-8 | 4,194 | 3.484375 | 3 | [] | no_license | # Inspired by https://blog.confiant.com/confiant-malwarebytes-uncover-steganography-based-ad-payload-that-drops-shlayer-trojan-on-mac-cd31e885c202
# Creates an image file out of a string of characters, with each color (RGB) being a different ASCII character.
from math import ceil
from PIL import Image
def generate_i... |
Shell | UTF-8 | 13,908 | 3.625 | 4 | [] | no_license | #!/bin/bash
# bash -x simple-pki.sh intra.example.org
export CN=$1
export DC0=`echo $CN | awk -F '.' '{print $3}'`
export DC1=`echo $CN | awk -F '.' '{print $2}'`
export DC2=`echo $CN | awk -F '.' '{print $1}'`
export SAN="\
DNS:$CN,\
DNS:*.$CN,\
DNS:dev$CN,\
DNS:*.dev$CN,\
DNS:test$CN,\
DNS:*.test$CN,\
... |
Python | UTF-8 | 777 | 3.25 | 3 | [
"MIT"
] | permissive | def solution(budgets, M):
budgets.sort()
answer = binarySearch(budgets, M)
return answer
def binarySearch(budgets, M):
answer = 0
left = 1
right = budgets[-1]
while(left<=right):
mid = (left+right) // 2
sumOfBudgets = 0
for i in range(len(budgets)):
... |
TypeScript | UTF-8 | 1,325 | 3.484375 | 3 | [] | no_license | import Queue from "../src/Queue";
import Node from "../src/Node";
test("Smoke test ...", () => {
expect(true).toEqual(true);
});
describe("Queue", () => {
let queue: Queue;
beforeEach(() => {
queue = new Queue();
});
test("should be empty", () => {
expect(queue.isEmpty()).toEqual... |
Markdown | UTF-8 | 3,315 | 3.265625 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | ---
alias: [VWAP Cross]
created: 2021-03-03T00:44:31 (UTC +11:00)
tags: [VWAP Cross, VWAP Cross]
source: https://www.investopedia.com/terms/v/vwap-cross.asp
author: James Chen
---
# VWAP Cross
> ## Excerpt
> A VWAP cross is a trading indicator that occurs when a security’s price crosses the volume-weighted average pr... |
JavaScript | UTF-8 | 100 | 2.78125 | 3 | [] | no_license | function add(arg1, arg2) {
return arg1 + arg2;
}
console.log(add("Usama", "Akmal"), add(1, 5));
|
TypeScript | UTF-8 | 1,279 | 2.59375 | 3 | [
"MIT"
] | permissive | import { addChildAt, removeChildAt } from './utils';
import {
wrapperClass,
} from './constants';
import { ContainerProps } from './interfaces';
import { DropResult, OnDropCallback } from './exportTypes';
export function domDropHandler({ element, draggables }: ContainerProps) {
return (dropResult: DropResult, onDrop... |
Java | UTF-8 | 1,324 | 2.46875 | 2 | [] | no_license | package com.aldoreyes.imageprocessing.async;
import java.lang.ref.WeakReference;
import java.util.Arrays;
import java.util.List;
import android.graphics.Bitmap;
import android.os.AsyncTask;
import android.util.Log;
public class HistogramAsyncTask extends
AsyncTask<Bitmap, Integer, List<Integer>> {
private WeakRe... |
Java | UTF-8 | 2,296 | 2.359375 | 2 | [] | no_license |
package org.csc.phynixx.logger;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
public class Log4jLogger implements IPhynixxLogger {
private Logger log= null;
Log4jLogger(Class cls) {
this.log=LogManager.getLogger(cls);
}
Log4jLogger(String logger) {
this.log... |
JavaScript | UTF-8 | 1,697 | 2.921875 | 3 | [] | no_license | (function() {
app = app || {};
app.Search = Backbone.Model.extend({
defaults: {
words: []
},
// root: this.parseWordsToTree(this.words),
parseWordsToTree: function() {
var root = new Node();
var word, node;
var i, j;
var words = this.get('words');
for (i = 0; i < words.length; i++) {
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.