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 |
|---|---|---|---|---|---|---|---|
Swift | UTF-8 | 552 | 2.703125 | 3 | [] | no_license | import Foundation
extension Smoke {
public struct Craving: Codable {
public let reason: Reason?
public let trigger: Trigger
public let date: Date
public init(_ reason: Reason?, _ trigger: Trigger) {
self.reason = reason
self.trigger = trigger
... |
C++ | UTF-8 | 9,236 | 2.828125 | 3 | [
"MIT"
] | permissive | #include "WilcoxonTest.h"
WilcoxonTest::WilcoxonTest(float * _data, int _dataXsize, int _dataYsize, string _testIndexes, string _controlIndexes)
{
data = _data;
dataXsize = _dataXsize;
dataYsize = _dataYsize;
testIndexes = parseIntString(_testIndexes);
controlIndexes = parseIntString(_controlIndexe... |
JavaScript | UTF-8 | 1,715 | 2.609375 | 3 | [] | no_license | var express = require('express');
const os = require('os');
var app = express();
var path = require('path');
const nunjucks = require('nunjucks');
nunjucks.configure('views', {
autoescape: true,
express: app
});
let host = '192.168.1.69'; // Choose a different loopback address
let port = '9373'; /... |
C++ | UTF-8 | 2,368 | 2.53125 | 3 | [
"AFL-2.0"
] | permissive | //
// Created by calabash_boy on 18-10-6.
//
//求树上长度小于等于k的有向路径数
#include<stdio.h>
#include<algorithm>
#include<cstring>
using namespace std;
const int MAX = 1e4+100;
const int INF = 0x3f3f3f3f;
int first [MAX*2]; int des[MAX*2];
int len[MAX*2]; int nxt[MAX*2];
int n,k,tot; int a[MAX]; int sum[MAX];
int dp[MAX]; in... |
Python | UTF-8 | 532 | 3.78125 | 4 | [] | no_license | def sort_artists(tp):
result =[]
value =[]
for s in tp:
for item in s:
try:
if item.isnumeric:
result.append(item)
except:
value.append(item)
result.sort()
value.sort(reverse=True)
final... |
Java | UTF-8 | 2,040 | 2.578125 | 3 | [] | no_license | package com.examples.com.aspect;
import com.examples.com.EntityNotFoundException;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.AfterThrowing;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lan... |
Java | UTF-8 | 1,920 | 2.375 | 2 | [] | no_license | package com.hyphenate.easeui.domain;
import android.os.Parcel;
import android.os.Parcelable;
/**
* @author lishuqi
* @date 2018/3/26
*/
public class AddMedicationTemplate implements Parcelable {
private String name;
private int num;
private String remark;
private int medicine_id;
public String... |
JavaScript | UTF-8 | 2,311 | 2.53125 | 3 | [] | no_license | import React from 'react';
import PropTypes from 'prop-types';
import Location from './Location';
export default function Locations({ flyerEvents, isFullTourListing, isTourAbbrev }) {
let eventLocations = flyerEvents.map(event => {
let eventLocation = {}
if (isFullTourListing) {
for (const [key, val] o... |
Swift | UTF-8 | 1,347 | 3.234375 | 3 | [
"MIT"
] | permissive | import Foundation
public final class Votable: NSObject {
public var name = ""
public var meta = ""
public var id: Int64 = 0
}
extension Votable: Decodable {
public convenience init(from decoder: Decoder) throws {
self.init()
let container = try decoder.container(keyedBy: CodingKey... |
C++ | UTF-8 | 1,934 | 2.734375 | 3 | [
"BSD-3-Clause",
"MIT",
"Zlib",
"LicenseRef-scancode-public-domain"
] | permissive | #ifndef DUNJUN_GRAPHICS_SHADERPROGRAM_HPP
#define DUNJUN_GRAPHICS_SHADERPROGRAM_HPP
#include <Dunjun/Math/Types.hpp>
#include <Dunjun/Graphics/Transform.hpp>
#include <Dunjun/Graphics/Color.hpp>
#include <Dunjun/Core/ContainerTypes.hpp>
#include <Dunjun/Core/String.hpp>
namespace Dunjun
{
enum class ShaderType
{
Ve... |
Markdown | UTF-8 | 1,713 | 2.96875 | 3 | [
"Apache-2.0"
] | permissive | ### Activities
To track admin activities you need to define it on seed.yml on `permissions` key
- `role` should be in a range of existing: `admin`, `superadmin`, `support`, `techical`, `accountant`
- `verb` should be `post`, `get`, `put`, `delete`
- `path` - endpoint which should be checked, should be started with `ap... |
Java | UTF-8 | 2,487 | 2.125 | 2 | [] | no_license | package kj.pos.entity.product;
import kj.pos.entity.BaseEntity;
import org.apache.ibatis.type.Alias;
import java.util.Date;
import java.io.Serializable;
@Alias("ProductSku")
public class ProductSku extends BaseEntity{
//创建字段
private Long id;//skuId
private Long pid;//商品信息表(product id)
private String p... |
C | UTF-8 | 684 | 3.046875 | 3 | [] | no_license | #include <stdio.h>
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
#include <sys/mman.h>
int i;
typedef struct s{
char name[20];
char lastName[20];
unsigned int id;
unsigned char cal;
} Student;
int main(){
char *fileName = "studentDb.data";
int fd = open(filename, 0_RDWR);
int id;
Student *pAvanz... |
Java | UTF-8 | 1,134 | 2.609375 | 3 | [] | no_license | package day36_Agustos_09_2021_dersi_inheritance01;
public class Isci extends Muhasebe{
public static void main(String[] args) {
Isci i1=new Isci();
i1.isim="Cumali";
i1.soyisim="Korkmaz";
i1.adres="falan fesmekan";
i1.saatUcreti=10;
i1.statü="chief";
i1.tel="12345";
i1.id=i1.idAta();
i1.maas... |
TypeScript | UTF-8 | 2,511 | 3.140625 | 3 | [
"MIT"
] | permissive | import { ts } from 'ts-morph'
import { Expression, tabs, generateTempBindingName } from ".";
let operatorsMap = {
'==': 'equal',
'===': 'equal',
'!=': '/=',
'!==': '/=',
'!': 'not',
'&&': 'and',
'||': 'or'
} as { [index: string]: string };
let assignOperators = [
'+=',
'-=',
'*=',
'/='
]
export class Bina... |
Python | UTF-8 | 1,945 | 3.578125 | 4 | [] | no_license | ###############################################
# Author: Rafael Passos Guimarães
# E-mail: rapassos@gmail.com
# Date: 10/Jul/2020
###############################################
conjunto = {1, 2, 3, 4, 4, 2, 4}
print(type(conjunto))
print(conjunto)
conjunto.add(5)
print(conjunto)
conjunto.discard(2)
print(conjunto... |
Python | UTF-8 | 502 | 2.53125 | 3 | [
"MIT"
] | permissive | import os
import pytest
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
from models import LogisticModel
def test_logistic_model():
model = LogisticModel({'solver': 'liblinear'})
X, y = load_iris(return_X_y=True)
xtr... |
Java | UTF-8 | 11,844 | 1.914063 | 2 | [] | no_license | package com.maywide.biz.prd.web.action;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.apache.struts2.rest.DefaultHttpHeaders;
import org.apache.st... |
Markdown | UTF-8 | 990 | 3.328125 | 3 | [] | no_license | # Bulk Image Resizer
Python script that utilizes PIL and glob packages in order to resize all the images of given format at the designated path folder as well as in it's subfolders. Images can be both upscaled and downscaled, however since the program uses LANCZOS filter, upscaling can be exceptionally slow for large ... |
Shell | UTF-8 | 954 | 3.75 | 4 | [
"Apache-2.0"
] | permissive | #!/bin/bash
set -e
set -o xtrace
if [[ $# -lt 2 ]];
then
echo "usage: ./kitchen_work.sh p4 template [outdir]"
exit 1
fi
if [[ ! -f $1 ]];
then
echo "no such file $1"
exit 1
fi
if [[ ! -f $2 ]];
then
echo "template doesn't exist"
fi
fname=$1
template=$2
outdir=${3:-.}
if [[ ! -d $outdir ]];
then
... |
JavaScript | UTF-8 | 3,191 | 2.78125 | 3 | [] | no_license | // not animated collapse/expand
function togglePannelStatus(content)
{
var expand = (content.style.display=="none");
content.style.display = (expand ? "block" : "none");
}
// current animated collapsible panel content
var currentContent = null;
function togglePannelAnimatedStatus(content, interval, step, pane... |
Java | UTF-8 | 734 | 1.945313 | 2 | [
"Apache-2.0"
] | permissive | package de.ipvs.as.mbp.domain.rules;
import de.ipvs.as.mbp.domain.user_entity.UserEntityRequestDTO;
import java.util.List;
/**
* DTO for rules.
*/
public class RuleDTO extends UserEntityRequestDTO {
private String name;
private String trigger;
private List<String> actions;
public String getName... |
C# | UTF-8 | 951 | 2.859375 | 3 | [
"MIT"
] | permissive | using System;
namespace SnapUi {
public class RequiredAncestorNotFoundException : Exception {
public RequiredAncestorNotFoundException()
: base(CreateMessage()) { }
public RequiredAncestorNotFoundException(string message)
: base(message) { }
public RequiredAnces... |
Python | UTF-8 | 7,900 | 2.6875 | 3 | [
"Apache-2.0"
] | permissive | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This file contains tools used in our parser for BEL statements.
"""
# Standard Library
import collections
import json
import math
import os
import pprint
import random
import re
import string
from typing import Any, List, Mapping
# Third Party Imports
import yaml
# ... |
PHP | UTF-8 | 2,177 | 3.15625 | 3 | [] | no_license | <?php
namespace Alpadia\Models\Repositories;
use Alpadia\Models\Entities\Game as Game;
use Alpadia\Models\Factories\GameFactory as GameFactory;
use Alpadia\Models\Repositories\Repository as Repository;
use Alpadia\Models\Repositories\RepositoryInterface as RepositoryInterface;
use Illuminate\Database\QueryException a... |
JavaScript | UTF-8 | 832 | 2.765625 | 3 | [
"MIT"
] | permissive | 'use strict';
var Logger = function (loggerConfig) {
var levels = {
debug: 4,
info: 3,
warn: 2,
error: 1,
abort: 0
};
console.log('config:', loggerConfig);
var currentLevel = levels[loggerConfig.level] || 2;
this.debug = function(msg){
if(currentLe... |
Java | UTF-8 | 3,003 | 1.890625 | 2 | [] | no_license | package nta.med.service.ihis.handler.cpls;
import java.util.List;
import javax.annotation.Resource;
import nta.med.data.dao.medi.cpl.Cpl3020Repository;
import nta.med.data.model.ihis.cpls.CPL0000Q00GetSigeyulDataSelect2ListItemInfo;
import nta.med.core.infrastructure.socket.handler.ScreenHandler;
import nta.med.serv... |
C# | UTF-8 | 2,737 | 2.953125 | 3 | [] | no_license | using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text.RegularExpressions;
namespace ExchangeRateUpdater
{
public class ExchangeRateProvider
{
private const string ExchangeRatesUrl = "https://www.cnb.cz/en/financial-markets/foreign-exchange-market" +
... |
JavaScript | UTF-8 | 352 | 3.375 | 3 | [] | no_license | const ler = require("prompt-sync")();
var cartas = 0;
do {
var valor = Number(ler("Digite o valor da carta: "));
cartas = cartas + valor;
} while (cartas < 21);
if (cartas > 21){
console.log("O carteiro venceu, o valor utrapassou e alcançou:", cartas,"cartas");
} else {
console.log("Parabéns você vence... |
Python | UTF-8 | 111 | 2.703125 | 3 | [] | no_license | # https://www.codewars.com/kata/58b57f984f353b3dc9000030
palindrome=lambda n,c:c+c[-1]*(n-2*len(c)+1)+c[-2::-1] |
Python | UTF-8 | 343 | 2.59375 | 3 | [] | no_license |
def encrypt(key, message):
KD1=[x for x in zip(key[0::2], key[1::2])]
KD2=[x for x in zip(key[1::2], key[0::2])]
KD=[]
for x in KD1:
if all(y[0]!=x[0] for y in KD):
KD.append(x)
KD2=[x[::-1] for x in KD]
D=dict(KD+KD2)
res=''
for x in message:
if x in D:
res+=D[x]
else:
... |
C++ | UTF-8 | 1,334 | 3.484375 | 3 | [] | no_license | #include "GameObject.h"
// Construct a GameObject
GameObject::GameObject(char in_code) {
this -> display_code = in_code;
this -> id_num = 1;
this -> state = 0;
cout << "GameObject constructed." << endl;
}
// Construct a GameObject
GameObject::GameObject(Point2D in_loc, int in_id, char in_code) {
... |
SQL | UTF-8 | 543 | 2.90625 | 3 | [] | no_license | CREATE Procedure sp_update_GRN_RecdInvoice(@GRNID Int,
@RecdInvoiceID Int)
As
Update GRNAbstract Set RecdInvoiceID = @RecdInvoiceID Where GRNID = @GRNID
IF (SELECT SUM(Pending) from InvoiceDetailReceived WHERE InvoiceID = @RecdInvoiceID) = 0
Update InvoiceAbstractReceived Set Status = IsNull(Status, 1) | 129 Wh... |
PHP | UTF-8 | 2,274 | 2.59375 | 3 | [
"BSD-3-Clause",
"MIT"
] | permissive | <?php
namespace Tracker\AdminBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
u... |
PHP | UTF-8 | 1,261 | 2.671875 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: fintara
* Date: 07/01/2017
* Time: 23:11
*/
namespace AppBundle\Security\User;
use AppBundle\Entity\User;
use AppBundle\Repository\UserRepository;
use Symfony\Component\Security\Core\Exception\UnsupportedUserException;
use Symfony\Component\Security\Core\Exception\Userna... |
Shell | UTF-8 | 658 | 2.765625 | 3 | [] | no_license | # Contributor: phillipe <phillipe@archlinux.com.br>
pkgname=usbmanager
pkgver=1.0.0
pkgrel=1
pkgdesc="An USB storage management interface."
arch=('any')
url="https://launchpad.net/usbmanager"
depends=('hal' 'gtk2' 'python>=2.6' 'pygtk' 'python-notify')
optdepends=('mtools: to get the name [label] of the usb device.')
l... |
Java | UTF-8 | 951 | 2.9375 | 3 | [
"Apache-2.0"
] | permissive | package net.spizzer.aoc2019.intcode;
import net.spizzer.aoc2019.common.ValueBase;
import java.util.ArrayList;
import java.util.List;
enum ParameterMode implements ValueBase<Integer> {
POSITION(0),
IMMEDIATE(1),
RELATIVE(2);
private final int value;
ParameterMode(int value) {
this.value ... |
Java | UTF-8 | 584 | 2.671875 | 3 | [] | no_license | package com.cleancode.core.contract.qualifier;
import java.util.Arrays;
public enum TypeLibrary {
SMALL("small"), BIG("big");
private String tipo;
TypeLibrary(final String tipo) {
this.tipo = tipo;
}
public String getTipo() {
return tipo;
}
public void setTipo(String tipo) {
this.... |
C++ | UTF-8 | 3,518 | 2.609375 | 3 | [] | no_license | #include "GameConfig.h"
#include <fstream>
#include <cstdlib>
#include <sstream>
#define FAILURE 256
__uint32 ServerConfig::MAX_PLAYER_NUMBER = 2000;
__uint32 ServerConfig::MAX_ROOM_NUMBER = 50;
__uint32 ServerConfig::MAX_ROOM_PLAYER = 40;
__uint32 ServerConfig::SOCK_SEND_TIME_LIMIT = 500;
__uint32 ServerConfig::SOC... |
Markdown | UTF-8 | 1,991 | 3.09375 | 3 | [] | no_license | ---
title: "How can chess positions be kept track of?"
author: "Josh Merrell"
date: "April 7, 2016"
commments: true
tags:
- R Packages
- Analytics
- Chess
categories:
- R Packages
---
I keep track of chess positions using a data frame of 64 variables, one for each square of the chessboard. An example of an empty che... |
JavaScript | UTF-8 | 1,248 | 2.546875 | 3 | [
"MIT"
] | permissive | let fetch = require('node-fetch')
let handler = async (m, { conn, command }) => {
if (/^tod$/i.test(command)) {
conn.send3Button(m.chat, 'Truth or Dare', 'ariabotz | pesan otomatis', 'TRUTH', ',truth', 'DARE', ',dare', 'RANDOM', `${pickRandom([',dare', ',truth'])}`)
}
if (/^truth$/i.test(command)) {
let r... |
Python | UTF-8 | 575 | 3.921875 | 4 | [] | no_license | '''
Write a function called compact.
This function accepts a list and returns a list of values that are truthy values, without any of the falsey values.
compact([0,1,2,"",[], False, {}, None, "All done"]) # [1,2, "All done"]
'''
#1st Solution
# def compact(collection):
# buildlist = []
# for collect in co... |
Markdown | UTF-8 | 4,902 | 2.96875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | # tusd
> **tus** is a protocol based on HTTP for *resumable file uploads*. Resumable
> means that an upload can be interrupted at any moment and can be resumed without
> re-uploading the previous data again. An interruption may happen willingly, if
> the user wants to pause, or by accident in case of an network issue ... |
Markdown | UTF-8 | 3,975 | 2.5625 | 3 | [
"CC-BY-4.0",
"MIT"
] | permissive | ---
title: Använd delade VM-avbildningar för att skapa en skalnings uppsättning i Azure PowerShell
description: Lär dig hur du använder Azure PowerShell för att skapa delade VM-avbildningar som ska användas för distribution av skalnings uppsättningar för virtuella datorer i Azure.
author: cynthn
ms.service: virtual-mac... |
C | UTF-8 | 3,296 | 3.921875 | 4 | [] | no_license | // 把较长的输入行 “折” 成短一些的两行或者多行,
// 折行的位置在输入行的第n列之前的最后一个非空格之后
// 要保证程序能够智能地处理输入行很长以及在指定的列前
// 没有空格或者制表符的情况
#include <stdio.h>
#define MAXCOL 10 // maximum column of input
#define TABINC 8 // tab increment size
char line[MAXCOL]; // input line
int exptab(int pos);
int findblnk(int pos);
int newpos(int po... |
Markdown | UTF-8 | 13,273 | 3.375 | 3 | [] | no_license |
- [概述](#概述)
- [区间问题](#区间问题)
- [435.无重叠区间](#435无重叠区间)
- [452.用最少数量的箭引爆气球](#452用最少数量的箭引爆气球)
- [1024. 视频拼接](#1024-视频拼接)
- [跳跃游戏](#跳跃游戏)
- [55. 跳跃游戏](#55-跳跃游戏)
- [45. 跳跃游戏 II](#45-跳跃游戏-ii)
- [134. 加油站](#134-加油站)
- [135. 分发糖果](#135-分发糖果)
# 概述
- 贪心:**每一步都做出一个局部最优的选择,最终的结果就是全局最优**
- 贪心算法可以认为是**动态规划算法的一个特例**,相... |
C++ | UTF-8 | 3,378 | 3.203125 | 3 | [] | no_license | #include "pch.h"
#include <iostream>
#include <string>
#include <windows.h>
#include <stdio.h>
using namespace std;
string Input_Inf_Str(int &str) // метод ввода неопределенного количества строк
{
string s, result; // s - буферная строка, в нее читаем информацию с клавиатуры
//result - итоговая строка, ... |
Markdown | UTF-8 | 8,127 | 2.71875 | 3 | [] | no_license | Title: Release Management
Description: Create managed continuous deployment pipelines to release quickly, easily, and often
ms.TocTitle: Release
ms.ContentId: 008EE4E4-26E4-4A18-B60D-CD74106834DC
# Release Management
Manage the release of your app by deploying it to a specific
environment for each separate release s... |
Java | UTF-8 | 6,586 | 2.0625 | 2 | [] | no_license | package by.slivki.trainings.rest;
import by.slivki.trainings.dao.jpa.Role;
import by.slivki.trainings.dao.jpa.RoleEnum;
import by.slivki.trainings.rest.mapper.ApplicationMapper;
import by.slivki.trainings.service.api.ApplicationService;
import by.slivki.trainings.service.api.UserService;
import by.slivki.trainings.uti... |
Java | UTF-8 | 7,046 | 2.78125 | 3 | [
"Apache-2.0"
] | permissive | /**
* Copyright 2004-2009 Tobias Gierke <tobias.gierke@code-sourcery.de>
*
* 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 req... |
Shell | UTF-8 | 325 | 3.21875 | 3 | [
"MIT"
] | permissive | #!/bin/bash
# Counts the number of backup points in a repo
while getopts u:r:p: option
do
case "${option}"
in
u) USER=${OPTARG};;
r) REPO=${OPTARG};;
p) PASSWORD=${OPTARG};;
esac
done
export BORG_PASSPHRASE=$PASSWORD
export BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=YES
/usr/bin/borg list /home/$USER/$REPO | w... |
Java | UTF-8 | 216 | 1.804688 | 2 | [] | no_license | package org.projectshop.pojo;
import java.util.Date;
public class MoviceType extends BasePojo {
private String type;
private Date createDate;
public String getType() {
return type;
}
} |
Swift | UTF-8 | 3,652 | 2.703125 | 3 | [] | no_license | //
// ViewController.swift
// YelpQuiz
//
// Created by Георгий Иванов on 25.05.17.
// Copyright © 2017 George Ivanov. All rights reserved.
//
import UIKit
import GoogleMaps
import CoreLocation
class ViewController: UIViewController, GMSMapViewDelegate {
var locationManager = CLLocationManager()
var... |
Swift | UTF-8 | 3,585 | 4.46875 | 4 | [] | no_license | import UIKit
/**
Object = Data + Method
Object = Structure, Class
Data = Property
Method = Method
Structure vs. Class
value Types Reference Types
Copy Share
Stack Heap
Fast Slow
RAM
--- Stack v... |
Java | UTF-8 | 2,657 | 2.28125 | 2 | [] | no_license | package swing;
import edu.wis.jtlv.env.Env;
import edu.wis.jtlv.env.module.SMVModule;
import edu.wis.jtlv.env.spec.Spec;
import edu.wis.jtlv.lib.AlgExceptionI;
import edu.wis.jtlv.lib.mc.LTL.LTLModelCheckAlg;
import edu.wis.jtlv.lib.mc.RTCTLK.TextRTCTLModelCheckAlg;
import java.io.IOException;
import java.util.ArrayL... |
PHP | UTF-8 | 8,976 | 2.5625 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | <?php
//
// Description
// ===========
// This method will return all the information about an market.
//
// Arguments
// ---------
// api_key:
// auth_token:
// tnid: The ID of the tenant the seller is attached to.
// market_id: The ID of the market to get the details for.
//
// Returns
// -------
//
functi... |
C# | UTF-8 | 701 | 2.609375 | 3 | [] | no_license | using RpgBE.Core.Model.Characters;
using RpgBE.Core.Model.Enums;
namespace RpgBE.Core.Model.Battles
{
public class BattleParticipant
{
public Character Character { get; private set; }
public Team Team { get; private set; }
public bool IsAlive
{
get { return Charact... |
Go | UTF-8 | 3,749 | 3 | 3 | [] | no_license | package pool
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestTwoDimByteSlice(t *testing.T) {
var bs TwoDimByteSlice
{
bs.Grow(512, 10, 10)
assert.Equal(t, 0 , bs.Dim())
assert.Equal(t, 0 , len(bs.data))
assert.Equal(t, 512, cap(bs.data))
a... |
Markdown | UTF-8 | 1,558 | 3.203125 | 3 | [] | no_license | ## ITMD 361, Production Problem 2: HTML Validation
For this production problem, you will learn to pull changes from a remote Git repository and then work with the HTML Validator. Follow the steps below exactly in order to receive full credit.
1. Make sure that you have added the instructor’s repository as a second re... |
C++ | UTF-8 | 3,035 | 2.875 | 3 | [] | no_license | //
// Compressor.cpp
// TextCompression
//
// Created by Viet Nguyen on 12/4/16.
// Copyright © 2016 Viet Nguyen. All rights reserved.
//
#include "Compressor.hpp"
#include <cmath>
Compressor::Compressor(string filename, string tofile, vector<wchar_t> symbols, vector<string> codes)
{
fileSourse = filename;
... |
Markdown | UTF-8 | 7,310 | 2.703125 | 3 | [
"CC-BY-4.0",
"MIT"
] | permissive | ---
title: 'Självstudie: lägga till noder i ett Azure FXT Edge-kluster'
description: Lär dig hur du lägger till klusternoder till lagrings-cachen i Azure FXT Edge och aktiverar funktionen för hög tillgänglighet (HA).
author: ekpgh
ms.author: rohogue
ms.service: fxt-edge-filer
ms.topic: tutorial
ms.date: 06/20/2019
ms.o... |
Python | UTF-8 | 406 | 3.59375 | 4 | [
"MIT"
] | permissive | from __future__ import print_function
kPa = float(input("Input your pressure in kiloPascals: "))
psi = kPa / 6.89476
mmhg = kPa * 7.50062
atm = kPa / 101.325
atm2 = kPa * 0.00986923
print("The pressure in pounds per square inch: %.2f psi" % psi)
print("The pressure in millimeter of mercury: %.2f mmHg" % mmhg)
print("... |
C++ | UTF-8 | 3,156 | 2.71875 | 3 | [
"NIST-Software"
] | permissive | //
// Created by tjb3 on 10/30/19.
//
#ifndef HEDGEHOG_TUTORIALS_UNIFIED_MATRIX_BLOCK_DATA_H
#define HEDGEHOG_TUTORIALS_UNIFIED_MATRIX_BLOCK_DATA_H
#include <hedgehog/hedgehog.h>
#include "matrix_block_data.h"
template<class Type, char Id>
class UnifiedMatrixBlockData : public MatrixBlockData<Type, Id, Order::Column>... |
PHP | UTF-8 | 1,456 | 2.609375 | 3 | [] | no_license | <?php
namespace Mintmesh\Services\Notification;
use Aws\Common\Aws;
use Aws\Sns\SnsClient as snsClient;
class NotificationManager {
// Initiate SNS object
private $obj = null;
private function getInstance() {
if (is_null($this->obj)) {
$this->obj = \AWS::get('sns');
}
... |
Python | UTF-8 | 1,551 | 3.6875 | 4 | [
"MIT"
] | permissive | """https://adventofcode.com/2020/day/15"""
import io
def part1(stdin: io.TextIOWrapper, stderr: io.TextIOWrapper) -> int:
"""
Given your starting numbers, what will be the 2020th number spoken?
"""
return nth(stdin, stderr, 2020)
def part2(stdin: io.TextIOWrapper, stderr: io.TextIOWrapper) -> int:... |
Markdown | UTF-8 | 299 | 2.59375 | 3 | [] | no_license | # Google Translate API:
A Simple Class to Use Google Translate Api
# Usage:
<code> GoogleTranslate::translate(LANG_SOURCE, LANG_TARGET, TEXT) </code>
# Example:
<code>
require('GoogleTranslate.Class.php');
$translation = GoogleTranslate::translate("auto", 'fa', 'Hello World!');
</code>
|
Python | UTF-8 | 230 | 4.15625 | 4 | [] | no_license | # 3. Write a program to get the sum and multiply of all the items in a given list.
b = [2, 4, 6, 8, 10]
print("Sum of all numbers in list b:", sum(b))
res = 1
for i in b:
res = res * i
print("multiplication of numbers:", res) |
Java | UTF-8 | 5,680 | 3.3125 | 3 | [] | no_license | package innotechum.task1.entity;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
public class Trash {
/*List<BigDecimal> temp = new ArrayList<BigDecimal>();
BigDecimal sal = new BigDecimal(0);
for (Department dep : depar... |
PHP | UTF-8 | 3,872 | 2.703125 | 3 | [] | no_license | <?php
namespace RKW\RkwConsultant\ViewHelpers;
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license i... |
SQL | UTF-8 | 4,098 | 3.265625 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 01-03-2015 a las 01:36:18
-- Versión del servidor: 5.6.17
-- Versión de PHP: 5.5.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARA... |
Java | UTF-8 | 569 | 2.703125 | 3 | [] | no_license | package com.example.hellospring.workshop01;
import org.junit.jupiter.api.Test;
import java.util.Random;
import static org.junit.jupiter.api.Assertions.*;
class Random7 implements IRandom {
@Override
public int nextInt(int bound) {
return 7;
}
}
class GenerateUUIDTest {
@Test
public vo... |
Python | UTF-8 | 2,427 | 3.203125 | 3 | [] | no_license | import random
import urllib
import sys
word_url="http://learncodethehardway.org/words.txt"
words=[]
phrases={
"class %%%(%%%)":"Make class named %%% that is a %%%",
"class %%%(object) :\n\tdef_init_(self,***)":"class %%% has a function _init_ that takes self and *** parameters.",
"class %%%(object):\n\t def_***(self... |
Java | UTF-8 | 1,752 | 2.984375 | 3 | [] | no_license | import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import static java.lang.Integer.parseInt;
import static java.util.Arrays.*;
public class ArgsParser1 {
private HashMap<String, Object> values;
private final HashMap<String, String> schemaMap;
public ArgsParser1(String schema) {
... |
TypeScript | UTF-8 | 789 | 2.6875 | 3 | [] | no_license | import * as Yup from "yup"
import { PHONE_MASK, ALPHA_MASK, PromotionCodes } from "helpers"
export const schema = Yup.object().shape({
firstname: Yup.string()
.min(2)
.max(32)
.matches(ALPHA_MASK)
.required(),
surname: Yup.string()
.min(2)
.max(32)
.matches(ALPHA_MASK)
.required(),
... |
JavaScript | UTF-8 | 5,371 | 2.859375 | 3 | [] | no_license | var colors = require('colors');
var _ = require('lodash');
var log = require('../../../backend/utilities/logger.js');
var database = require('../../../backend/utilities/database.js');
var AUTH_COOKIE = "544a4603c639328a1adc6723";
var EVENT_ID = database.getObjectID("544a8c615161f3314349f1ab");
var USER_ID = database.ge... |
C++ | GB18030 | 2,414 | 3.140625 | 3 | [] | no_license | #include "readCSVFile.h"
int GetTotalLineCount(FILE *fp)
{
int i = 0;
char strLine[MAX_LINE_SIZE];
fseek(fp, 0, SEEK_SET); //fpָָͷ
while (fgets(strLine, MAX_LINE_SIZE, fp)) //fgetsһLine
i++;
fseek(fp, 0, SEEK_SET);
return i;
}
int GetTotalColCount(FILE *fp)
{
int i = 0;
char strLine[MA... |
Java | UTF-8 | 1,838 | 3.8125 | 4 | [] | no_license | package DP;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class DP_1463_make_one {
/**
* X가 3으로 나누어 떨어지면, 3으로 나눈다.
* X가 2로 나누어 떨어지면, 2로 나눈다.
* 1을 뺀다.
* -> 연산의 최소 카운트 수
*
* 10 -> 9 -> 3 -> 1
*... |
Java | UTF-8 | 1,512 | 2.53125 | 3 | [] | no_license | package com.javaquarium.business;
import java.util.ArrayList;
import java.util.List;
import com.javaquarium.beans.data.UserDO;
import com.javaquarium.beans.web.UserVO;
import com.javaquarium.dao.IUserDAO;
import com.javaquarium.dao.UserDAO;
/**
* @author Alex Service pour la gestion des utilisateurs
*/... |
Python | UTF-8 | 10,350 | 2.875 | 3 | [] | no_license | import jesql_utils
import operator
import sys
import os
class Statement(object):
"""class docstring"""
def __init__(self, tokens):
self.tokens = tokens
self.result_column = None
self.subquery = None
self.join_clause = None
self.expression = None
self.evaluate_to... |
C++ | UTF-8 | 1,093 | 3.53125 | 4 | [] | no_license | #include <gtest/gtest.h>
/*
You are climbing a stair case and it takes A steps to reach to the top.
Each time you can either climb 1 or 2 steps.
In how many distinct ways can you climb to the top?
The first and the only argument contains an integer A, the number of steps.
Return an integer, representing the number o... |
C++ | UTF-8 | 2,332 | 2.75 | 3 | [] | no_license | math::rVector3d into_cell( math::rVector3d const &_vec,
math::rMatrix3d const &_cell,
math::rMatrix3d const &_inv)
{
math::rVector3d result( _inv * _vec );
result(0) -= std::floor(result(0)+types::roundoff);
result(1) -= std::floor(result(1)+types::roundoff)... |
PHP | UTF-8 | 11,068 | 2.890625 | 3 | [
"PHP-3.01"
] | permissive | <?php
include $_SERVER['DOCUMENT_ROOT']."/recipe_site/db/db.php";
// 서버에 있는 아이디를 $userid 변수에 삽입
if(!isset($_SESSION))
{
session_start();
}
$userid = $_SESSION['mem_id'];
$sql = mq("select * from member where mem_id='".$userid."'");
// $sql에 있는 fetch_array(): 인덱스를 변수에 삽입
$member = $sql->fetch_array()... |
TypeScript | UTF-8 | 2,312 | 2.765625 | 3 | [
"Apache-2.0"
] | permissive | import anyTest, { TestInterface } from 'ava';
import { rafPolyfill, cafPolyfill } from '../../worker-thread/AnimationFrame';
const test = anyTest as TestInterface<{
runTimeout: Function;
runAllTimeouts: Function;
}>;
const originalSetTimeout = globalThis.setTimeout;
test.beforeEach((t) => {
const timeouts: Arra... |
PHP | UTF-8 | 1,315 | 2.640625 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: su
* Date: 2017/12/29
* Time: 18:21
*/
namespace trhui\data;
use trhui\TpamException;
/**
* 会员自助登录
* 后台接口
* 商户会员登录
* TODO 请求地址:/club/service/interface/memberLogin
* Class MemberLogin
* @package trhui\data
*/
class MemberLogin extends DataBase
... |
Java | UTF-8 | 6,623 | 2.671875 | 3 | [] | no_license | package modifyDlg;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.FlowLayout;
import javax.swing.JButton;
import javax.swing.JColorChooser;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import geometry.Point;
import javax.swing.GroupLayout;
impor... |
Java | UTF-8 | 1,298 | 3.03125 | 3 | [] | no_license | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;
public class hwalgo0828_서울_8반_천창민_fail_2 {
public static void main(String[] args) throws Exception {
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
Strin... |
Java | UTF-8 | 922 | 1.9375 | 2 | [] | no_license | package cn.opt.service;
import java.util.List;
import com.github.pagehelper.PageInfo;
import cn.opt.po.Student;
public interface StudentService {
/**
* 查询所有学生
*/
public PageInfo<Student> getAllStu(Integer currentPage, Integer pageSize);
/**
* easyui
*/
public List<Student> getAllStu1(Int... |
Java | UTF-8 | 9,369 | 1.648438 | 2 | [] | no_license | package com.app.farmerswikki.model.state_wise_info.view.fragment;
import android.content.Context;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.Nullable;
import android.support.design.widget.AppBarLayout;
import android.support.design.widget.Floatin... |
Python | UTF-8 | 164 | 2.796875 | 3 | [] | no_license | #/usr/bin/python3
# coding:utf-8
def normalize(name):
return name.capitalize()
L1 = ['baidu', 'tencent', 'alibaba']
L2 = list(map(normalize, L1))
print (L2)
|
C++ | UTF-8 | 1,351 | 2.609375 | 3 | [
"MIT"
] | permissive | #pragma once
#include "common/binary_search_tree/ext/base/remove_right__default.h"
#include <stack>
namespace bst {
namespace ext {
namespace base {
template <class TNode, class TKey>
inline TNode* RemoveByKeySkipUpdate(TNode* root, const TKey& key,
TNode*& removed_node,
... |
Java | UTF-8 | 212 | 1.882813 | 2 | [] | no_license | package com.pro.DAO;
import com.pro.model.Order;
import java.util.List;
public interface OrderDAO
{
public boolean saveOrder(Order order);
public boolean updateCart(String username, int orderId);
} |
JavaScript | UTF-8 | 1,629 | 2.890625 | 3 | [
"MIT"
] | permissive | const fs = require('fs');
//object destrucure
// writing files
const writeFile = fileContent => {
const {
projectName,
description,
installInstructions,
usage,
license,
contact,
otherLanguages,
primary,
contributors,
test,
github
} = fileContent
const readMeGenerated = `
# ${projectName}
![... |
Markdown | UTF-8 | 1,770 | 3.203125 | 3 | [] | no_license | # Innodb和Memory引擎
#### Memory引擎
* InnoDB 引擎把数据放在主键索引上,其他索引上保存的是主键 id。这种方式,我们称之为索引组织表(Index Organizied Table)。
* 而 Memory 引擎采用的是把数据单独存放,索引上保存数据位置的数据组织形式,我们称之为堆组织表(Heap Organizied Table)。
#### 引擎的区别
* InnoDB 表的数据总是有序存放的,而内存表的数据就是按照写入顺序存放的;
* 当数据文件有空洞的时候,InnoDB 表在插入新数据的时候,为了保证数据有序性,只能在固定的位置写入新值,而内存表找到空位就可以插入新值;
* 数据位置发生变... |
C++ | GB18030 | 1,837 | 2.796875 | 3 | [] | no_license | #include "CBullet.h"
//ӵ
void CBullet::ClearBullet(CBullet bullet/*, CMap pMap*/)
{
int y = bullet.y;
int x = bullet.x;
WriteChar(x, y, " ", 7, 1);
}
//ӵ
void CBullet::DrawBullet(CBullet bullet, CMap* pMap)
{
if (bullet.isValid == 1)
{
if ( pMap->GameMap[g_level][x][y]== WALL3 && bullet... |
PHP | UTF-8 | 551 | 2.671875 | 3 | [] | no_license | <?php
session_start();
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Form</title>
</head>
<body>
<form action="process.php" method="post">
<input type="text" name="email" placeholder="email">
<input type="password" name="password" placeholder="password">
<inpu... |
C++ | UTF-8 | 658 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | #include "loss_function_factory.h"
#include "least_square_loss_function.h"
#include "logistic_loss_function.h"
#include <common_utils.h>
using namespace lncc;
using namespace std;
LossFunction* LossFunctionFactory::CreateLossFunction(const std::string& loss_func) {
LossFunction* obj = NULL;
if (loss_func == "... |
JavaScript | UTF-8 | 1,171 | 3.71875 | 4 | [] | no_license | const expenses = [
{id: 1, desc: "bought potato", amount: 100},
{id: 2, desc: "bought coleslaw", amount: 250},
{id: 3, desc: "bought wheat grass", amount: 150},
];
const newExpenses= [
{id: 4, desc: "bought plastics", amount: 500},
{id: 5, desc: "bought flours", amount: 500}
]
//spread operator to... |
TypeScript | UTF-8 | 2,585 | 2.53125 | 3 | [] | no_license | // Routes to interact with login.
import express from "express";
import { pool } from "../dao/database";
import userDao, { sanitizeUser } from "../dao/userDao";
import { compareHash, hash } from "../hashing";
var jwt = require("jsonwebtoken");
var bodyParser = require("body-parser");
const router = express.Router()... |
Java | UTF-8 | 701 | 1.882813 | 2 | [] | no_license | package com.rorasoft.roragame.Services.preferences;
import android.content.Context;
import android.content.res.TypedArray;
import android.preference.CheckBoxPreference;
import android.util.AttributeSet;
public class SmallIconCheckboxPreference extends CheckBoxPreference {
public SmallIconCheckboxPreference(Contex... |
JavaScript | UTF-8 | 3,866 | 2.8125 | 3 | [] | no_license | require('dotenv').config()
const { expect } = require('chai')
const searchAd = require('.')
const { database, models: {User, Advertisement, Merchant } } = require('generisad-data')
const { random } = Math
const { env: { DB_URL_TEST }} = process
describe('logic - search ads', () => {
before(() => database.connect... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.