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,825 | 2.84375 | 3 | [] | no_license | // Условия задачи
// Добавьте в шаблон страницы home список со свойством name из следующего массива:
// ```
// var people = [{name: 'Vasya', age: 20, email: 'vasya@mail.ru', employed: false},
// {name: 'Masha', age: 25, email: 'm@m', employed: true},
// {name: 'Petya', age: 27, email: 'petya@stuff', empl... |
C# | UTF-8 | 1,044 | 2.59375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ShegzstuffPC.Models
{
class WhatsappUrl : INotifyPropertyChanged
{
private string zewhatsappurl;
public WhatsappUrl()
{
}... |
Java | UTF-8 | 2,940 | 3.8125 | 4 | [] | no_license | ///name: date:
//first program on queues.
import java.io.*;
import java.util.*;
public class SongQueue
{
private static Scanner infile;
private static Queue<String> songQueue;
public static void main(String[] args) throws Exception
{
fillPlayList();
printSongList();
infile = new Sca... |
Java | UTF-8 | 799 | 3.015625 | 3 | [] | no_license | package com.sergeev.task1.creator;
import com.sergeev.task1.entity.IntArrayWrapper;
import com.sergeev.task1.exception.IntArrayWrapperException;
import java.util.Random;
public class ArrayRandomCreator {
private static final int RANDOM_NUMBER_OF_ARRAY = 900;
private static final Random random = new Random()... |
C# | UTF-8 | 2,622 | 2.890625 | 3 | [] | no_license |
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using CsvHelper;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.ModelBinding;
namespace OutputFormatterSample.Controllers
{
[Route("api/[controller]")]
[ApiController]
public c... |
C++ | UTF-8 | 4,014 | 3.296875 | 3 | [] | no_license | #include <iostream>
#include <cstdbool>
#include <vector>
#include <queue> //queue and priority queue
#include <map>
#include <utility> //for pairs
using namespace std;
//GRAPH-------------------
#define INF INT_MAX
typedef pair<int, int> ii; // vertex, weight
typedef map<int, vector<ii> > GRAPH; //graph contains no n... |
Java | UTF-8 | 4,929 | 2.640625 | 3 | [] | no_license | import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.net.InetAddress;
import ja... |
Java | UTF-8 | 1,870 | 3.640625 | 4 | [] | no_license |
public class ListApp {
public static void main(String[] args){
FirstList<String> stringFirstList = new FirstList<>(7);
FirstList<Square> squareFirstList = new FirstList<>();
FirstList<PointClass> point3dFirstList = new FirstList<>(4);
stringFirstList.addItem("Nathan Johnson");
... |
Java | UTF-8 | 2,041 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | package models;
import java.util.List;
import javax.persistence.*;
import play.data.validation.Constraints.Required;
import play.db.ebean.Model;
import play.db.ebean.Model.Finder;
@Entity
public class Location extends Model {
static Finder<Integer, Location> find = new Finder<Integer, Location>(Integer.class, L... |
C++ | UTF-8 | 2,491 | 2.53125 | 3 | [] | no_license |
// 题意:把一个图,添加一些边,变成一个大环
//shuangde
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <queue>
#include <cmath>
#include <cstring>
#include <string>
#include <map>
#include <set>
#define MP make_pair
#define SQ ((x)*(x))
#define CLR(a,b) memset(a, (b), sizeof(a))
#define cmax(a,b) a=m... |
Java | UTF-8 | 377 | 3.046875 | 3 | [] | no_license | public class SubwayClub extends Salad {
public SubwayClub(SubwaySub newSubwich){
super(newSubwich);
//System.out.println("Adding Subway Club");
}
public String getDescription(){
return subwich.getDescription()+super.getDescription() + "Subway Club";
}
public double getCost() {
System.out.println("Cost of S... |
Go | UTF-8 | 1,986 | 3.015625 | 3 | [] | no_license | package main
/*
* @lc app=leetcode id=1307 lang=golang
*
* [1307] Verbal Arithmetic Puzzle
*
* https://leetcode.com/problems/verbal-arithmetic-puzzle/description/
*
* algorithms
* Hard (37.72%)
* Likes: 152
* Dislikes: 52
* Total Accepted: 4.5K
* Total Submissions: 11.9K
* Testcase Example: '["SEN... |
JavaScript | UTF-8 | 1,891 | 3.65625 | 4 | [] | no_license | //resize input to be as large as possible on the 500x500 canvas with a 5px margin (so 490x490)
//takes a binarized input
function resizeInput(ctx,data){
//get an image of the input cropped as tightly as possible
var lowerCoords = []; //[x,y]
var upperCoords = []; //[x,y]
//get lower x boundary
outerLoop: //l... |
C# | UTF-8 | 3,302 | 2.640625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using MilleniumApplication.Models;
namespace MilleniumApplication.Controllers
{
[Produces("application/json")]
[... |
Shell | UTF-8 | 1,320 | 3.765625 | 4 | [
"MIT"
] | permissive | #!/bin/sh
### BEGIN INIT INFO
# Provides: mangosd
# Required-Start: $local_fs $remote_fs $network $syslog $named
# Required-Stop: $local_fs $remote_fs $network $syslog $named
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# X-Interactive: false
# Short-Description: mangosd service
### END INIT INFO
. /etc/init.d/functi... |
C++ | UTF-8 | 619 | 3.15625 | 3 | [] | no_license | #ifndef PLAYER_H
#define PLAYER_H
#include "All.h"
class Player
{
private:
Board *pboard; //Pointer to the current board
marker symbol; //The symbol this player plays as, either cross or knot
bool isAI; //Decides if the players are AIs or humans
public:
Player(Board *board, marker symbol, bool isAI = false);
~Pl... |
Python | UTF-8 | 2,058 | 3.5 | 4 | [] | no_license | from Crypto.Hash import MD5
class ListNode:
def __init__(self, val):
self.val = val
self.next = None
class MyHashSet:
def __init__(self, capacity=5):
self.capacity = capacity
self.data = [None] * capacity
def encrypt(self,key): #加密
... |
Java | UTF-8 | 1,521 | 2.203125 | 2 | [] | no_license | package io.egen.entity;
import javax.persistence.*;
import java.sql.Timestamp;
import java.util.UUID;
@Entity
@NamedQueries({
@NamedQuery(
name="Alert.fetchHighAlertsWithinLast2Hours",
query="select a from Alert a where a.priority='HIGH' and a.timestamp<=NOW()a... |
C++ | UTF-8 | 358 | 2.5625 | 3 | [] | no_license | #pragma once
#include <vector>
#include <gl_object.h>
#include "gl_graphic_buffer.h"
class VertexArray : GLObject {
private:
unsigned int id;
GLGraphicBuffer* elementBuffer;
std::vector<GLGraphicBuffer*> buffers;
public:
VertexArray(std::vector<int>* const indicesData, std::vector<float>* const verticesDat... |
Python | UTF-8 | 776 | 4.4375 | 4 | [] | no_license | #Emily Addison
#104553525
#Assignment 3
# Function to decipher if the number is prime or composite
def prime_or_composite(n):
has_divisor = False
i =2
for i in range(2, n):
if ((n % i) == 0):
has_divisor = True
break
if(has_divisor == True):
prin... |
C++ | UHC | 3,715 | 2.640625 | 3 | [] | no_license | #define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<cstring>
#include<string>
#include<cstdio>
#include<stack>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<ctime>
using namespace std;
int arr[502][502] = { 0, };
int main() {
int N, M;
cin >> N >> M;
for (int i = 0; i < N; i++... |
Shell | UTF-8 | 1,933 | 3.796875 | 4 | [] | no_license | #!/bin/sh
mem_limit="100"
sch_str="epg_dir"
file_url="http://epg_archive_source/"
file_name="epg.tar.gz"
file_conf="/var/tuxbox/config/neutrino.conf"
if [ -d /tmp ]
then
tmp_dir="/tmp"
fi
if [ -d /temp ]
then
tmp_dir="/temp"
fi
echo `cat $file_conf | grep $sch_str` > $tmp_dir/conf
source $tmp_dir/conf
psize=${#epg_... |
PHP | UTF-8 | 2,049 | 2.84375 | 3 | [] | no_license | <?php
namespace App\Services;
use Hhxsv5\LaravelS\Swoole\WebSocketHandlerInterface;
use Swoole\Http\Request;
use Swoole\WebSocket\Server;
use Swoole\WebSocket\Frame;
/**
* @see https://wiki.swoole.com/wiki/page/400.html
*/
class WebSocketService implements WebSocketHandlerInterface
{
/**
* 实例化的对象
* @... |
TypeScript | UTF-8 | 3,466 | 3.359375 | 3 | [] | no_license | import { IPlayer } from "./player";
import { ScoreCardV2 } from "./scorecardV2";
enum JudgementPhase {
NotStarted,
Started,
Finished
}
/**
* JudgementPhaseManager - Ensures everyone has set judgement correctly
* 1. Start with currentPlayer = startPlayer
* 2. Wait for judgement from currentPlayer
*... |
Python | UTF-8 | 906 | 2.765625 | 3 | [] | no_license | #!/usr/bin/env python
''' Posts info from Google Finance to Notification Center '''
import argparse
import sys
import googlefinance
import pync
def get_quotes(symbol):
"""Get a quote and notify"""
quote = googlefinance.getQuotes(symbol)[0]
url = 'https://www.google.com/finance?q=' + symbol
subtitle ... |
Markdown | UTF-8 | 3,803 | 2.9375 | 3 | [
"Apache-2.0"
] | permissive | # 概述
**抽象工厂模式(Abstract Factory)**,提供一个创建一系列相关或相互依赖对象的接口,而无需指定它们具体的类。
# UML

## 解析
`AbstractProductA` 和 `AbstractProductB` 是两个抽象产品,之所有为抽象,是因为它们都有可能有两种不同的实现,例如 `ProductA1` 、 `ProductA2` 和 `ProductB1` 、 `ProductB2` 就是对两个抽象产品的具体实现。
`IFactory` 是一个抽象工厂接口,里面包含了所有的产品创建的抽象方法。
通常是在运行时刻再创建一个 `Conc... |
Java | UTF-8 | 425 | 2.265625 | 2 | [] | no_license | package com.example.threadclassloader;
public class ThreadClassLoaderTest {
public static void main(String[] args) {
testThreadContext();
}
public static void testThreadContext(){
Thread currentThread = Thread.currentThread();
ClassLoader contextClassLoader = currentThread.getContextClassLoader();
// curr... |
Python | UTF-8 | 656 | 4.375 | 4 | [] | no_license | """Write a funtion named uses_only taht takes a word and a string of
letters, and that returns True if the word contains only the letters
in the list. Can you make a sentence using only the letters
"acefhlo"? (other than "Hoe alfalfa"?)"""
def uses_only(word, letters):
for letter in word:
if lette... |
Java | UTF-8 | 817 | 2.5 | 2 | [] | no_license | package eir.world.environment.nav;
import com.badlogic.gdx.math.Vector2;
import eir.world.environment.Anchor;
import eir.world.environment.Asteroid;
import eir.world.unit.Unit;
public class SurfaceNavNode extends NavNode implements Anchor
{
/**
* index of the asteroid containing this nav node
*/
final int ... |
C# | UTF-8 | 2,480 | 3.84375 | 4 | [
"MIT"
] | permissive | namespace _1_3.StudentExercises
{
using System;
class StudentExercises
{
static void Main()
{
// Make two instance of the class "Student"
Student pesho = new Student("Pesho", "Peshov", "Peshev", 8203173804, "Sofia city", 0888334455,
"pesho@mail.bg", ... |
Java | UTF-8 | 442 | 2.21875 | 2 | [] | no_license | package lsp.poligonos;
import lsp.Poligono;
public class Retangulo extends Poligono {
private Integer largura;
private Integer altura;
public Integer getLargura() {
return largura;
}
public void setLargura(Integer largura) {
this.largura = largura;
}
public Integer getAl... |
Python | UTF-8 | 104 | 3.15625 | 3 | [] | no_license | s = raw_input()
def f(s):
for u,v in zip(s,s[1:]):
if u == v:return 'Bad'
return 'Good'
print f(s) |
C++ | UTF-8 | 2,085 | 3.34375 | 3 | [] | no_license | /**
* @brief a segment tree, or a fenwick tree
* @tparam Monoid (commutativity is not required)
*/
template <class Monoid>
struct segment_tree {
typedef typename Monoid::underlying_type underlying_type;
int n;
vector<underlying_type> a;
const Monoid mon;
segment_tree() = default;
segment_tree... |
PHP | UTF-8 | 2,749 | 2.6875 | 3 | [] | no_license | <?php
session_start();
if(!isset($_SESSION['login'])){
$_SESSION['login']="incorreto";
}
if($_SESSION['login']== "correto" && isset($_SESSION['login'])){
if($_SERVER['REQUEST_METHOD']=="GET"){
if(!isset($_GET['obra']) || !is_numeric($_GET['obra'])){
e... |
C++ | UTF-8 | 4,219 | 3.0625 | 3 | [] | no_license | #ifndef UTILITIES_HPP
#define UTILITIES_HPP
#include <iostream>
#include <sstream>
#include <functional>
#include <algorithm>
#include <random>
#include <unistd.h>
template <class V> auto idxs(V const &v) {
std::vector<int> result;
for (int i = 0; i < v.size(); ++i)
result.push_back(i);
return result;
}
t... |
Python | UTF-8 | 307 | 3.421875 | 3 | [] | no_license | number_one = int(input("number 1: "))
number_two = int(input("number 2: "))
number_three = int(input("number 3: "))
if number_one + number_two == number_three or number_one + number_three == number_two or number_two + number_three == number_one:
print("this works")
else:
print("this doesn't work") |
Python | UTF-8 | 773 | 2.71875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
import re
from flask import Flask, jsonify, render_template, request
app = Flask(__name__)
@app.route('/_calculate')
def calculate():
number1 = request.args.get('number1', '0')
operator = request.args.get('operator', '+')
number2 = request.args.get('number2')
m = re.match('-?\... |
JavaScript | UTF-8 | 3,719 | 2.515625 | 3 | [] | no_license | import React from 'react';
import { RouteHandler } from 'react-router';
import jQuery from 'jquery';
// Only include Bootstrap & Google Maps if run in the browser
if(typeof window !== "undefined"){
window.jQuery = jQuery;
var Bootstrap = require('bootstrap');
var GoogleMapsLoader = require('google-maps');
}
imp... |
Java | UTF-8 | 1,508 | 3.640625 | 4 | [] | no_license | package com.haripadisetti.java8;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;
class Product{
private int id;
private String name;
private double price;
public Product(int id, String name, double price) {
super();
this.id = id;
this.name = name;
this.p... |
Java | UTF-8 | 299 | 2.546875 | 3 | [] | no_license | package com.codingdojo.calculator2;
public class Calculator2Test {
public static void main(String[] args) {
Calculator2 calc = new Calculator2();
calc.performOperation(10.5);
calc.performOperation("*");
calc.performOperation(5.2);
calc.performOperation("=");
calc.getResults();
}
}
|
Java | UTF-8 | 151 | 1.539063 | 2 | [] | no_license | package ee.itcollege.team11;
import java.io.Serializable;
public abstract class BaseEntity implements Serializable, Creatable, Updatable {
}
|
Python | UTF-8 | 1,429 | 3.859375 | 4 | [] | no_license | def swap(a,b):
temp=a
a=b
b=temp
def quicksort(array):
key=array[len(array)-1]
k=0
if len(array)!=0:
for i in range(0,len(array)-1):
if(array[i]<key):
temp=array[i]
array[i]=array[k]
array[k]=temp
k+=1
if(i==len(array)):
temp=array[len(array)-1]
array[len(array)-1]=array[k]
ar... |
Python | UTF-8 | 1,347 | 3.6875 | 4 | [
"MIT"
] | permissive | import string
import unittest
from collections import Counter
from main import extract_characters, generate_password
class TestPasswordGenerator(unittest.TestCase):
def setUp(self):
self.length = 10
self.alphabets = 3
self.digits = 7
def test_extract_characters(self):
"""test... |
Java | UTF-8 | 2,347 | 3.21875 | 3 | [
"BSD-3-Clause"
] | permissive | import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Queue;
import java.util.concurrent.ArrayBlockingQueue;
public class Day17 {
private static MessageDigest digest;
private static final boolean[] OPEN = { false, false, false, false, false, false, false, false, fals... |
Java | UTF-8 | 2,753 | 2.28125 | 2 | [
"MIT"
] | permissive | package mcjty.rftoolscontrol.blocks.vectorart;
import io.netty.buffer.ByteBuf;
import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraf... |
Python | UTF-8 | 7,466 | 3.421875 | 3 | [] | no_license | import enchant
from random import randint
"""
FUTURE NOTES
Does not support punctuation
Does not work efficiently on long inserts for the subsitution decoder (nor does it return the correct answer on small ones)
Caesar cipher works perfectly fine
GOALS
connect to a web app
"""
class Answers():
def __init__(self, ... |
Java | UTF-8 | 1,693 | 2.1875 | 2 | [
"MIT"
] | permissive | /*
* This file is part of Nucleus, licensed under the MIT License (MIT). See the LICENSE.txt file
* at the root of this project for more details.
*/
package io.github.nucleuspowered.nucleus.services.impl.placeholder.standard;
import io.github.nucleuspowered.nucleus.services.interfaces.IPermissionService;
import org... |
Python | UTF-8 | 757 | 2.671875 | 3 | [
"BSD-2-Clause"
] | permissive | from ln.backend import interpolation
from ln.backend.datatype import Datatype
import numpy as np
import pytest
def test_none():
a = [1, 3, None, 4, None]
assert interpolation.none(a, None, None) == a
def test_zero():
d = Datatype('int32')
a = [1, 3, None, 4, None]
result = interpolation.zero(a, ... |
Python | UTF-8 | 372 | 4.28125 | 4 | [] | no_license | print('Faizan Jamil')
names = ['Susan', 'James', 'Roger', 'Bryan', 'Jacob']
print('Size of list is: ' + str(len(names)))
ages = [16, 18, 22, 21, 20]
i = 0
j = 0
for x in names:
print(x)
for y in ages:
print(str(y))
while i < len(names):
while j < len(ages):
print('Name: ' + names[i] + ' Age: ' +... |
C++ | UTF-8 | 1,225 | 2.96875 | 3 | [] | no_license | #pragma once
#include "point.h"
#include <iostream>
#include <conio.h>
#include <string>
using namespace std;
class Shape
{ protected:
Point Centre;
Point Vertex[4];
string Color;
public:
static int ID;
int Id;
Shape()
{ cout << "Создана фигура ";
Ce... |
Ruby | UTF-8 | 700 | 2.515625 | 3 | [
"MIT"
] | permissive | require 'httparty'
module ConvertKit
class Client
include HTTParty
attr_reader :key, :uri, :version
def initialize(key, uri="https://api.convertkit.com")
@key = key
@uri = uri
@version = 2
end
def form(id)
form = ConvertKit::Form.new(id)
form.client = sel... |
Python | UTF-8 | 586 | 3.125 | 3 | [] | no_license |
# lent = int(input())
import random
list = []
# for i in range(1000): list.append(int(input()))
for i in range(1): list.append(random.randint(1,10**11))
print(list)
# b = 0
for i in list:
if i % 2 == 0 or i % 3 == 0 or i % 5 == 0 or i % 7 == 0 or i % 13 == 0 or i % 11 == 0:
print("true", i)
# elif i %... |
Java | UTF-8 | 1,003 | 2.25 | 2 | [] | no_license | package com.omar.maxellforesttest.Common.network;
import java.util.concurrent.TimeUnit;
import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;
/**
* Created by omz on 27/5/18
*/
public class OkHttpClientFactory {
public static OkHttpClient getOkHttpClient() {
return getOkHttpClient... |
JavaScript | UTF-8 | 900 | 2.625 | 3 | [] | no_license | export default class JSONHelper {
readTemplate(filename){
var fs = window.require('fs');
var json_return = JSON.parse(fs.readFileSync(`./public/data/templates/${filename}.json`, 'utf8'));
return json_return;
}
readClass(filename){
var fs = window.require('fs');
var ... |
Python | UTF-8 | 2,373 | 3.09375 | 3 | [] | no_license | import unittest
import sys, os
myPath = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, myPath + '/../script')
import gradient_descent
class TestGradientDescent(unittest.TestCase):
##### set up points #####
def setUp(self):
self.points = [[1, 2], [2,4], [1,2]]
########## te... |
Java | UTF-8 | 1,505 | 3.359375 | 3 | [] | no_license | package leetcode;
public class _1061_LexicographicallySmallestEquivalentString {
public static void main(String[] args) {
_1061_LexicographicallySmallestEquivalentString obj = new _1061_LexicographicallySmallestEquivalentString();
// String s1 = "dccaccbdafgeabeeghbigbhicggfbhiccfgbechdicbhdcgahi"... |
Java | UTF-8 | 929 | 2.40625 | 2 | [] | no_license | package se.modlab.generics.sstruct.procedurecall;
public class UntypedAliasing {
private String typename;
private String varname;
private boolean isReferenced;
private boolean isArray;
private String filename;
private int line;
private int column;
public UntypedAliasing(String _typename, String _... |
Java | UTF-8 | 1,896 | 1.953125 | 2 | [] | no_license | package com.google.android.gms.internal.gtm;
import com.google.android.gms.common.internal.Preconditions;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
public final class zzok extends zzoa<Map<String, zzoa<?>>> {
private static final Map<String, zzgz> zza... |
Java | UTF-8 | 292 | 1.617188 | 2 | [] | no_license | package br.com.caloteiro.ws.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import br.com.caloteiro.ws.model.Cliente;
@Repository
public interface ClienteRepository extends JpaRepository<Cliente,Integer> {
}
|
C# | UTF-8 | 1,376 | 2.734375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
namespace DDD
{
class TakarabakoKi : Character
{
private bool isOpen2 = false;
private bool isKiGet = false;
/// <summary>
/// コンストラクタ
/// </summary>
... |
TypeScript | UTF-8 | 2,182 | 2.90625 | 3 | [] | no_license | import { ICollectionUser } from "../types/collections-user";
import {
collectionUserActionTypes,
FETCH_COLLECTIONS_USER_FAILURE,
FETCH_COLLECTIONS_USER_REQUEST,
FETCH_COLLECTIONS_USER_SUCCESS,
ADD_COLLECTIONS_USER,
EDIT_COLLECTIONS_USER
} from "../types/actions-collections-user";
import { ICollection... |
Java | UTF-8 | 1,942 | 2.21875 | 2 | [] | no_license | package org.kercoin.magrit.services.utils;
import java.io.IOException;
import java.io.StringReader;
import java.security.AccessControlException;
import java.util.Properties;
import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.Repository;
import org.kercoin.magrit.Configu... |
C++ | UTF-8 | 549 | 3.046875 | 3 | [] | no_license | #pragma once
#ifndef __BKR_UTILS__
#define __BKR_UTILS__
#include <string.h>
namespace Utils {
void copy(float* ary, float* src);
void copy(float* ary, float r, float g, float b, float a);
void copy(float* ary, float r, float g, float b);
}
// Functor for deleting pointers in vector.
template<class T> clas... |
PHP | UTF-8 | 2,413 | 3.125 | 3 | [
"MIT"
] | permissive | <?php
namespace Splash\Tests\Tools\Fields;
/**
* @abstract DateTime Field : Date & Time as Text (Format Y-m-d G:i:s)
*
* @example 2016-12-25 12:25:30
*/
class oodatetime extends oovarchar
{
//==============================================================================
// Structural Data ... |
JavaScript | UTF-8 | 559 | 4 | 4 | [] | no_license | function leadingSubstrings(str) {
let substr = [];
[...str].reduce((prev, char) => {
prev += char;
substr.push(prev);
return prev;
}, '');
return substr;
}
// for loop
// function substrings(str) {
// let subStr = [];
// for (let index = 0; index < str.length; index += 1) {
// subStr = su... |
Markdown | UTF-8 | 5,032 | 2.953125 | 3 | [] | no_license | ## Step 1
I made bamazon.sql with the following code
```
DROP DATABASE IF EXISTS bamazon;
CREATE database bamazon;
USE bamazon;
CREATE TABLE products(
position INT NOT NULL,
item_id INT NULL,
product_name VARCHAR(100) NULL,
department_name VARCHAR(100) NULL,
price DECIMAL(10,2) NULL,
stock_quantity INT NULL,
... |
Java | UTF-8 | 4,103 | 3.453125 | 3 | [] | no_license | package model;
/*
* Name: Blaine Jacques
* CSCI2466 HW2: Freedonia Olympic Athlete Bean
*/
import edu.saintpaul.csci2466.foam.model.Athlete;
import static edu.saintpaul.csci2466.foam.model.Athlete.INVALID_DATE;
import static edu.saintpaul.csci2466.foam.model.Athlete.OLYMPIC_OPENING_DATE;
import static edu.saintpau... |
Java | UTF-8 | 3,380 | 2.203125 | 2 | [] | no_license | package com.numier.numierpda.Dialogs;
import java.util.ArrayList;
import java.util.List;
import android.app.Activity;
import android.app.Dialog;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import androi... |
Java | UTF-8 | 2,644 | 2.40625 | 2 | [] | no_license | package controller;
import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import javax.mail.MessagingException;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotati... |
Python | UTF-8 | 14,469 | 3.328125 | 3 | [
"MIT"
] | permissive | import numpy as np
from numpy import linalg as LA
import numpy as np
np.set_printoptions(suppress=True, precision=4)
import matplotlib.pyplot as plt
from collections import OrderedDict
# used by histograms_overlap
def histogram_bins_centered(data, nbins):
""" helper function for numpy histograms, to generate b... |
Markdown | UTF-8 | 2,403 | 3.3125 | 3 | [] | no_license | # User Guide
Ponyo is a desktop app for managing your todos, optimised for use via a Command Line Interface (CLI) while still having the benefits of a Graphical User Interface (GUI).
**💡 Notes about the command format:**
* Words in `UPPER_CASE` are the parameters to be supplied by the user.
e.g. in `todo TASK`, `TAS... |
Java | UTF-8 | 6,786 | 2.125 | 2 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /*
* Copyright (C) 2017 Ignite Realtime Foundation. 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
*
* Unless... |
Java | UTF-8 | 794 | 2.15625 | 2 | [] | no_license | package com.crossover.ws.vo;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
@Xm... |
C | UTF-8 | 2,965 | 3.984375 | 4 | [] | no_license | #include <stdio.h>
#include <string.h>
#include <pthread.h>
#include <stdlib.h>
#include <unistd.h>
#include <time.h>
// COROUTINES HELPER FUNCTIONS AND VARIABLES
// Co Routines Variables
#define length 5 // Number of coroutines
pthread_t tid[length]; // Thread for ea... |
Java | UTF-8 | 777 | 3.359375 | 3 | [] | no_license | package com.main.learn.threads.geek.part1;
/**
* @Description Test
* @Author sunlei19
* @Date 2020/12/5 20:19
* @Version 1.0
*/
public class Test {
private Long count = 0L;
private void add10K() {
int idx = 0;
while (idx++ < 10000) {
synchronized (count) {
... |
C++ | UTF-8 | 3,389 | 3.1875 | 3 | [
"MIT"
] | permissive | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
#pragma once
template <class T>
class JitExpandArray
{
CompAllocator m_alloc;
T* m_data = nullptr;
unsigned m_size = 0;
unsigned m_minSize;
... |
Java | UTF-8 | 2,295 | 2.015625 | 2 | [] | no_license | package brytskyi.week6_7.sql.notebook_shop.services;
import brytskyi.week6_7.sql.notebook_shop.model.exceptions.dao_exceptions.NullFieldException;
import brytskyi.week6_7.sql.notebook_shop.model.production.*;
import brytskyi.week6_7.sql.notebook_shop.model.selling.Prodaja;
import brytskyi.week6_7.sql.notebook_shop.mod... |
PHP | UTF-8 | 272 | 3.390625 | 3 | [] | no_license | <?php declare(strict_types = 1);
namespace Gaua;
class Rounder
{
public function up(float $amount) : float
{
return ceil($amount * 100) / 100;
}
public function down(float $amount) : float
{
return floor($amount * 100) / 100;
}
} |
TypeScript | UTF-8 | 2,760 | 2.546875 | 3 | [] | no_license | import { Injectable } from '@angular/core';
import { AngularFireAuth } from '@angular/fire/auth';
import { ITour } from '../itour';
import { IUser } from '../iuser';
import { UsersService } from '../services/users.service';
import { ToursService } from './tours.service';
export class Credentials {
email: string = ''... |
C++ | UTF-8 | 1,067 | 3.59375 | 4 | [] | no_license | //
// Chapter 04. Divide-and-Conquer
//
// Maximum-Subarray Problem (P68~74): O(n) Complexity (P75)
//
// Hao Wu, 04/18/2014
//
// Reference 1: http://en.wikipedia.org/wiki/Maximum_subarray_problem
// Reference 2: http://goo.gl/mMA0LZ
//
#include <stdio.h>
#include <stdlib.h> // malloc() and free()
//
///
//
inline ... |
C# | UTF-8 | 1,079 | 2.546875 | 3 | [] | no_license | using FitApp.Services;
using System;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace FitApp.Pages
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class SignUpPage : ContentPage
{
public SignUpPage()
{
InitializeComponent();
}
async v... |
Markdown | UTF-8 | 3,854 | 2.859375 | 3 | [] | no_license | ---
description: "Simple Way to Make Award-winning Banana, spinach and blueberry smoothie"
title: "Simple Way to Make Award-winning Banana, spinach and blueberry smoothie"
slug: 1657-simple-way-to-make-award-winning-banana-spinach-and-blueberry-smoothie
date: 2022-01-21T15:17:55.683Z
image: https://img-global.cpcdn.com... |
Markdown | UTF-8 | 1,233 | 2.78125 | 3 | [] | no_license | ---
description: >-
Lets you export data to a datawarehouse or similar, so that you can do deep
analyses.
---
# Data Exports
{% hint style="info" %}
Need help setting up data exports and dashboards? We can help you! Contact us at [support@adnuntius.com](mailto:support@adnuntius.com) for more information.
{% endhi... |
Python | UTF-8 | 1,133 | 3.78125 | 4 | [] | no_license | class Array(object):
def __init__(self, *items):
if items:
self.__array = [item for item in items]
else:
self.__array = []
def __len__(self):
return len(self.__array)
def append(self, item):
self.__array.append(item)
def __getitem__(self, index)... |
Shell | UTF-8 | 6,183 | 3.75 | 4 | [
"BSD-3-Clause"
] | permissive | #! /bin/sh
# send mail messages about new per-user DCC log files
# This script can be run by the daily DCC cron job after it has been
# 1. changed to contain the URL of the local DCC CGI scripts,
# 2. changed to use a locally suitable command to send mail
# 3. copied to the DCC libexec directory,
# 4. and made execut... |
Java | UTF-8 | 208 | 1.765625 | 2 | [] | no_license | package org.bozan.traincontrol.device.mqtt;
import org.bozan.traincontrol.device.TrainControlDevice;
public class MqttDevice extends TrainControlDevice {
public MqttDevice(int id) {
super(id);
}
}
|
Python | UTF-8 | 404 | 2.765625 | 3 | [] | no_license | # -*- coding: utf-8 -*-
__author__ = 'buzz'
__date__ = '2018/7/22 下午3:53'
from sklearn.mixture import GaussianMixture
def trainModel(data, clusterNum):
"""
使用混合高斯模型 + EM 算法对数据进行聚类
:param data:
:param clusterNum:
:return:
"""
model = GaussianMixture(n_components=clusterNum, covariance_type... |
Java | UTF-8 | 7,299 | 2.0625 | 2 | [] | no_license | /*
* Copyright (C) 2013 Luca Veltri - University of Parma - Italy
*
* This file is part of MjSip (http://www.mjsip.org)
*
* MjSip 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 2 of th... |
Markdown | UTF-8 | 404 | 2.65625 | 3 | [] | no_license | # Style #21
## Constraints:
* Every single procedure and function checks the sanity of its arguments and refuses to continue when the arguments are unreasonable
* All code blocks check for all possible errors, possibly print out context-specific messages when errors occur, and pass the errors up the function cal... |
Java | UTF-8 | 2,404 | 2.875 | 3 | [] | no_license | import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Map;
import java.util.TreeMap;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
public class Teams{
public Map <Integer, String> eastMatchu... |
Java | UTF-8 | 3,943 | 2.03125 | 2 | [] | no_license | package com.keji50.zhucexiaadmin.web.controller;
import java.sql.Timestamp;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Controller;
import org.springframework.w... |
TypeScript | UTF-8 | 408 | 2.59375 | 3 | [
"MIT"
] | permissive | // https://github.com/tim-kos/node-retry/tree/b316bfc196a89504fa348bcb97b20eb55509a295#retrytimeoutsoptions
export const calculateDelay = (
attempt: number,
minTimeout: number,
maxTimeout: number,
factor: number,
randomize: boolean,
): number => {
const random = randomize ? Math.random() + 1 : 1
return M... |
JavaScript | UTF-8 | 776 | 2.53125 | 3 | [
"MIT"
] | permissive | // avoiding navigation bar coverage when anchor locating
// function locateAt(x) {
// x = document.getElementById(e);
// var y = x.offsetTop;
// while (x=x.offsetParent) {
// y += x.offsetTop;
// }
// y -= 70;
// window.scrollTo(0,y);
// }
// scroll smoothly when anchor locating
var $ro... |
C++ | UTF-8 | 1,783 | 3.4375 | 3 | [] | no_license | #include <iostream>
#include <queue>
#include <string>
#include <vector>
#include <map>
using namespace std;
struct Point{
int x;
int y;
};
bool isLegal(int x,int y){
if(x<=7&&x>=0&&y<=7&&y>=0){
return true;
}
return false;
}
int main(void){
int count;
string begin,end;
bool... |
JavaScript | UTF-8 | 6,120 | 2.75 | 3 | [
"MIT"
] | permissive | function dSearchLocShow(tHeaderValue){
if(tHeaderValue == '함께출퇴근해요'){
var html = "";
html += '<label>도착 장소</label><br>';
html += ' <input type="text" id="searchLoc2" name="dAddress" value="" class="form-control" /><input type="button" id="searchBtn2" onclick="PostCode2()" value="주소 검색" class="btn btn-pr... |
Java | UTF-8 | 79 | 2.390625 | 2 | [] | no_license | package scheduler;
public interface Task {
abstract void doWork(int time);
}
|
JavaScript | UTF-8 | 22,999 | 2.921875 | 3 | [] | no_license | /*
onload = function()
{
oesconderijo = document.getElementById('esconderijo');
ordenadores = oesconderijo.getElementsByTagName('div');
inicializaOrdenadores(ordenadores);
}
function inicializaOrdenadores(ordenadores)
{
for( i=0 ; i<ordenadores.length ; i++ )
{
//alert(ordenadores[i].name);
if( ordenadores[i]... |
Python | UTF-8 | 657 | 2.953125 | 3 | [] | no_license | import csv
def get_TestScript():
Script_Raw = []
Script_Output = []
Script_File = open('text.csv', 'r')
for line in Script_File:
Script_Raw.append(line.strip('\n'))
for i in range(1, len(Script_Raw)):
Script_Output.append(Script_Raw[i].split(''))
for i in range(0, len(Script_... |
Java | UTF-8 | 2,799 | 2.28125 | 2 | [] | no_license | package ba.unsa.etf.rpr.project.controller;
import ba.unsa.etf.rpr.project.database.AppDAO;
import ba.unsa.etf.rpr.project.enums.StageName;
import ba.unsa.etf.rpr.project.enums.content.LoginMessages;
import ba.unsa.etf.rpr.project.model.User;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml... |
C++ | UTF-8 | 2,292 | 2.796875 | 3 | [] | no_license | #pragma once
#include <stdarg.h>
namespace GameDev2D
{
class Log
{
public:
//Verbosity log levels
enum Verbosity
{
Verbosity_None = 0,
Verbosity_Debug = 1,
Verbosity_Application = 2,
Verbosity_Input_Keyboard = 4,
Verbosit... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.