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 |
|---|---|---|---|---|---|---|---|
Markdown | UTF-8 | 2,709 | 2.578125 | 3 | [] | no_license | ## Implementation Working Agreement
### GitHub
#### Branching
- `master` branch will act as Prod
- `dev` branch will act as a staging area
- all feature work must be merged to `dev` before `master`
- `dev` branch must be fully integrated and tested before merged to `master`
- All feature work will be coded up and t... |
Shell | UTF-8 | 1,017 | 3.75 | 4 | [] | no_license | #!/bin/bash
if [[ $# -lt 3 ]] ; then
echo "Usage: $(basename "$0") user hostname_or_ip_address ssh-port"
exit 0
fi
CONVERT="PLACEHOLDER URL"
PREP="PLACEHOLDER URL"
echo "Deleting $2 from known_hosts"
ssh-keygen -R "[$2]:$3"
echo "Sending SSH-key to $2"
ssh-copy-id -f $1@$2 -p $3
echo "Installing CHR"
ssh -p $... |
Java | UTF-8 | 15,131 | 2.203125 | 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 com.activedge.atm.message.persistence;
import com.activedge.atm.message.data.MessageData;
import com.activedge.atm.util.Util;
... |
C++ | UTF-8 | 342 | 3.3125 | 3 | [] | no_license | #include <iostream>
using namespace std;
string remDup(string str)
{
if(str.length() == 0)
return "";
char ch = str[0];
string oth = remDup(str.substr(1));
if(ch == oth[0])
return oth;
return (ch + oth);
}
int main()
{
cout << remDup("aaaaabbbbeeeddddccccc") << endl... |
Markdown | UTF-8 | 677 | 2.609375 | 3 | [] | no_license | ---
layout: post
title: Codility - CountSemiprimes
category: codility
---
[RESULT](https://app.codility.com/demo/results/trainingQ6NJRH-F2X)
```java
import java.util.*;
class Solution {
public int solution(int N) {
String s = Integer.toBinaryString(N);
int longestGap = 0;
int gap = 0;... |
SQL | UTF-8 | 7,082 | 2.9375 | 3 | [] | no_license | /*
SQLyog Ultimate v11.27 (32 bit)
MySQL - 5.5.29 : Database - w951_db_zsbus_staffchannel
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD... |
JavaScript | UTF-8 | 1,379 | 2.84375 | 3 | [] | no_license | var csv = require('csv-parser')
var fs = require('fs')
var data = []
const parseStr = (str) => {
if (!str) {
return null;
}
let key = str;
if (['\'', '\"'].includes(key[0])) {
key = key.slice(1);
}
if (['\'', '\"'].includes(key[key.length - 1])) {
key = key.slice(0, key.... |
Python | UTF-8 | 10,354 | 2.515625 | 3 | [] | no_license | from PyQt4 import QtGui, QtCore
import numpy as np
from atom_pair import AtomPair
from molecule import Molecule
import output
import molecular_scene
import settings
TOPB = 1
TOPRB = 2
RIGHTB = 3
BOTTOMRB = 4
BOTTOMB = 5
BOTTOMLB = 6
LEFTB = 7
TOPLB = 8
class Surface(QtGui.QGraphicsItem):
def __init__(self, sce... |
JavaScript | UTF-8 | 109 | 3.09375 | 3 | [] | no_license | console.log('good morning');
var age = 23;
const name = 'Dominik';
console.log(name);
console.log(age);
|
C++ | UTF-8 | 526 | 2.765625 | 3 | [] | no_license | #include <iostream>
#include <set>
using namespace std;
using P = pair<int, int>;
int main() {
int N, M;
cin >> N >> M;
set<P> requests;
for (int i{}; i < M; ++i) {
int a, b;
cin >> a >> b;
requests.insert(P{a, b});
}
int ans{1};
P wp{1, N};
for (const auto &r : requests... |
C++ | UTF-8 | 912 | 2.515625 | 3 | [] | no_license | #include "enemy.h"
#include "player.h"
#include <QDebug>
extern cGame *game;
cEnemy::cEnemy()
{
setPixmap(QPixmap(":/images/enemy.png"));
int random_position = rand() % 700;
setPos(random_position, 0);
QTimer *timer = new QTimer();
QObject::connect(timer,SIGNAL(timeout()),this,SLOT(move()));
... |
C | UTF-8 | 499 | 3.796875 | 4 | [] | no_license | //A program to calculate x^n/n! where x is a float and n is an integer greater or equal to zero
#include<stdio.h>
#include<conio.h>
void main()
{
int n,i,fact=1;
float x,s,numr=1;
printf("Enter a float x and an integer n:");
scanf("%f%d",&x,&n);
if(n==0)
fact = 1;
else
... |
TypeScript | UTF-8 | 1,984 | 2.53125 | 3 | [] | no_license | import { Component, OnInit } from '@angular/core';
import { FormGroup , FormControl, Validators, FormArray } from '@angular/forms';
@Component({
selector: 'app-reactiveforms2',
templateUrl: './reactiveforms2.component.html',
styleUrls: ['./reactiveforms2.component.css']
})
export class Reactiveforms2Component im... |
C++ | GB18030 | 7,727 | 2.546875 | 3 | [] | no_license | #include "Stdafx.h"
#include "Math.h"
#include "Resource.h"
#include "GoldControl.h"
//////////////////////////////////////////////////////////////////////////
//궨
#define CELL_WIDTH 19 //Ԫ
#define LESS_WIDTH 70 //С
#define SPACE_WIDTH 12 //Ϯ
#define BUTTON_WIDTH 0 ... |
Java | UTF-8 | 1,145 | 2.859375 | 3 | [] | no_license | package entities;
import java.util.ArrayList;
import org.joda.time.LocalDateTime;
public class Event
{
private String name;
private String address;
private String place;
private ArrayList<LocalDateTime> times;
private Venue venue;
private EventType type;
public Event (String name, String address, String pla... |
Markdown | UTF-8 | 587 | 3.515625 | 4 | [] | no_license | # Function description
Complete the Diagonal Difference function in the editor below. It must return an integer representing the absolute diagonal difference.
diagonalDifference takes the following parameter:
* arr: an array of integers .
# Input Format
The first line contains a single integer, 'n' , the number ... |
Markdown | UTF-8 | 10,836 | 2.875 | 3 | [] | no_license | # Date and time picker
## Data binding
<hhl-live-editor title="" style="overflow:none" htmlCode='
<template>
<H_row>
<H_date-picker label="Date" v-model="dato"></H_date-picker>
<H_input readonly :model-value="formatDate(dato)" label="Value"></H_input>
</H_row>
</template>
<scr... |
Java | UTF-8 | 3,992 | 3.03125 | 3 | [] | no_license | package web.server;
import http.packet.RequestHttpPacket;
import http.packet.ResponseHttpPacket;
import routing.Route;
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.reflect.Method;
import java.net.Socket;
import java.net.... |
C++ | UTF-8 | 2,886 | 2.6875 | 3 | [] | no_license | #ifndef Player_h
#define Player_h
#include <vector>
#include <string>
#include "Cards.h"
#include "Map.h"
#include "BidingFacility.h"
#include "Army.h"
#include "City.h"
#include "GameObservers.h"
#include "PlayerStrategies.h"
#include "GameScore.h"
class Strategy;
class BidingFacility;
class MainGame... |
Python | UTF-8 | 1,848 | 2.890625 | 3 | [] | no_license | from ai.oop.oop_inheritance import *
# Car1 = Car("Gv70", 4, 2400)
# Car1.carinfo()
# parent = Parent("부모", "공무원")
# print(parent.display())
# child01 = Child01("자식", "강사", 49)
# child01.childinfo()
# stu01 = StudentVO("은영", 25, "anyang", "2017")
# print(stu01.stuinfo())
# teacher01 = TeacherVO("섭섭", 49, "seoul", "... |
Markdown | UTF-8 | 2,000 | 3.296875 | 3 | [] | no_license | # Anime JS 라이브러리 사용
## 타켓 요소 명시
- Anime.js 를 이용해 애니메이션을 제작하려면, `anime()` 함수를 호출하고 그 중에서도 애니메이션 하려는 타깃 엘리먼트와 프로퍼티를 명시할 key-value 쌍으로 함수를 오브젝트에 넘겨주어야 한다.
### CSS 선택자
```javascript
let blue = anime({
targets: ".blue",
translateY: 200,
});
let redBlue = anime({
targets: ".red, .blue",
translateY: 200... |
Python | UTF-8 | 2,450 | 2.734375 | 3 | [
"MIT"
] | permissive | '''
MIT License
Copyright (c) [2018] Pedro Gil-Jiménez (pedro.gil@uah.es). Universidad de Alcalá. Spain
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limi... |
JavaScript | UTF-8 | 1,629 | 2.796875 | 3 | [] | no_license | // components/popUp/popUp.js
// js中使用component来注册组件
/**
* json 解读
* component: 自定义组件声明
* usingComponent: {} 可选项用于应用别的组件
* */
Component({
/**
* 在组件定义中启用多个slot支持
*/
options: {
multipleSlots: true
},
/**
* 组件的属性列表,组件的对外属性,是属性名到属性设置的映射表,
* type: 表示属性类型
* value: 表示属性初始值
* observe: 表示属性值... |
Markdown | UTF-8 | 8,462 | 2.6875 | 3 | [
"MIT"
] | permissive | # Project 7 - Highway Driving Path Planning - Trajectory Generation
[](http://www.udacity.com/drive)
Overview
---
In this project my goal is to safely navigate around a virtual highway with other traffic that i... |
Python | UTF-8 | 334 | 4.0625 | 4 | [] | no_license | '''Usando uma estrutura de iteração, codifique um algoritmo que leia 8 bits (um a um)
e diga quantos 1s e 0s compõem o byte lido.'''
cont = 1
s0 = 0
s1 = 0
while cont <= 8:
num = int(input('Digite um bit 1 ou 0: '))
if num == 0:
s0 += 1
else:
s1 == 1
s1 += 1
cont += 1
print(s1... |
Python | UTF-8 | 3,903 | 2.65625 | 3 | [
"MIT"
] | permissive | """
implement multiclass matrix factorization algorithms for CF data using Stochastic Gradient Descent according to
Menon, A.K. and Elkan, C., 2010, December. A log-linear model with latent features for dyadic prediction. In Data Mining (ICDM), 2010 IEEE 10th International Conference on (pp. 364-373). IEEE. [1]
"""
im... |
PHP | UTF-8 | 1,606 | 2.640625 | 3 | [] | no_license | <?php
namespace App\Model\Entity;
use Cake\ORM\Entity;
/**
* Employe Entity
*
* @property int $id
* @property string $number
* @property int $user_id
* @property int $position_id
* @property int|null $building_id
* @property int $civility_id
* @property int $language_id
* @property string $email
* @propert... |
C# | UTF-8 | 1,538 | 3.328125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using Wintellect.PowerCollections;
namespace Catalog
{
/// <summary>
/// Add new content to the catalog.
/// Determine logic for further manipulation of the content.
/// </summary>
public interface ICatalog
{
/// <su... |
Python | UTF-8 | 1,786 | 2.984375 | 3 | [] | no_license | import csv,yaml,json
import os
import logger,utils
def _check_format(file_path, content):
""" check testcase format if valid
"""
if not content:
# testcase file content is empty
err_msg = u"Testcase file content is empty: {}".format(file_path)
logger.log_error(err_msg)
elif not... |
SQL | UTF-8 | 2,705 | 3.5 | 4 | [] | no_license | CREATE DATABASE GYM
USE GYM
--CREACION DE TABLAS
--------------------------------------------------------------------------------------------------------------------------------------
CREATE TABLE CLIENTES(
ID INT NOT NULL,
NOMBRE VARCHAR(15),
APELLIDO VARCHAR(20),
CEDULA VARCHAR(10),
SEX... |
SQL | UTF-8 | 1,281 | 3.359375 | 3 | [] | no_license | set serveroutput on
set verify off
-- The 'spool' command redirects output to a text file. Don't forget to turn it off at the end.
-- Also, it will still get the program text, so edit it before using it.
spool "C:\users\patricia.obyrne\desktop\students2.js"
declare
-- The purpose of this program is to produce a script... |
C | WINDOWS-1252 | 1,498 | 4.25 | 4 | [] | no_license | /*****************************************************************/
/* Class: Computer Programming, Fall 2019 */
/* Author: JЦt */
/* ID: 108820008 */
/* Date: 2019.09.18 ... |
PHP | UTF-8 | 5,362 | 2.546875 | 3 | [
"MIT",
"BSD-3-Clause",
"Apache-2.0"
] | permissive | <?php
namespace Urbem\CoreBundle\Entity\Ldo;
/**
* AcaoValidada
*/
class AcaoValidada
{
/**
* PK
* @var integer
*/
private $codAcao;
/**
* PK
* @var string
*/
private $ano;
/**
* PK
* @var \Urbem\CoreBundle\Helper\DateTimeMicrosecondPK
*/
priva... |
C++ | UTF-8 | 533 | 3.265625 | 3 | [] | no_license | //This namespoace is used for logging data into files
#include<iostream>
#include<fstream>
namespace Logger{
std::string filename;
std::fstream file;
//Name the file with no file type
void init(std::string f){
filename = f+".txt";
file.open(f, std::ios::out);
}
void close(){
file.close();
... |
Python | UTF-8 | 590 | 3.921875 | 4 | [] | no_license | #Jack Walters
#Script to Encrypt a message with a given Caesar Cipher
from convert import convert_to_num, convert_to_letter #my helper script
def encrypt(msg, shift) :
cipher = [encrypt_letter(i.lower(),shift) for i in msg]
return ''.join(cipher)
def encrypt_letter(letter, shift) :
if (letter != " "):
return co... |
TypeScript | UTF-8 | 572 | 2.78125 | 3 | [] | no_license | export interface Task{
text: string;
done: boolean;
}
export interface TaskArr{
task: Task[];
}
export interface FieldState{
addNewTask: boolean;
}
export const OPEN_FIELD = 'OPEN_FIELD';
export const ADD_TASK = 'ADD_TASK';
export const REMOVE_TASK = 'REMOVE_TASK';
interface OpenField {
type: typeo... |
C++ | UTF-8 | 867 | 2.953125 | 3 | [
"MIT-Modern-Variant"
] | permissive | #include "synch.h"
class EventBarrier {
public:
EventBarrier();
~EventBarrier();
void Wait(); // 线程等待同步,需要同步的线程调用,调用后等待直到被唤醒,若栅栏是SIGNALED则直接返回
void Signal(); // 由控制栅栏的线程调用,唤醒当前等待的所有线程(广播),自己陷入等待直到线程全部被唤醒,然后重置栅栏状态为UNSIGNALED
void Complete(); // 线程唤醒同步,从Wait被唤醒后调用Complete,陷入等待直到所有线程被唤醒
int Wait... |
Python | UTF-8 | 2,358 | 2.734375 | 3 | [] | no_license | #This dataset (#2) will resample billboard songs, and non-billboard songs will come from non-billboard artists
#The size of the dataset will be the same as in dataset (#1)
import os, random
#1509 non
#1324 billboard
numOfValidationOrTestFilesNon = 151
numOfValidationOrTestFilesBillboard = 133
numOfTrainingFilesNon = ... |
Python | UTF-8 | 10,520 | 2.640625 | 3 | [
"MIT"
] | permissive | """PDB
Warnings
--------
This module is very specific and not recomended to be used straigth away!
Notes
------
contains some translation and reordering scripts for some pdbs.
"""
def reorder_lines(header: dict, lines: list) -> list:
"""order_dict = { # charmm_gromos54
"DPP... |
Markdown | UTF-8 | 11,483 | 3.046875 | 3 | [] | no_license | # Парсеры
> При отправке данных используются более сложные форматы, чем основанные на простых формах.
— Malcom Tredinnick, Django developers group
REST framework включает некоторое количество встроенных классов парсеров, которые позволяют принимать запросы различных типов медиа. Также они дают возможность определя... |
Java | UTF-8 | 680 | 2.015625 | 2 | [] | no_license | package com.yh.service.Impl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yh.mapper.SelectProjectsByPsIdMapper;
import com.yh.pojo.Projects;
import com.yh.service.SelectProjectsByPsIdService;
/**
* 根据公益类型ID查询项目
* @author 陈家亮
*... |
Java | UTF-8 | 1,573 | 2.5625 | 3 | [] | no_license | package fr.mmaillot.core.repository.datasource;
import com.pkmmte.pkrss.Article;
import com.pkmmte.pkrss.parser.Parser;
import com.pkmmte.pkrss.parser.Rss2Parser;
import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.Request;
import com.squareup.okhttp.Response;
import java.util.List;
import fr.mmaillo... |
Python | UTF-8 | 4,604 | 3.6875 | 4 | [] | no_license | def run():
print('***************** B I E N V E N I D O S A L E X A M E N *****************')
print("""Cual algoritmo quieres ejecutar:
[1]. Algoritmo1Dpl
[2]. Algoritmo2Dpl
[3]. Algoritmo3Dpl
[4]. Algoritmo4Dpl
[5]. Algoritmo5Dpl
[0]. Salir
""")
teclado = int(input("> "))
... |
Markdown | UTF-8 | 1,901 | 2.78125 | 3 | [
"MIT"
] | permissive | # Ucool - a UI component library based on svelte
#### Description
Based on the framework of svelte and bulma, a management system based UI component library is implemented, which is convenient for developers to develop. It provides the reference of developer component style and effect, as well as the corresponding usa... |
Java | UTF-8 | 7,519 | 2.46875 | 2 | [] | no_license | package de.rwth.i9.palm.feature.researcher;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util... |
TypeScript | UTF-8 | 2,384 | 2.6875 | 3 | [] | no_license | declare module EVENTSOL {
enum ReferenceType {
Simple = 0,
TotalHappens = 1,
OneOrMoreHappens = 2,
}
interface IReference {
type: ReferenceType;
}
interface IReferenceSimple extends IReference {
eventName: string;
timesHappens: number;
}
interf... |
Markdown | UTF-8 | 3,617 | 2.65625 | 3 | [
"MIT"
] | permissive | # Expense Watch
Expense Watch is an app to visualize your money go. It allows you to add the expenses as you spend them, and then view them in some cool graphs, so that you can manage money better.
### Features
* Gulp jobs for development, building, emulating and running your app
* Local development server with liv... |
Java | UTF-8 | 603 | 2.015625 | 2 | [] | no_license | package uk.co.vhome.clubbed.svc.enquiryhandler.repositories;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
import uk.co.vhome.clubbed.svc.enquiryhandler.model.Enquiry;
/**
* Used to check if an {@link Enquiry} already exists... |
Python | UTF-8 | 1,863 | 3.671875 | 4 | [] | no_license | """Q. (Create a program that fulfills the following specification.)
Female_Stats.Csv
Female Stat Students
Import The Female_Stats.Csv File
The Data Are From N = 214 Females In Statistics Classes At The University Of California At Davi.
Column1 = Student’s Self-Reported Height,
Column2 = Student’s Guess At Her Moth... |
PHP | UTF-8 | 48,868 | 2.78125 | 3 | [] | no_license | <?php
/*
** Time of Generation:
** Tue Jul 14 00:43:38 EDT 2015
*/
?>
<?php
/*
******
*
* HX-2014-08:
* for PHP code
* translated from ATS
*
******
*/
/*
******
* beg of [basics_cats.php]
******
*/
/* ****** ****** */
function
ATSCKiseqz($x) { return ($x === 0); }
function
ATSCKisneqz($x) { return ($x !== 0); }
/*... |
Java | UTF-8 | 3,373 | 2.578125 | 3 | [] | no_license | package br.com.avenue.script.daos;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.dbcp.BasicDataSource;
import org.springframework.dao.DuplicateKeyException;
import org.springframework.dao.EmptyResultDataAccessE... |
C++ | UTF-8 | 1,381 | 3.546875 | 4 | [] | no_license | #ifndef __INLINE_CONTAINER_H__
#define __INLINE_CONTAINER_H__
// Andrei Alexandrescu implementation of "inline containers"
#include <vector>
#include <list>
#include <deque>
template < typename T, class container = std::vector<T> >
class inline_container : public container
{
public:
inline_container() ... |
C | UTF-8 | 1,815 | 2.828125 | 3 | [] | no_license | /* ************************************************************************** */
/* LE - / */
/* / */
/* ft_list.c .:: .:/ . .:: ... |
Java | UTF-8 | 4,755 | 2.15625 | 2 | [] | no_license | package com.caved_in.commons.yml.converter;
import com.caved_in.commons.item.ItemBuilder;
import com.caved_in.commons.item.Items;
import com.caved_in.commons.yml.ConfigSection;
import com.caved_in.commons.yml.InternalConverter;
import org.apache.commons.lang3.reflect.TypeUtils;
import org.bukkit.Material;
import org.b... |
Python | UTF-8 | 3,222 | 3.65625 | 4 | [] | no_license | class Solution(object):
def mySqrt(self, x):
"""
:type x: int
:rtype: int
"""
# 2021.03.16:
# Note: the returned dtype is int, input is non-negative int
# 3rd solution: brute force
# Since x^0.5 < x/2 and x > 1, try 1 <= x <= x/2
"""
... |
Shell | UTF-8 | 681 | 2.984375 | 3 | [] | no_license | #! /bin/bash
#------------------------------------------------------------
# Auteur : Alababa
# Nom : Script automatisation de création des boite mails
# Role : Automatiser la creation des boite mails
#------------------------------------------------------------
# ROLE : AJOUTE UNE NOUVELLE RELATION FQDN - ADRESSE IP... |
Python | UTF-8 | 4,722 | 2.84375 | 3 | [
"MIT"
] | permissive | import pandas as pd
import numpy as np
from typing import List, Optional
from enum import Enum, auto
from pandas.core.frame import DataFrame
from sklearn import model_selection
'''
- binary classification
- multiclass classification
- multilabel classification
- single column regression
- multi column regression
- ho... |
Python | UTF-8 | 357 | 2.640625 | 3 | [] | no_license | # na = int(input())
a = set(map(int,input().split()))
d={'update':a.update,'intersection_update':a.intersection_update,'symmetric_difference_update':a.symmetric_difference_update,'difference_update':a.difference_update}
for i in range(int(input())):
c = input().split()
b = set(map(int,input().split()))
... |
Markdown | UTF-8 | 5,087 | 3.109375 | 3 | [
"MIT"
] | permissive | ---
layout: post
title: "Storytelling in Games, Pt. 1"
date: 2020-06-30
categories: gaming
---
I had an interesting experience recently while showing my wife The Last of Us 2. We had just come off her watching me play through Death Stranding, which was the first game she'd watched me play and really the first moder... |
SQL | UTF-8 | 1,063 | 3.8125 | 4 | [] | no_license | /*A database most often contains one or more tables. Each table is identified by a name (e.g. "Customers" or "Orders").
Tables contain records (rows) with data.*/
SELECT * FROM TABLE_NAME;
/* Line 3 will allow all the element of the table to be displayed as * means all colomns */
/* Sql keyword are not case sens... |
JavaScript | UTF-8 | 806 | 2.546875 | 3 | [] | no_license | function test() {
var len = 64000, samples = new Float32Array(len);
for(var i = 0; i < len; ++i) {
samples[i] = 1 / (i + 1);
}
var checksum = 0, checkLength = len;
for(var i = 0; i < checkLength; ++i) {
checksum += samples[i];
}
var source = new AudioDataMemorySource(new AudioParameters(1, 44100)... |
Java | UTF-8 | 325 | 2.5625 | 3 | [] | no_license | package com.student.java.module05.task1;
public class Runner {
public static void main(String[] args){
int [] arg = {3,7,34,51,9,1,2,5,63,24};
System.out.println(ArrayMinMaxSort.getMax(arg));
System.out.println(ArrayMinMaxSort.getMin(arg));
ArrayMinMaxSort.sortArray(arg);
... |
PHP | UTF-8 | 2,107 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Jobs;
use App\TestRequest;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
class ProcessTest implements ShouldQueue
{
use Dispatchable, Interac... |
Go | UTF-8 | 178 | 2.796875 | 3 | [] | no_license | package bridge
// Drawer draws on the underlying graphics device
type Drawer interface {
// DrawEllipseInRect draws an ellipse in rectanlge
DrawEllipseInRect(r Rect) string
}
|
Java | UTF-8 | 1,314 | 2.078125 | 2 | [] | no_license | package com.kerols2020.cloudgallery;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import com.google.firebase.auth.FirebaseAuth;
public class CoverActivity ... |
C# | UTF-8 | 1,365 | 3.109375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.SQLite;
namespace OutlawHessDB
{
class dbConnection
{
public static string source = @"Data Source = ..\bandits.db"; //sets location of database file in project fo... |
C# | UTF-8 | 859 | 2.71875 | 3 | [] | no_license | using CSharpDiscovery.Quest02;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
namespace tests
{
[TestClass]
public class DifferenceInMinutesTests
{
[TestMethod]
public void DifferenceInMinutes_2DateTimesTheSameDay_OK()
{
var start = new DateTime(2021,... |
C++ | UTF-8 | 1,622 | 2.5625 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
void binary(int a, int s[])
{
int i = 7;
while (a > 0)
{
s[i--] = a % 2;
a /= 2;
}
if (i >= 0)
{
for (; i >= 0; i--)
s[i] = 0;
}
}
int decimal(int s[])
{
... |
C++ | UTF-8 | 1,721 | 3.03125 | 3 | [] | no_license | #ifndef BOARDACTOR_HH
#define BOARDACTOR_HH
#include <QtWidgets>
#include <QGraphicsSceneMouseEvent>
#include <QPainter>
#include <QMimeData>
/**
* @file
* @brief Implements graphic class BoardActor
*/
namespace Ui {
/**
* @brief Offers an graphical class for
* different actors. Actors roam around the
* game... |
JavaScript | UTF-8 | 1,447 | 2.953125 | 3 | [] | no_license | 'use strict';
import React from 'react';
import PropTypes from 'prop-types';
export const Skills = props => {
const skillsSortedByLevel = Object.values(props.skills).reduce((acc, skill) => {
if (!acc[skill.level] && skill.level > 0) acc[skill.level] = [skill];
else acc[skill.level].push(skill);
return a... |
C++ | UTF-8 | 3,246 | 2.78125 | 3 | [
"BSL-1.0"
] | permissive | // Copyright David Stone 2020.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#pragma once
#include <tm/evaluate/best_move.hpp>
#include <tm/evaluate/compressed_battle.hpp>
#include <tm/evaluate/depth.hpp>
#i... |
Markdown | UTF-8 | 6,619 | 2.828125 | 3 | [] | no_license | Statsite [](https://travis-ci.org/armon/statsite)
========
This is a stats aggregation server. Statsite is based heavily
on Etsy's StatsD <https://github.com/etsy/statsd>. This is
a re-implementation of the Python version of statsite
<https://github.com/kiip/sta... |
Java | UTF-8 | 1,990 | 2.609375 | 3 | [] | no_license | package com.example.astroweather.data;
public class WeatherInfo {
private String imageId;
private String longitude;
private String latitude;
private String cityName;
private String pressure;
private String description;
private String date;
private float temperature;
public Weather... |
C# | UTF-8 | 1,735 | 3.234375 | 3 | [
"MIT"
] | permissive | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Ether.WeightedSelector.Extensions
{
public static class ExtensionMethods
{
public static int AverageWeight<T>(this WeightedSelector<T> selector)
{
return selector.Items.Count == 0 ? 0 : ... |
C# | UTF-8 | 381 | 3.109375 | 3 | [] | no_license | using System;
namespace MethodsReturn
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine(divideNumeros(18,7));
}
static double divideNumeros(double n1, double n2)
{
return n1 / n2;
}
// static v... |
Python | UTF-8 | 143 | 3.078125 | 3 | [] | no_license | #!/usr/bin/env python3
# _*_ coding:utf-8 _*_
a = [''] * 15
for i in range(len(a)):
a[i] = 'line' + str(i)
print(a)
print(a[9])
|
C++ | UTF-8 | 1,272 | 4.125 | 4 | [] | no_license | #include <iostream>
#include "ArraySet.h"
using namespace std;
template<class ItemType>
void display(ArraySet<ItemType>& set)
{
cout << "The bag contains " << set.getCurrentSize()
<< " items:" << endl;
// convert to vector and iterate through
vector<ItemType> setItems = set.toVector();
size_t numberOfEntries =... |
Shell | UTF-8 | 306 | 3.140625 | 3 | [] | no_license | #!/bin/bash
for algo in tree naiveBayes knn; do
csvs=$(find output/$algo -name "*.csv")
first=1
for csv in $csvs; do
if [[ $first == 1 ]]; then
sed -n '1p' < $csv > output/$algo.csv
first=0
fi
sed -n '2p' < $csv >> output/$algo.csv
done
done
|
Java | UTF-8 | 5,249 | 1.859375 | 2 | [] | no_license | 13
https://raw.githubusercontent.com/CoboVault/cobo-vault-cold/master/app/src/main/java/com/cobo/cold/ui/fragment/main/AddressFragment.java
/*
* Copyright (c) 2020 Cobo
*
* 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
* ... |
C++ | UTF-8 | 1,516 | 3.65625 | 4 | [] | no_license | /*
Samantha Oxley
ISTE 202 - Lab 05
Structs & File I/O
simple setting/printing of struct data to output and then appended to file
*/
#include <iostream>
#include <iomanip>
#include <fstream>
using namespace std;
struct Commission{
int idNum;
double base;
double sales;
double rate;
};
v... |
Markdown | UTF-8 | 30,534 | 3.46875 | 3 | [] | no_license | # Laporan Resmi Sistem Operasi Modul3 E09
#### Fandi Pranata Jaya - 05111740000056
#### Fadhil Musaad Al Giffary - 05111740000116
## Nomor 1
### Soal:
1. Buatlah program C yang bisa menghitung faktorial secara parallel lalu menampilkan hasilnya secara berurutan
<br/>Contoh:
<br/>./faktorial 5 3 4
<br/>3! = 6
<br/>4! ... |
Java | UTF-8 | 4,204 | 2.171875 | 2 | [] | no_license | package com.scm.services.config;
import java.io.IOException;
import java.util.Arrays;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import io.jsonwebtoken.ExpiredJwtException;
import i... |
Java | UTF-8 | 745 | 3.328125 | 3 | [] | no_license | package ch07;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
public class AtomicIntegerFieldUpdaterTest {
// 创建一个User类的age属性的更新器
private static AtomicIntegerFieldUpdater<User> updater = AtomicIntegerFieldUpdater.newUpdater(User.class, "a... |
Markdown | UTF-8 | 1,019 | 2.546875 | 3 | [
"MIT"
] | permissive | # Requirements
## 1. 基础功能
### 1.1 将md文件转换成html
#### 1.1.1 块级元素
基础块级元素
===
- `#`~`######` 6级标题
- `===`第7级标题
- `---`水平分隔线
- `>`引用
- `![]()`图片
- `|:--`表格
左上角单元格实现`\`分隔。
- `1.`有序列表
有序列表的序号使用定义的值,保证有空行间隔的有序列表的序号始终正确。
- `-/+/*`无序列表
- \`\`\`代码块
代码块实现高亮显示
- 文本段落
扩展块级元素
===
- `!note(title,type)` 注意
- `!eg` 示例... |
Java | UTF-8 | 2,055 | 2.609375 | 3 | [] | no_license | package com.s206megame.towerdefense.tower;
import com.s206megame.towerdefense.tower.basic.TowerType;
import org.bukkit.Location;
import org.bukkit.Material;
import com.s206megame.towerdefense.tower.basic.Tower;
import org.bukkit.Particle;
import java.util.Arrays;
import java.util.List;
public class ArcherTower exten... |
C | UTF-8 | 1,509 | 3.75 | 4 | [] | no_license | /* Naivna, rekurzivna implementacija problema maksimalnog ranca */
#include <stdio.h>
#include <time.h>
//Deklaracije koriscenih funkcija
int max(int a, int b);
int main() {
clock_t pocetak, kraj;
double cpu_time_used;
int vrednosti[] = {45, 67, 69, 75};
int tezine[] = {9, ... |
C | UTF-8 | 131 | 2.546875 | 3 | [] | no_license | #include<stdio.h>
int main() {
int a;
char c = 6;
int b = a;
printf("%c", c);
a=getchar();
putchar(a);
return 0;
}
|
PHP | UTF-8 | 2,904 | 2.703125 | 3 | [
"MIT"
] | permissive | <?php
/*
* This file is part of fof/webhooks.
*
* Copyright (c) FriendsOfFlarum.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace FoF\Webhooks;
use Carbon\Carbon;
use Flarum\Http\UrlGenerator;
use Flarum\User\User;
use ... |
Java | UTF-8 | 4,283 | 1.953125 | 2 | [] | no_license | package com.xiumiing.wxtest;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.RemoteException;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.widget.ImageView;
import android.widget.TextView;
import com.lody.virtual.cl... |
JavaScript | UTF-8 | 3,326 | 3.171875 | 3 | [] | no_license | function GUI(p) {
var controllers = [];
this.addController = function(x1, y1, width, height, minValue, maxValue) {
var s = new Slider(x1, y1, width, height, minValue, maxValue);
controllers.push(s);
return s;
}
this.addButton = function(x, y, width, height) {
va... |
Python | UTF-8 | 191 | 3.46875 | 3 | [] | no_license | import sys
num1, num2 = input().split()
num1 = int(''.join(list(reversed(num1))))
num2 = int(''.join(list(reversed(num2))))
if(num1 > num2):
print(num1)
else:
print(num2)
|
Java | UTF-8 | 1,620 | 2.1875 | 2 | [
"MIT"
] | permissive | package be.goofydev.bridger.bungee;
import be.goofydev.bridger.api.model.proxy.Proxy;
import be.goofydev.bridger.api.model.user.User;
import be.goofydev.bridger.common.plugin.BridgerPlugin;
import net.kyori.text.Component;
import net.kyori.text.adapter.bungeecord.TextAdapter;
import net.md_5.bungee.api.ProxyServer;
i... |
JavaScript | UTF-8 | 1,164 | 3.46875 | 3 | [] | no_license | /**
*查找触发事件的元素,绑定事件,查找要修改的元素,修改元素
*查找table下的thead下的input,绑定单击事件,查找table下的tbody下作为第一个子元素的td下的input,遍历所有input,将当前input的checked属性改为和全选input的checked一致
*/
var chbAll=document.querySelector("table>thead input");
chbAll.onclick=function(){
var inputs=document.querySelectorAll("table>tbody td:first-child>input");
for(var inp... |
SQL | UTF-8 | 319 | 2.90625 | 3 | [] | no_license | create database thietkevataoCSDL;
use thietkevataoCSDL;
CREATE TABLE contacts
( contact_id INT(11) NOT NULL AUTO_INCREMENT,
last_name VARCHAR(30) NOT NULL,
first_name VARCHAR(25),
birthday DATE,
CONSTRAINT contacts_pk PRIMARY KEY (contact_id)
);
insert into contacts
values
(1, "phuc", "nguyen", "1989-01-06"); |
C++ | UTF-8 | 978 | 2.953125 | 3 | [] | no_license | class Solution {
public:
int getBouquetNum(vector<int>& bloomDay, int day, int k)
{
int bloomCount = 0;
int ret = 0;
for(int flowerDay : bloomDay)
{
if(flowerDay <= day) bloomCount++;
else bloomCount = 0;
if(bloomCount == ... |
C | UTF-8 | 1,627 | 2.765625 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <sys/select.h>
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
int chatroomId, newClientListener, serverFd;
int main(int argc, char const *argv[])
{
mkfifo("newClientListener", 0666);
newCl... |
Java | UTF-8 | 456 | 1.960938 | 2 | [] | no_license | package in.co.sdrc.scpstn.repository;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import in.co.sdrc.scpstn.domain.Subgroup;
public interface SubgroupRepository extends JpaRepository<Subgroup, Integer>{
public List<Subgroup> findAllByOrderBySubgroupValueIdAsc()... |
Java | UTF-8 | 478 | 1.84375 | 2 | [] | no_license | package com.weitao.dao;
import com.weitao.bean.Category;
import java.util.List;
public interface CategoryMapper {
int deleteByPrimaryKey(Integer caId);
int insert(Category record);
int insertSelective(Category record);
Category selectByPrimaryKey(Integer caId);
int updateByPrimaryKeySelective... |
JavaScript | UTF-8 | 1,499 | 2.875 | 3 | [] | no_license | var data = '',
utilities = (function() {
var convertStdin = function (input) {
var parts = input.split(', '),
latParts = parts[0].split(' '),
lat = parseFloat(latParts[0]);
latCard = latParts[1].replace(/^\s+|\s+$/, '');
... |
Python | UTF-8 | 988 | 3.28125 | 3 | [] | no_license | '''
Practicing creating triggers
The Fresh Fruit Delivery company needs help creating a new trigger called OrdersUpdatedRows on the Orders table.
This trigger will be responsible for filling in a historical table (OrdersUpdate) where information about the updated rows is kept.
A historical table is often used in pr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.