language
stringclasses
15 values
src_encoding
stringclasses
34 values
length_bytes
int64
6
7.85M
score
float64
1.5
5.69
int_score
int64
2
5
detected_licenses
listlengths
0
160
license_type
stringclasses
2 values
text
stringlengths
9
7.85M
C
UTF-8
2,098
2.578125
3
[ "MIT" ]
permissive
#include <stdio.h> #include "i2c.h" I2C_Device i2c1 = { .instance = I2C1, .state = 0, }; int i = 0; uint8_t data[10] = {}; #define I2C_FREQ 42 #define I2C_SPEED 210 #define I2C_RISE_T 43 void I2C_Init(void) { GPIO_TypeDef *gpio = GPIOB; RCC_TypeDef *rcc = RCC; I2C_TypeDef...
PHP
UTF-8
1,763
2.625
3
[]
no_license
<!DOCTYPE html> <html> <head> <title>TP 3 : exercice 2</title> <meta name="auteur" content="Florent LUCET" /> <meta name="sujet" content="TP de LO07" /> <meta name="mots-cles" content="Programmation,Web,HTML,PHP" /> <meta http-equiv="Content-Type" content="text/html; charset=...
Python
UTF-8
1,126
3.234375
3
[]
no_license
import pygame pygame.init() win = pygame.display.set_mode((500,400)) pygame.display.set_caption("Bubble Sort") x = 40 y = 40 width = 20 # height of each bar (data to be sorted) height = [200, 50, 130, 90, 250, 61, 110, 88, 33, 80, 70, 159, 180, 20] run = True def show(height): for i in ran...
JavaScript
UTF-8
3,457
2.875
3
[ "MIT" ]
permissive
/* * 将多个JS文件合并成一个JS文件 * @param{ Object } 压缩的参数 * path : 需要合并的JS文件所在的路径 * names : 需要合并的JS文件名 * output : 输出合并后的JS文件路径 * encoding : 文件编码 * format : 在合并文件时,用于格式化文件的函数 * comboComplete : 合并完后,输出文件前的回调 * compressComplete : 压缩完后,输出文件前的回调 * uglifyUrl : uglify的路径 */ var combo = function( options ){ ...
Python
UTF-8
788
4.28125
4
[]
no_license
# g en alguna parte tiene un yield #key: function(x) -> y #ej: key: (lambda x: -x) #key(g_1)<=key(g_2) ? #key: (lambda x: x) def bloques(g,key): bloque = [] for elemento in g: #bloque[0] -> bloque[-1] = bloque[len(bloque) - 1] #me va a generar un bloque hasta que se rompa la condición ...
Shell
UTF-8
245
3.3125
3
[ "Apache-2.0" ]
permissive
#!/bin/sh # initrd=${1:-initrd.img} ramdisk=${2:-RAMDISK} if [ ! -f $initrd ]; then echo "$initrd does not exist." exit 1 fi if [ -d $ramdisk ]; then rm $ramdisk -rf fi mkdir -p $ramdisk zcat $initrd | ( cd $ramdisk; cpio -i )
Java
UTF-8
166
1.898438
2
[]
no_license
package writxtr.listeners; import java.io.File; import writxtr.beans.SaveEvent; public interface SaveListener { void onSaveRequest(File file, SaveEvent event); }
Python
UTF-8
613
2.625
3
[]
no_license
import numpy as np import pandas as pd filename= 'CANdata.log' #Handle the Raw Data RawData=pd.read_csv(filename, header = None) RawData.columns=['Time'] #Divide Data to 3 main Columns RawData['Data'] = RawData['Time'].str.split(' ').str[2] RawData['Connection'] = RawData['Time'].str.split(' ').str[1] Raw...
Markdown
UTF-8
1,251
3.171875
3
[]
no_license
# Note Taker Web Application **Motivation** This is a web based note taker application that allow a user to enter, save and delete notes. **Build status** The build status is complete. **Code style** The application is written in JavaScript and use Express.js to run the server side logic for the application. Front...
Markdown
UTF-8
1,347
2.78125
3
[]
no_license
## Algoritmo de Strassen ## Requerimientos - Python 3 - numpy, matplotlib ## Comandos para ejecutar Algoritmo $ make $ ./exev1 k n leaf_size reset ejemplo de ejecucion: $ ./exev1 1 100 20 1 - k y n corresponden a los parametros del problema - leaf_size es el tamaño hasta donde se aplica Strassen - reset c...
C++
UTF-8
2,468
2.71875
3
[ "BSD-2-Clause" ]
permissive
/******************************************************************************* * *Copyright: armuxinxian@aliyun.com * *Author: f * *File name: csf_platform.hpp * *Version: 1.0 * *Date: 07-1月-2020 13:49:55 * *Description: Class(csf_platform) 描述系统信息类,主要获取系统相关的信息 * *Others: * *History: * *******************************...
Java
UTF-8
4,582
1.734375
2
[ "Apache-2.0" ]
permissive
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you ...
C#
UTF-8
1,090
2.546875
3
[]
no_license
using UnityEngine; using System.Collections; using UnityEngine.UI; public class Player : MonoBehaviour { private string playerName; private Color playerColor; private int id; private Image image; private int position; public int preTotal; public bool preGuessed; public void Awake()...
Java
UTF-8
939
2.25
2
[]
no_license
package jp.techacademy.yuka.satou.originalapp; import java.io.Serializable; import java.util.Date; import io.realm.RealmObject; import io.realm.annotations.PrimaryKey; public class Report extends RealmObject implements Serializable { private String start; //出勤時刻 private String end; //退勤時刻 private Date da...
Java
GB18030
528
1.859375
2
[]
no_license
package com.accp.dao.tzy; import java.util.List; import org.apache.ibatis.annotations.Param; import com.accp.pojo.Firm; public interface tzy_FirmMapper { int deleteByPrimaryKey(Integer firmid); int insert(Firm record); int insertSelective(Firm record); Firm selectByPrimaryKey(Integ...
C
UTF-8
417
3.609375
4
[]
no_license
#include <stdio.h> #include <stdlib.h> int main(){ float alt,peso; int selec; printf("Digite o sua altura\n"); scanf("%f",&alt); printf("Digite o seu sexo (1) para Masculino ou (0) para Feminino\n"); scanf("%d",&selec); if(selec == 1){ peso = (72.7*alt) - 58; } if(selec == 0){ peso = (6...
Markdown
UTF-8
5,183
3.046875
3
[ "CC-BY-4.0", "MIT" ]
permissive
--- title: "Work with activities in the Kanban view in Dynamics 365 Sales" description: "Use the opportunity Kanban view to visualize your activities with a card-based view and manage these activities quickly by moving them across the swim lanes." ms.date: 10/25/2021 ms.topic: article author: lavanyakr01 ms.author: lav...
Go
UTF-8
532
3.25
3
[]
no_license
package main import ( "bufio" "encoding/json" "fmt" "log" "os" ) func main() { scanner := bufio.NewScanner(os.Stdin) user := make(map[string]string) fmt.Println("Enter your name.") if scanner.Scan() { name := scanner.Text() user["name"] = name } fmt.Println("Enter your address.") if scanner.Scan() { ...
Java
UTF-8
3,369
2.375
2
[]
no_license
/* * This file is part of Macchiato Doppio Java Game Framework. * Copyright (C) Dec 1, 2010 Matthew Stockbridge * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of...
Java
UTF-8
149
1.867188
2
[]
no_license
package com.anime.proxy.v1; /** * @author 陌上丶天琊 * @date 2019-10-30 13:11 * 描述: */ public interface Movable { void move(); }
C++
UTF-8
1,001
2.515625
3
[]
no_license
//Center pin of for signal. //Zener diod for 5 v. const int analogInPin = A0; const int analogOutPin = 12; const int ledPin = LED_BUILTIN; int sensorValue = 0; int outputValue = 0; unsigned long previousMillis = 0; unsigned long time1 = 0; bool stat = false; const long interval = 10001; void setup() { Serial.begi...
Markdown
UTF-8
3,232
2.859375
3
[ "Apache-2.0" ]
permissive
This document describes production documentation tips. Overview ========= MapRoulette has been deployed successfully using uWSGI behind an nginx web server. Directory Layout ================= The production environment we've used stores the base directory for the web server as `/srv/www`, with the base directory fo...
C#
UTF-8
1,010
2.5625
3
[]
no_license
using MvvmCrossTemplate.Contracts.Repository; using MvvmCrossTemplate.Contracts.Services; using MvvmCrossTemplate.Model; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace MvvmCrossTemplate.Services.Data { public class EmployeeDataService : IEmployeeDataService { p...
JavaScript
UTF-8
4,331
2.84375
3
[]
no_license
import React, { Component } from 'react' import { Formik, Form, Field, ErrorMessage } from 'formik' import BookDataService from '../api/BookDataService' export default class BookForm extends Component { constructor(props) { super(props) this.state = { id: this.props.match.params.id, ...
Markdown
UTF-8
2,208
3
3
[ "MIT" ]
permissive
--- title : "When Time became our God, and anxiety our companion." author : "Obed Marquez Parlapiano" date : "2019-01-05" categories : - thoughts tags : "" cover : "../images/black-sand-hourglass-standing-on-rocks-at-the-beach.jpg" --- The time is so scarce, it is somewhat frustrating. To let go of things you love, ...
C#
UTF-8
1,068
3.609375
4
[]
no_license
using System; namespace Wizard.Models { public class Ninja : Human { public Ninja(string name) : base(name) { Dexterity = 175; } public override int Attack(Human target) { int dmg = 5 * Dexterity; Console.ForegroundColor = ConsoleColor...
Markdown
UTF-8
1,817
2.71875
3
[ "MIT" ]
permissive
--- title: "동분서주(東奔西走) - Korean 4 Character Idioms #12" published: 2015-02-03 date: 2016-02-19 --- # 3 Speed Only <iframe id="audio_iframe" src="https://www.podbean.com/media/player/fvnbq-538aca/initByJs/1/auto/1?skin=4" width="100%" height="100" frameborder="0" scrolling="no"></iframe> # With Explanation <iframe ...
Java
UTF-8
626
3.609375
4
[]
no_license
package algorithms.Implementation; import java.io.*; import java.util.*; // https://www.hackerrank.com/challenges/drawing-book/problem public class DrawingBook { static int pageCount(int n, int p) { int left = (p/2); int right = (n/2)-left; return (Math.min(left, right)); } pri...
Shell
UTF-8
538
2.71875
3
[]
no_license
#!/bin/bash set -e set -u DIR="$(dirname $0)" echo $0 echo "Do we have OS password?" echo $BEELDBANK_OBJECTSTORE_PASSWORD # dc() { #docker-compose -p bb -f ../docker-compose.yml $*; docker-compose $*; } # so we can delete named volumes #dc stop #dc rm -f -v dc pull dc up -d database dc exec database update-...
Java
UTF-8
6,580
2.078125
2
[]
no_license
package com.bridgelabz.bookstore.controller; import java.io.IOException; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.validation.BindingResult; import org.spr...
C#
UTF-8
1,168
2.84375
3
[ "MIT" ]
permissive
using SRDP.Domain.Enumerations; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SRDP.Domain.ValueObjects { public class CondicionAlerta : ValueObject { public OperadorAlerta Operador { get; } public string OperadorSq...
Java
UTF-8
539
2.0625
2
[ "MIT" ]
permissive
package com.someguyssoftware.dungeonsengine.builder; import java.util.Random; import com.someguyssoftware.dungeonsengine.config.LevelConfig; import com.someguyssoftware.dungeonsengine.model.IRoom; import com.someguyssoftware.gottschcore.positional.ICoords; import net.minecraft.util.math.AxisAlignedBB; public interf...
PHP
UTF-8
2,235
2.78125
3
[]
no_license
<?php $_GET['list'] = 'list=The Hobbit: The Battle of the Five Armies (adventure)- Ian McKellen, Martin Freeman, Richard Armitage, Cate Blanchett / 300 Night at the Museum: Secret of the Tomb (comedy)- Ben Stiller, Robin Williams, Owen Wilson, Dick Van Dyke / 200 Exodus: Gods and Kings (action)- Christian Bale, Joel E...
C#
UTF-8
2,000
2.578125
3
[ "Apache-2.0" ]
permissive
using Microsoft.Extensions.Logging; using Namespace2Xml.Semantics; using Namespace2Xml.Syntax; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; namespace Namespace2Xml.Formatters { public class NamespaceFormatter : StreamForm...
C++
UTF-8
1,205
2.640625
3
[]
no_license
#include <iostream> #include <algorithm> #include <stdio.h> #include <stdlib.h> #include <time.h> #include <memory.h> #include <math.h> #include <string> #include <string.h> #include <queue> #include <vector> #include <set> #include <deque> #include <map> #include <functional> #include <numeric> #include <sstream> typ...
JavaScript
UTF-8
10,238
2.65625
3
[]
no_license
///////////////// // RidesScene ///////////////// class RidesScene extends Phaser.Scene { constructor() { super('RidesScene') this.ferrisWheelRotSpeed = 0.005; this.bumperCarSpeed = 4500; // hard coded tired this.starsToCollect = 4; } create() { this.add.image(config....
Python
UTF-8
1,965
2.796875
3
[]
no_license
from flask import Flask, request from flask_restful import Resource, Api from date_utils import DateUtils from timezone_utils import TimeZoneUtils from coordination_utils import CoordinationUtils app = Flask(__name__, template_folder="templates") api = Api(app) def to_float(input, var_name): try: return ...
C#
UTF-8
2,576
2.59375
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SteamCNHelper { [Serializable] class ForumThread { public int ID { get; set; } public string Name { get; set; } public string Author { get; set; } ...
Java
TIS-620
13,642
1.835938
2
[]
no_license
/* * PanelPregnanceANCPCU.java * * Created on 13 չҤ 2549, 15:33 . */ package com.generalpcu.gui.panel; import com.generalpcu.control.ManageControlSubject; import com.generalpcu.usecase.AllPanelSubject; import com.generalpcu.usecase.GUISubject; import com.generalpcu.control.ComboBoxControl; import com.generalpcu.co...
Java
UTF-8
1,723
2.3125
2
[]
no_license
package XMLCreation; import java.io.File; import java.io.UnsupportedEncodingException; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import javax.xml.bind.Unmarshaller; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import contants.TalentifyClientsCon...
Python
UTF-8
1,851
2.890625
3
[]
no_license
import model import csv from datetime import datetime def load_users(session, filename): # use u.user with open(filename, 'rb') as csvfile: lines = csv.reader(csvfile, delimiter = '|') for line in lines: user = model.User() user.user_id = line[0].stri...
Markdown
UTF-8
1,599
2.9375
3
[ "MIT" ]
permissive
## ZEV_induction_30min_delay The goal of this experiment is to determine how induction performs on the McIsaac ZEV strains under a 30 minute flooding time when flooding plates with SC+2% galactose media (used to resuspend cells growing on an agarose plate). For this experiment we are testing induction on the CBF1 stra...
JavaScript
UTF-8
22,985
2.71875
3
[]
no_license
/** * Created by sks on 2016/4/8. */ /** * 人员选择器 */ ;(function(NAME, $) { var _zIndex = 10000; var zIndex = function() { return ++_zIndex; }; /** * 组件类 * @param element * @param options * @constructor */ var Component = function() { this._init.apply(t...
C
UTF-8
1,624
2.53125
3
[ "FSFAP", "GPL-1.0-or-later", "GPL-2.0-or-later", "GPL-2.0-only", "Apache-2.0" ]
permissive
/** \file archdep_make_backup_filename.c * \brief Generate a backup filename for a file * \author Bas Wassink <b.wassink@ziggo.nl> */ /* * This file is part of VICE, the Versatile Commodore Emulator. * See README for copyright notice. * * This program is free software; you can redistribute it and/or modif...
Java
UTF-8
562
2.15625
2
[ "MIT" ]
permissive
package com.huajiao.comm.chatroomresults; /** * 成员退出的通知 * */ public class MemberQuitNotification extends DetailedResult { private int _total_member_cnt; public MemberQuitNotification(long sn, int result, byte[] reason, int total_member_count, String roomid, String roomname, String[] members) { super(sn, re...
PHP
UTF-8
1,376
2.65625
3
[]
no_license
<?php namespace Security\Mapper; use Security\Entity\RoleEntityInterface; use User\Entity\UserEntityInterface; /** * @author Rok Mohar <rok.mohar@gmail.com> * @author Rok Založnik <tugamer@gmail.com> */ interface RoleMapperInterface { /** * @param \Security\Entity\RoleEntityInterface $role */ pu...
Java
UTF-8
2,328
2.046875
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 io.github.bpodolski.caspergis.project.project; import io.github.bpodolski.caspergis.beans.MapBean; import io.github.bp...
C#
UTF-8
5,807
2.71875
3
[]
no_license
using Discord; using Discord.WebSocket; using Modules.NotificationParser; using System; using System.Collections.Generic; using System.Text; using System.Threading.Tasks; using YahurrFramework; using YahurrFramework.Attributes; namespace Modules { [Config(typeof(NotificationModuleConfig))] [RequiredModule(typeof(Jo...
JavaScript
UTF-8
939
2.8125
3
[]
no_license
var firstName = document.querySelector("#firstName"); var lastName = document.querySelector("#lastName"); var username = document.querySelector("#username"); // const email = document.querySelector("#email") as HTMLInputElement var age = document.querySelector("#age"); var gender = document.querySelector("#gender"); va...
Markdown
UTF-8
2,663
2.953125
3
[]
no_license
## 关于宜春话 ## 很遗憾的一件事,就是不会说流利的宜春话,记得有一次做火车和一个大叔侃大山,他说江西就两种话好听,宜春话和萍乡话,一个是我出生的地方,一个是我祖籍的地方,多谢大叔称赞呵呵 不会说的原因是老妈的训练吧,很小就喜欢把我放在电视机前让我看天气预报....不过虽然说不利索,但作为地道的宜春人,还是很喜欢宜春话的,前段时间看校内有人共享宜春话简易教程,简单做一些补充呵呵 1.宜春话中的智慧 基本学所有的方言,都是从骂人开始的,宜春话中比较常用的一种说法是现世,引自中国古典某著名小说,原用为现世活宝,后简化为现世宝,在宜春话里简称现世,指一个人丢人现眼,发音略有不同/sian shi/都发第...
JavaScript
UTF-8
10,159
2.546875
3
[ "BSD-3-Clause" ]
permissive
/** * Copyright (c) 2006, Opera Software ASA * All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright * notice, this list...
JavaScript
UTF-8
851
3.734375
4
[]
no_license
// point 1 const geocodeFromRoppongiHills = { latitude: 35.6817124, longitude: 139.7166117 }; const geocodeFromAkihabara = { latitude: 35.7022077, longitude: 139.7722703 }; function getDistance (geocodeA, geocodeB) { // point 1 const between2parallels = 111.3; // unit: km const between2meridians = 71.5; // unit:...
Java
UTF-8
150
1.875
2
[]
no_license
/** * @author Ezekiel Elin * @version October 4, 2016 */ public enum CellDirection { UP, DOWN, RIGHT, LEFT, UPRIGHT, UPLEFT, DOWNRIGHT, DOWNLEFT }
Markdown
UTF-8
848
3.03125
3
[]
no_license
this is the javaScript basic project I'm gonna start, it should be difficult as the guide says so . it is a pad of many square divs that changes darkness when mouse hovers on it.. that all I know for now UPDATE: well the project is done, and at the end it is a Sketch pad with the default density of 16 rows and 16 colu...
PHP
UTF-8
1,944
2.875
3
[]
no_license
<?php namespace common\crpty; /** * error code 说明. * <ul> * <li>-40001: 签名验证错误</li> * <li>-40002: xml解析失败</li> * <li>-40003: sha加密生成签名失败</li> * <li>-40004: encodingAesKey 非法</li> * <li>-40005: appid 校验错误</li> * <li>-40006: aes 加密失败</li> * <li>-40007: aes 解密失败</li> * <li>-40008: 解密后得到的b...
Java
UTF-8
258
2.609375
3
[ "Apache-2.0" ]
permissive
package property.enums; public enum enumCautionKind { NORMAL("green"), CATUION("yellow"), ERROR("red"), INTERNAL_ERROR("red"); private String kind; enumCautionKind(String str){ kind = str; } public String getString(){ return kind; } }
Java
UTF-8
1,695
2.59375
3
[ "Apache-2.0" ]
permissive
package nl.pc.bookshop.category.repository; import nl.pc.bookshop.category.model.Category; import javax.persistence.EntityManager; import javax.persistence.Query; import java.util.List; @SuppressWarnings("JpaQlInspection") public class CategoryRepository { private EntityManager em; public CategoryReposito...
Java
UTF-8
1,000
2.734375
3
[]
no_license
package bitTorrent.metainfo; /** * * Describes the "info" dictionary in a Single Mode File. * */ public class InfoDictionarySingleFile extends InfoDictionary { //Length of the file in bytes. private int length; //(optional) a 32-character hexadecimal string corresponding to the MD5 sum of the f...
Markdown
UTF-8
3,307
2.5625
3
[]
no_license
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/ae72f2c2cd3a414b9fe2f81e453749d8)](https://www.codacy.com/app/joesan/csv-parser?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=joesan/csv-parser&amp;utm_campaign=Badge_Grade) [![Build Status](https://travis-ci.org/joesan/csv-parser.svg?branch=ma...
Ruby
UTF-8
1,086
3.84375
4
[ "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-public-domain" ]
permissive
require "pry" def sort_array_asc (array) array.sort do |a, b| if a == b 0 elsif a < b -1 else a > b 1 end end end def sort_array_desc (array) array.sort do |a, b| if a==b 0 elsif a<b 1 else a>b -1 end end end def sort_array_char_count (array...
Python
UTF-8
5,795
2.703125
3
[]
no_license
import sys from pathlib import Path from typing import Tuple import torch from torch.utils.tensorboard import SummaryWriter from picogpt import utils from picogpt.dataset import ( Tokenizer, TransformerDataset, CharTokenizer, TiktokenTokenizer, SentencePieceTokenizer, HuggingFaceTokenizer, ...
JavaScript
UTF-8
1,176
3.359375
3
[]
no_license
//Напиши скрипт который, при наборе текста в //инпуте input#name-input (событие input), //подставляет его текущее значение в span#name-output. // Если инпут пустой, в спане должна отображаться // строка 'незнакомец'. let inputName = document.getElementById("name-input") let outputName = document.getElementById("nam...
Markdown
UTF-8
807
3.234375
3
[ "MIT", "CC-BY-SA-4.0" ]
permissive
# How to Know who is in charge of your campsite on Facebook Local communities are ever-changing, and there can be more than one Volunteer Community Manager for your city. To become an Admin in the Facebook group, follow the steps below. How to find out who is an Admin for your Local Group: - First, click the Members...
C
UTF-8
2,488
2.90625
3
[ "BSD-4-Clause-UC" ]
permissive
#ifndef PARLIB_ARCH_BITMASK_H #define PARLIB_ARCH_BITMASK_H #include <string.h> #include <sys/types.h> #include <sys/param.h> #include <arch/atomic.h> #include <stdio.h> #define DECL_BITMASK(name, size) \ uint8_t (name)[BYTES_FOR_BITMASK((size))] #define BYTES_FOR_BITMASK(size) \ (((size) - 1) / 8 + 1) #define BY...
Java
UTF-8
284
2.1875
2
[]
no_license
package duke; import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.jupiter.api.Test; class EventTest { @Test public void testEvents() { assertEquals("E | 0 | meeting | 2020-08-16", new Event("meeting", "2020-08-16").writeToFile()); } }
Python
UTF-8
89
3.28125
3
[]
no_license
a = [2,3,4,5,10] b = [] sqr= [ i*i for i in a] print('Positive list of numbers: ',sqr)
Java
UTF-8
2,812
2.640625
3
[]
no_license
package formdata; import java.io.PrintWriter; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.List; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.s...
TypeScript
UTF-8
2,979
3.015625
3
[ "ISC" ]
permissive
/* File: src/pipeline/show-nonprinting.ts cpuabuse.com */ /** * Shows non-printing characters. * Code converted from [coreutils repository](https://github.com/coreutils/coreutils/blob/master/src/cat.c). */ /** * An empty string. */ const emptyString: string = ""; /** * A delete character. *...
Markdown
UTF-8
1,554
3.109375
3
[]
no_license
# The Carriage Environment <img align="right" src="https://github.com/eishub/carriage/wiki/carriage.png"/> The carriage environment consists of a *carriage* and *two robots* that can either *push* the carriage or do nothing, i.e., *wait*. The robots and the carriage are positioned on a ring with only three positions ...
Go
UTF-8
3,483
3.03125
3
[]
no_license
// Package enc provides a simple interface for encrypting and decrypting data to // a useful format. // // First, the data item is encoded to as a gob. Next, the encoding is compressed // to the gzip format. This is encrypted with AES-256 in Galois/Counter mode. // The input password is derived with argon2i and the has...
Java
UTF-8
743
2.15625
2
[ "MIT" ]
permissive
package ru.stud.person.mapper; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; import org.springframework.stereotype.Component; import ru.stud.person.Person; import java.io.File; import java.io.IOException; import java.util.List; @Component public c...
Markdown
UTF-8
4,772
3.015625
3
[]
no_license
---- Time: 20190527 译者:BING ---- [TOC] # 2. 使用Python解释器 ## 2.1 调用解释器 Python解释器通常安装在`/usr/localbin/python3.7`下,将`/usr/local/bin`放在Unix脚本搜索路径下,可以使得下面的命令可以在命令行执行: ```python python3 ``` 解释器的安装位置是可选的,其他地方也是可以的。 在`Windows`机器上,`Python`安装通常在`C:\Python37`中,虽然你在运行安装时可能改变了位置。为了将这个文件夹添加到路径,可以用下面的命令: ```python set path=%...
Shell
UTF-8
1,310
3.5625
4
[ "MIT" ]
permissive
set -e # bl: we only need to get docker tag info if we are deploying. if we're stopping, then we don't need it if [ "${DEPLOY_TYPE}" != "stop" ]; then # if auto deploy, find the latest version based on ./docker/export-narrative-build-vars.sh deploy if [ "${DOCKER_TAG_DEPLOY}" == "" ]; then echo "DOCKER_TAG_DEP...
Java
UTF-8
191
1.6875
2
[]
no_license
package com.example.fcode4; /** * Created by wuzhuojun on 2016/8/2 0002. * 更新 UI 界面的接口 */ public interface OnUpdateUIListener { void OnUpdateUIListener(String result); }
PHP
UTF-8
8,785
2.875
3
[]
no_license
<?php /** * Metrou_Authenticator * * _set() auth.hashList to an array of HashAdapter objects. * Any class that has hashPassword($password) and comparePasswordHash($password, $hash) will do. */ class Metrou_Authenticator { public $handler = NULL; public $handlerList = array(); public $ctx = NULL; p...
C++
UTF-8
1,206
3.40625
3
[]
no_license
#include "card.h" Card::Card(int nr, char suit) : m_nr{nr} , m_suit{suit} { } std::ostream& operator << (std::ostream& valja, Card& c){ if(c.getNr()>1 && c.getNr()<11) return valja << c.getNr() << " " << c.getSuit(); else if(c.getNr() == ...
C#
UTF-8
2,315
2.640625
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.Xna.Framework; using XNA3D.Collision.Interfaces; namespace XNA3D.Collision.Bodies { public class CollisionLinkAABB2 : CollisionLink<ICollisionAABB, ICollisionAABB> { public CollisionLinkAABB2(ICollisi...
C++
UTF-8
1,551
3.609375
4
[]
no_license
#include<bits/stdc++.h> using namespace std; struct node{ int value; struct node *left; struct node *right; }; struct node* createNode(int value){ struct node *root = (struct node *)malloc(sizeof(struct node)); root->value = value; root->right = NULL; root->left = NULL; return root; } struct node* mirror(st...
C#
UTF-8
738
2.578125
3
[]
no_license
using System; [Serializable] public class IntrigueCard : AbstractProgressCard { public IntrigueCard (int id) : base(id) { CardType = ProgressCardType.Politic; } public override void ExecuteCardEffect() { GameManager.LocalPlayer.GetComponent<GamePlayer> ().intrigueProgressCardUsed = true; UIIntrigueProgress...
C++
UTF-8
569
2.828125
3
[]
no_license
#include <stdio.h> #define SENTENCE_LENGTH 65535 #ifndef _MSC_VER #define gets_s gets #endif bool isVowel(char alphabet) { return (alphabet == 'a') || (alphabet == 'A') || (alphabet == 'e') || (alphabet == 'E') || (alphabet == 'i') || (alphabet == 'I') || (alphabet == 'o') || (alphabet == 'O') || (alphabet == 'u'...
C++
UTF-8
1,003
3.328125
3
[]
no_license
#pragma once #include <stdlib.h> #include <string.h> #include <boost/scoped_ptr.hpp> namespace rage { class Buffer // buffer for data storage { private: boost::scoped_ptr<char> data; // data in buffer unsigned int size; // total size of buf (in bytes) protected: char* getCBuffer() const { // get ...
Python
UTF-8
715
2.9375
3
[ "MIT" ]
permissive
import os, json, sys class Config(object): def __init__(self): script_dir = os.path.dirname(__file__) config_rel_path = 'config.json' config_abs_path = os.path.join(script_dir, config_rel_path) try: with open(config_abs_path) as config_file: config = jso...
Java
GB18030
4,089
3.65625
4
[]
no_license
package com.just.play; import java.lang.reflect.Array; import java.util.Arrays; public class Hello { public static void main(String[] args){ /* * תdouble8ֽڣתΪint4ֽڣ */ double avg = 77.5; int rise =5; int avg2 = (int) (avg + rise);//ǿתݲǽСֽȥ double arg3 = avg + rise; System.out.println(avg...
Shell
UTF-8
648
3.71875
4
[ "MIT" ]
permissive
#!/bin/bash # This script is to be run after the code is deployed to its hosting environment user="$1" if [ -z "$user" ]; then echo "Please provide the username for the service to use as the first argument" exit 1 fi cat > /etc/systemd/system/mobro.service << HEREDOC_END [Unit] Description = Controls the ...
Java
UTF-8
2,139
2.59375
3
[]
no_license
package gr.ds.unipi.spades.queries; import java.util.HashMap; import org.apache.commons.lang3.StringUtils; public class Query { protected int jaccardCount; protected int haversineCount; protected int pairsCount; protected int quadTreeDuplications; protected int regularGridDuplications; protected int mbrCount;...
Java
UTF-8
629
2.015625
2
[]
no_license
package com.gradle.gradle; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @RestController @SpringBootApplication public...
C++
UTF-8
602
3.234375
3
[]
no_license
#include "Singleton.h" #include <iostream> using namespace std; Singleton* Singleton::pInstance1 = NULL; pthread_mutex_t Singleton::lock = PTHREAD_MUTEX_INITIALIZER; Singleton::Singleton() { cout<< "Singleton..." << endl; } Singleton* Singleton::Instance() { if(NULL == pInstance1) { //Double-checked Loc...
Python
UTF-8
4,341
2.828125
3
[]
no_license
from nltk.corpus import brown import operator import numpy as np SENTENCES_KEEP_WORDS=['king', 'man', 'queen', 'woman', 'italy', 'rome', 'france', 'paris', ...
Java
UTF-8
2,461
3.109375
3
[]
no_license
package week3; import org.junit.Before; import org.junit.Test; import static org.junit.Assert.*; import java.util.Random; public class Week3Test { int[] arrayInit(int min){ Random rand = new Random(); int n = rand.nextInt(100); int[] a = new int[n+1]; a[n] = min; for(int i...
Java
UTF-8
230
1.703125
2
[ "Apache-2.0" ]
permissive
package org.ithang.tools.model; /** * 常量类 * @author Administrator * */ public class Const { public final static int LogType_SystemBoot=1;//系统启动 public final static int LogType_SystemDonw=2;//系统关闭 }
Python
UTF-8
2,061
2.6875
3
[ "MIT" ]
permissive
from pyaml import yaml import argparse import rl_learning as rl def load_config(config_file): with open(config_file) as f: config = yaml.load(f) return config def train_rl_agent(config, train=True): environment_params = config['environment_params'] rl_params = config['rl_params'] model_p...
Python
UTF-8
116
3.125
3
[]
no_license
n=int(input()) for i in range(n): m=int(input()) if(m%5==0): print(-1) else: print(m%5)
Python
UTF-8
3,270
2.578125
3
[ "MIT" ]
permissive
from pynmmso.listeners.base_listener import BaseListener class MultiListener(BaseListener): """ Listener that contains multiple listeners and calls them for each event. """ def __init__(self): super().__init__() self.listeners = [] def add_listener(self, listener): """ ...
Go
UTF-8
607
3.75
4
[]
no_license
package main import ( "fmt" ) func main() { array := [6]int{2, 3, 4, 5, 6, 7} findMax(array[:]) findMin(array[:]) calculateAverage(array[:]) } func findMax(arr []int) { max := arr[0] for _, v := range arr { if v > max { max = v } } fmt.Println(max) } func findMin(arr []int) { min := arr[0] for _,...
Python
UTF-8
235
3.1875
3
[]
no_license
f = open("c:\python\scores.txt","r") participants = {} for line in f: entry = line.strip().split(",") participant = entry[0] score = entry[1] participants[participant] = score print(participant + ":" + score) f.close
C++
UTF-8
1,914
2.796875
3
[ "MIT" ]
permissive
/////////////////////////////////////////////////////////////////////////////// /// /// \file ObjectStore.hpp /// Declaration of the ObjectStore. /// /// Authors: Chris Peters /// Copyright 2010-2011, DigiPen Institute of Technology /// ///////////////////////////////////////////////////////////////////////////...
Java
UTF-8
1,916
2.453125
2
[]
no_license
package sk.lacko.reality_scanner; import com.gargoylesoftware.htmlunit.WebClient; import com.gargoylesoftware.htmlunit.html.HtmlPage; import org.apache.commons.cli.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.CommandLineRunner; import org.springframework.boot.Spring...
JavaScript
UTF-8
769
3.453125
3
[]
no_license
//basic way function MyClass(pArgs) { this.construct = function () { this.attr1 = 42; this.attr2 = 42; this.attr3 = 42; this.attr4 = 42; }; this.method1 = function () { doStuffs; }; this.method1 = function () { doStuffs; }; this.method1 = function () { doStuffs; }; ...
Java
UTF-8
3,204
2.5
2
[ "MIT" ]
permissive
package nbpio.project; public final class LibraryDefinition { private final int id; private final String name; private final AuthorDefinition[] authors; private final String description; private final RepositoryDefinition repository; private final String[] frameworks; private final Str...
TypeScript
UTF-8
232
2.734375
3
[]
no_license
import {isNullOrUndefined} from 'util'; export class StringUtils { static isEmpty(text: string): boolean { if (isNullOrUndefined(text)) { return true; } text = text.trim(); return text === ''; } }