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 | 1,755 | 2.78125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Airline.Models;
namespace Airline.Tests
{
[TestClass]
public class FlightTests : IDisposable
{
public FlightTests()
{
DBConfiguration.ConnectionString = "server=localhost;user id=root;password... |
Java | UTF-8 | 475 | 1.929688 | 2 | [
"Apache-2.0"
] | permissive | /* The Adama Programming Language For Board Games!
* See http://www.adama-lang.org/ for more information.
* (c) copyright 2020 Jeffrey M. Barber (http://jeffrey.io) */
package org.adamalang.runtime.logger;
import org.junit.Test;
public class TransactionTests {
@Test
public void flow() {
new Transaction(-... |
Python | UTF-8 | 1,744 | 3.0625 | 3 | [] | no_license | import csv
# lists to load with data
expPlayers = []
nonPlayers = []
dragons = []
sharks = []
raptors = []
if __name__ == "__main__":
with open('soccer_players.csv', newline='') as csvfile:
rdr = csv.reader(csvfile, delimiter=',')
rows = list(rdr)[1:]
for row in rows:
#if player is experienced
if row[... |
Go | UTF-8 | 521 | 3.34375 | 3 | [
"MIT"
] | permissive | package vm
import (
"fmt"
"reflect"
)
type OpCode struct {
Code int
Movement int
Data interface{}
}
func (o OpCode) Similar(p OpCode) bool {
return o.Code == p.Code && o.Movement == p.Movement && reflect.TypeOf(o.Data) == reflect.TypeOf(p.Data)
}
func (o OpCode) Identical(p OpCode) bool {
return reflect.... |
C | UTF-8 | 10,570 | 3.828125 | 4 | [] | no_license | #include <stdlib.h>
#include "tp3.h"
int get_int_len(int value)
{
int length=1;
while(value>9){ length++; value/=10; }
return length;
}
element * newelement(element * suivant, int col,int valeur)
{
element *pointeur;
pointeur=malloc(sizeof(element));
... |
Python | UTF-8 | 221 | 3.65625 | 4 | [] | no_license | x=int(input("Podaj rok z przedziału 1900 - 2099: "))
a=x%19
b=x%4
c=x%7
d=(a*19+24)%30
e=(2*b+4*c+6*d+5)%7
if d+e<10:
print("Wielkanoc jest", d+e+22, "marca")
else:
print("Wielkanoc jest", d+e-9, "kwietnia")
|
Python | UTF-8 | 912 | 2.8125 | 3 | [
"Apache-2.0"
] | permissive |
class Feature(object):
def __init__(self, feature_id, features, aux):
self.feature_id = feature_id
self.features = features
self.aux = aux
def reprJSON(self):
return {
"feature_id": dict(self.feature_id._asdict()),
"features": self.features,
... |
Markdown | UTF-8 | 173 | 2.640625 | 3 | [] | no_license | # Advent of Code: 2020
My solutions to the [Advent of Code](https://adventofcode.com/2020).
They won't be super-optimised or anything; I just had fun solving the problems! |
Java | UTF-8 | 2,150 | 3.359375 | 3 | [] | no_license | package client;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.InetAddress;
import java.net.Socket;
import java.util.Scanner;
import ItemProduct.ItemProduct;
public class ClientApp {
public static void main(String[] args) throws Cla... |
Java | UTF-8 | 1,337 | 2.171875 | 2 | [] | no_license | 2
https://raw.githubusercontent.com/gardle/gardle-web/master/src/main/java/com/gardle/domain/AbstractDeletableAuditingEntity.java
package com.gardle.domain;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.search.annotations.Analyze;
import org.hibern... |
Java | UTF-8 | 5,547 | 2.03125 | 2 | [] | no_license | package com.tencent.filechecker.logic;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import com.tencent.filechecker.entity.DetectConfig;
import java.util.ArrayList;
import java.util.List;
/**
* Created by haoozhou on 2016/5/16.
*/
public class FileDetectManager {
private sta... |
Java | UTF-8 | 3,596 | 2.28125 | 2 | [] | no_license | package BookController;
import java.awt.Image;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.servlet.ServletException;
import javax.servlet.annotation.MultipartConfig;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.s... |
Ruby | UTF-8 | 1,034 | 2.796875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | # class MyValidator < ActiveModel::Validator
# #if a song with the same title and same year exists --> error message
# #if released = true and released_year == nil --> error message
# #if release_year > current_year --> error message
# #otherwise, error message << false
# def validate(record)
# ... |
Java | UTF-8 | 384 | 2.03125 | 2 | [] | no_license | package com.ly.art.advice;
import org.springframework.util.StringUtils;
import java.beans.PropertyEditorSupport;
public class EmptyStrConverter extends PropertyEditorSupport {
@Override
public void setAsText(String text) throws IllegalArgumentException {
if (!StringUtils.hasText(text))
s... |
C# | UTF-8 | 1,739 | 2.5625 | 3 | [] | no_license | using System;
using System.Configuration;
using System.Net;
using System.Net.Mail;
namespace Negocio.Managers.Shared
{
public class EnvioEmailManager
{
private const string sender = "transporteflexible@gmail.com";
private const string senderPassword = "fleXI!123";
private readonly Smtp... |
C++ | GB18030 | 1,908 | 2.96875 | 3 | [] | no_license | #include "MyIniBase.h"
#include <fstream>
#include <iostream>
std::tuple<bool, std::string> CIniBase::GetJsonStr(const std::string & strPath)
{
//ǸܴĶд洢ıļô
char buf[1024]; //ʱȡļ
//std::string str;
std::ifstream infile;
infile.open(strPath.c_str());
if (infile.is_open())... |
Python | UTF-8 | 3,125 | 2.953125 | 3 | [] | no_license | """suggestion_dialog.py."""
from src.dialog import Dialog
from src.picker import Picker
from src.card import Card
from src.cardtype import CardType
from src.suggestion import Suggestion
import pygame
import os
import json
class SuggestionDialog(Dialog):
def __init__(self, x, y):
super(SuggestionDialog, se... |
C++ | WINDOWS-1250 | 1,723 | 3.53125 | 4 | [] | no_license | /*
Given a string S and a string T, count the number of distinct subsequences of T in S.
A subsequence of a string is a new string which is formed from the original string by deleting some (can be none) of
the characters without disturbing the relative positions of the remaining characters.
(ie, ACE is a subsequ... |
C# | UTF-8 | 1,002 | 2.921875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace PSRT.Astra
{
public static class ConcurrencyUtils
{
public static Task RunOnDedicatedThreadAsync(Action action, string threadName = null)
{
... |
Markdown | UTF-8 | 2,318 | 3.125 | 3 | [] | no_license | # ContactsRealmWebApp
Application to demonstrate how to use Realm Sync with a Web App to do basic operations (CRUD)
# Live Example
This is the live example of the Web application running
[](https://i.imgur.com/TSMRjOI.gif)
# Description
This application will list a ta... |
Java | UTF-8 | 1,889 | 3.734375 | 4 | [
"MIT"
] | permissive | package basic.sort;
import java.util.Arrays;
/**
* 源数组,假设有n个数
* |_______|_______| 划分成n/2
* |___|___|___|___| 划分成n/4
* |_|_|_|_|_|_|_|_| 划分成n/8
* 直到划分成1个数
* 递归层数最多有log n
* 处理每一层都是O(N)
* 所以时间复杂度是O(N log n)
* 空间复杂度是O(N)
* 需要辅助数组
* 开始l,r指向两个区间的区间首
* 区间首元素较小者放进辅助数组,维护双指针之一
* 重复如上操作
* 直到有一个区间没有数了,直接把另一个还有... |
JavaScript | UTF-8 | 1,323 | 2.765625 | 3 | [] | no_license |
import * as ACTIONS from '../actions/actionTypes';
const initState = {
profileImageError: null,
profileImageSent: null,
profileInfoError: null,
profileInfoSent: null
}
const profileReducer = (state = initState, action) => {
if(action.type === ACTIONS.UPDATE_PROIMG_SUCCESS) {
console.log('Image uploade... |
Java | UTF-8 | 287 | 2.28125 | 2 | [] | no_license | package com.swad.cppatm.exceptions;
public class AccountDoesNotExist extends Exception {
// Parameterless Constructor
public AccountDoesNotExist() {}
// Constructor that accepts a message
public AccountDoesNotExist(String message)
{
super(message);
}
}
|
JavaScript | UTF-8 | 365 | 3.09375 | 3 | [] | no_license | let post = {
name: "Kamala Harris",
title: "Vice President",
likes:85000000,
message: "First Female, Black, Asian American Vice President of the United States of America",
AddLike:function(){
this.likes+=1;
}
}
post.message = "Congratulations!"
console.log(post.name)
console.lo... |
C++ | UTF-8 | 1,897 | 2.890625 | 3 | [] | no_license | #ifndef __TC_CALLBACK_DETAIL_H__
#define __TC_CALLBACK_DETAIL_H__
#include "tc_scoped_ptr.h"
namespace taf
{
namespace detail
{
class TC_BindStateBase {
public:
virtual ~TC_BindStateBase() { }
};
// This is a typetraits object that's used to take an argument type, ... |
TypeScript | UTF-8 | 8,695 | 3 | 3 | [
"MIT"
] | permissive | import type { TransitionType } from '../../transition';
declare type Value = {
name?: any;
value?: string;
selected?: boolean;
};
export interface DropdownSettings {
/** When specified allows you to initialize dropdown with specific values. See usage guide for details. */
values?: Value[];
/** E... |
Markdown | UTF-8 | 3,324 | 2.765625 | 3 | [
"MIT"
] | permissive | ---
layout: page
title: "现实"
subtitle: "现实总有人给你上一课"
date: 2016-05-20 21:21:21 +0530
categories: 随笔
---
现实告诉你,没钱连你最亲的人都会瞧不起你。
不要以为你放不下的人同样也会放不下你。
鱼没有了水会死,水没有了鱼却会更清澈。
生活告诉你,有什么别有病。
感情告诉你,不要以为你想的人同样也会想你。
别人睡觉的时候要懂得安静。
不要没经过同意就随便看别人手机,别人拿手机给你看照片的时候,你好好看着就行,不要手贱划下一张。
不要试着用自己的秘密去交换一个朋友,别把秘密告诉风,风会吹过整片森林。
所谓的人生就是听不... |
Markdown | UTF-8 | 1,137 | 2.765625 | 3 | [] | no_license | ## 09b_glfw
## Synopsis
09b_glfw is an application to demonstrate use of GLFW and OpenGL.
It opens a window and animates a number of rotating pyramids.
## Motivation
This project was written from the ground up to understand the
operation of GLFW 3 and OpenGL 2, and to design an object-oriented
methodology for OpenG... |
Java | UTF-8 | 2,390 | 2.921875 | 3 | [] | no_license | package hr.fer.zemris.java.fractals;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import hr.fer.zemris.java.fractals.viewer.IFractalPro... |
Java | UTF-8 | 1,126 | 2.453125 | 2 | [] | no_license | package avaliacao3bimestre;
import java.util.ArrayList;
public abstract class Candidato {
protected String nome;
protected String email;
protected String dataNascimento;
protected String codigo;
public Candidato() {
}
public Candidato(String nome, String email, String data... |
Java | UTF-8 | 691 | 1.726563 | 2 | [] | no_license | package ro.cosu.vampires.client.executors.fork;
import com.google.inject.Inject;
import org.hyperic.sigar.Sigar;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import ro.cosu.vampires.client.executors.ExecutorMetricsCollector;
import ro.cosu.vampires.server.workload.Metrics;
public class ForkExecutorMetrics... |
C# | UTF-8 | 7,724 | 2.578125 | 3 | [] | no_license | using System;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Eventos
{
public partial class AgregarEmpleado : Form
{
... |
Python | UTF-8 | 3,242 | 2.5625 | 3 | [] | no_license | from itertools import combinations, chain
import shutil
from django.conf import settings
from django.core.management.base import BaseCommand
from os.path import join, isfile, exists
from random import randint
from stonedb.models import Texture, Color, Classification, Country, Stone
"""
Find one stone picture for eac... |
C# | UTF-8 | 1,345 | 2.71875 | 3 | [
"MIT",
"LicenseRef-scancode-other-permissive"
] | permissive | using System.Collections.Generic;
namespace Smellyriver.TankInspector.Pro.Data.Entities
{
public sealed class TankClassComparer : IComparer<string>, IComparer<TankClass>
{
private static readonly Dictionary<string, int> s_classKeySortIndices
= new Dictionary<string, int>
{
... |
Java | UTF-8 | 522 | 2.28125 | 2 | [] | no_license | package kg.online.book.store.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name = "delivery_method")
public c... |
Python | UTF-8 | 1,314 | 3.203125 | 3 | [] | no_license | from math import gamma
import math
import matplotlib.pyplot as plt
from modules.pairwisecoverage import area
# Function that computes the expected distance to the nth furthest point sampled unifomly over cirle of radius R
def expectiation(n,N,R):
return R*(gamma(n + 1/2)/gamma(n))/(gamma(N+1+1/2)/gamma(N+1))
def ... |
PHP | UTF-8 | 3,968 | 2.640625 | 3 | [] | no_license | <?php
require __DIR__ . '/__cred.php';
require __DIR__. '/__connect_db.php';
header('Content-Type: application/json');
$result = [
'success' => false,
'errorCode' => 0,
'errorMsg' => '資料輸入不完整',
'post' => [], // 做 echo 檢查
];
$mNo = isset($_POST['mNo']) ? intval($_POST['mNo']) : 0;
if(isset($_POST['mN... |
Java | UTF-8 | 343 | 2.53125 | 3 | [
"MIT"
] | permissive | package algo.tzashinorpu.SecondRound.Chapter12;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
class maxProfit_309Test {
@Test
void maxProfit() {
maxProfit_309 ins = new maxProfit_309();
int[] prices = {1, 2, 3, 0, 2};
System.out.println(ins.maxP... |
Java | UTF-8 | 1,903 | 2.640625 | 3 | [
"MIT"
] | permissive | package md.shape;
import heli.htweener.Ease;
import heli.htweener.HT;
import heli.htweener.tween.ICallable;
import javafx.scene.paint.Color;
public class MDProgressText extends MDButton {
private boolean isRun = false;
private ICallable onRunStop;
public MDProgressText(String text, Color minColor, Color ... |
Java | UTF-8 | 5,727 | 2.15625 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... |
C# | UTF-8 | 996 | 2.71875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PSLAManager
{
class Fact : Table
{
public Fact(String tabName, List<Attribute> tabAttr, List<String> tabListOfSel, Attribute tabPrimaryKey, int tabSize)
: base(tabN... |
TypeScript | UTF-8 | 1,244 | 2.78125 | 3 | [
"Apache-2.0"
] | permissive | import { Argv } from "yargs";
import { MspCommandHandler } from "../../../commandHandlers/msp";
interface Arguments {
organization: string;
admin: string;
root: string;
tlsroot: string;
}
export const command = "fromFiles";
export const desc = "Imports organization certificates from files.";
export co... |
Python | UTF-8 | 168 | 3.046875 | 3 | [] | no_license | #!/usr/bin/env python
l=set(x*(3*x-1)/2 for x in xrange(1,2500))
for i in l:
for j in l:
if i>j and i+j in l and abs(i-j) in l:
print abs(i-j)
|
Python | UTF-8 | 552 | 3.328125 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""Exercise 3.
Split the dataset based on the given ratio.
"""
import numpy as np
def split_data(x, y, ratio, seed=1):
np.random.seed(seed)
shuffle_indices = np.random.permutation(np.arange(len(y)))
shuffled_y = y[shuffle_indices]
shuffled_x = x[shuffle_indices]
... |
Markdown | UTF-8 | 1,632 | 2.828125 | 3 | [] | no_license | ## Installation guide for Vue.js frontend
If you're using Vue.js single page application (SPA), you can add our script using below method:
```
<template>
<div>
<button class="open-hashcharger">Click me</button>
</div>
</template>
<script>
export default {
mounted: function() {
const script = document... |
Python | UTF-8 | 996 | 2.953125 | 3 | [
"BSD-2-Clause"
] | permissive | import numpy as np
def measure_angle(i, seq, outcome_array, input_angle, computation_angle):
"""Angle to measrue qubit i
:i: qubit to measure
:outcome_array: list of qubit outcomes
:input_angle: random angle in radians that was generated for measuring
:computation_angle: actual computation angle ... |
Java | UTF-8 | 5,152 | 3.71875 | 4 | [
"Apache-2.0"
] | permissive |
package com.djs.learn;
import java.util.Arrays;
// https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array/description/
public class FindFirstAndLastPositionOfElementInSortedArray
{
public int[] internal_searchRange_1(int[] nums, int startPos, int endPos, int target){
int[] index = {... |
SQL | UTF-8 | 578 | 3.734375 | 4 | [
"CC-BY-2.5",
"CC-BY-2.5-AU",
"CC0-1.0"
] | permissive | -- This script will produce a mapping of which Postal Areas overlap with with
-- State Suburbs and vice versa.
-- To the extent possible under law, the person who associated CC0
-- with this work has waived all copyright and related or neighboring
-- rights to this work.
-- http://creativecommons.org/publicdomain/zero... |
TypeScript | UTF-8 | 853 | 3.625 | 4 | [] | no_license | export interface FailureConditions<U> {
testError?: (a: any) => boolean;
testResult?: (a: U) => boolean;
}
/**
* Provides checking capability for failure through two
* user-provided failureConditions which are simple predicates
* on U
*/
export class FailTester<U> {
constructor(private failureCondition... |
TypeScript | UTF-8 | 1,088 | 4.0625 | 4 | [] | no_license | // What digit is at the given place value in num?
const getDigitFrom3 = (num: number, place: number) => {
const numbers = num.toString().split('');
return numbers[place - 1];
};
// console.log(getDigitFrom(12345, 1));
// console.log(getDigitFrom(12345, 2));
// console.log(getDigitFrom(12345, 3));
// console.log(ge... |
Java | UTF-8 | 1,610 | 2.015625 | 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.sp.managedBean;
import com.sp.entity.Operationtype;
import com.sp.repository.OperationTypeRepository;
import java... |
JavaScript | UTF-8 | 1,872 | 2.703125 | 3 | [] | no_license | "use strict"
const cart = {
template: `
<p class="title">Cart Mate</p>
<form class="add2cart" ng-submit="$ctrl.addItem(newItem)">
<input ng-model="newItem.product" placeholder="Product Name" type="text"></input>
<input ng-model="newItem.price" placeholder="Price" type="number"></input>
... |
Python | UTF-8 | 1,020 | 3.515625 | 4 | [
"Apache-2.0"
] | permissive | import re
from Crypto.Hash import keccak
def is_checksum_address(address):
address = address.replace('0x', '')
address_hash = keccak.new(digest_bits=256)
address_hash = address_hash.update(address.lower().encode('utf-8')).hexdigest()
for i in range(0, 40):
# The nth letter should be uppercase... |
C# | UTF-8 | 3,693 | 2.828125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace MatLeverans
{
public partial class Form1 : Form
{
private ICustomer register;
... |
Java | WINDOWS-1252 | 350 | 3 | 3 | [] | no_license | package desafioModulo;
import java.util.Scanner;
public class Exercicio2 {
public static void main(String[] args) {
Scanner entrada = new Scanner(System.in);
System.out.println("Em que ano estamos?");
int ano = entrada.nextInt();
if(ano %4 ==0) {
System.out.println(" ano bissexto");
}
entrada.close();
Sys... |
Markdown | UTF-8 | 30,699 | 2.71875 | 3 | [] | no_license | ## 第六 梵天相应
### 第一 梵天品
#### 第一 劝请
如是我闻。尔时,世尊住优留毗罗尼连禅河边之阿阇波罗尼俱律陀树下。时,已成等正觉。
时,世尊独坐禅思,而起此思惟。
依我所证得此法,甚深难见、难悟。寂静微妙,超越思念之领域。深妙唯贤者始知。又,此诸人等乐阿赖耶 ,喜阿赖耶,跳跃阿赖耶。诸人依于乐阿赖耶,喜阿赖耶,跳跃阿赖耶,而难见此理。此理者,即所谓依缘、缘起是。此理亦难见。此理者,即一切行之止静,一切依之舍离、爱尽、离、灭、涅盘是。我若说法,诸人难了解我所说者,我是应所疲劳而烦扰。
又,此以前未曾有闻之偈,世尊显示:
艰难我所证 &n... |
Java | UTF-8 | 1,568 | 2.28125 | 2 | [] | no_license | package com.example.newsapi;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.content.Context;
import android.os.Bundle;
import android.widget.TextView;
import retrofit2.Call;
import retrofit2.Ca... |
Python | UTF-8 | 2,114 | 3.21875 | 3 | [] | no_license | """
This module perform the functionality of creating the Login forms and Sign up forms.
It makes use of the functionality of built in wtforms modules adopted for the
Flask applications.
"""
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, SubmitField,BooleanField
from wtforms.validato... |
Python | UTF-8 | 321 | 4.21875 | 4 | [] | no_license | '''写代码实现一个整数加法计算器(两个数相加)。需求:提示用户输入:5+9或5+9或5+9,计算出两个值的和(提示:先分割再转换为整型,再相加)'''
enter = input("输入n+n格式的内容").strip()
data = enter.split("+")
sum = int(data[0]) + int(data[1])
print(sum)
|
C# | UTF-8 | 438 | 2.59375 | 3 | [] | no_license | using UnityEngine;
using System.Collections;
using System.Collections.Generic;
/*
Attach to an object with an animator so you can call function to play particles from the animation.
Probably mostly useful for particle systems that play a burst of particles rather than a stream.
*/
public class PlayParticlesFromAnima... |
Python | UTF-8 | 1,130 | 3.5 | 4 | [
"MIT"
] | permissive | # Solution of;
# Project Euler Problem 162: Hexadecimal numbers
# https://projecteuler.net/problem=162
#
# In the hexadecimal number system numbers are represented using 16 different
# digits:0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,FThe hexadecimal number AF when written
# in the decimal number system equals 10x16+15=175. In ... |
Java | ISO-8859-2 | 346 | 1.882813 | 2 | [] | no_license | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package TankGame;
import GUI_Pack.GUI;
/**
* TankTrouble++
* @author Hegyi Smuel, Horvth Gyz, Szab Dniel
*/
public class Main {
public static void main(String[] args) {
StateMachine SM = new StateMachine();
GU... |
Markdown | UTF-8 | 5,377 | 2.8125 | 3 | [] | no_license | - We walk by faith, not by sight.
- For to me, to live is Christ and to die is gain.
- If God is for us, who can be against us?
- It’s not how good you are. It’s how bad you want it.
- I press on toward the goal to win the prize for which God has called me heavenward in Christ Jesus.
- Whatever you do, work at it... |
Python | UTF-8 | 5,007 | 2.84375 | 3 | [] | no_license | import arcade
import arcade.gui
import menuHandler
import button
import game as gm
EASY = 0
MODERATE = 1
HARD = 2
class Menu():
def __init__(self):
self.buttons = list()
self.texts = arcade.SpriteList()
self.accents = arcade.SpriteList()
def add_button(self, text, x, y, on_click):
... |
Markdown | UTF-8 | 4,143 | 3.578125 | 4 | [] | no_license | # 初识React中的High Order Component
我们都知道,如果使用ES6 Component语法写React组件的话,mixin是不支持的。而mixin作为一种抽象和共用代码的方案,许多库(比如react-router)都依赖这一功能,自己的项目中可能都或多或少有用到mixin来尽量少写重复代码。
如果希望使用ES6 Component,有希望可以用一个像mixin一样的方案的话,可以使用react-mixin这样的库,就有种hack的感觉。这里介绍一个新的方案:High Order Component。
## 一、什么是High Order Component
High Order Component,下... |
SQL | UTF-8 | 534 | 2.96875 | 3 | [] | no_license | CREATE TABLE product (
product_id INT NOT NULL AUTO_INCREMENT,
product_name VARCHAR(50),
product_description VARCHAR(255),
PRIMARY KEY ( product_id )
);
CREATE TABLE user_detail (
id INT NOT NULL AUTO_INCREMENT,
username VARCHAR(50),
role VARCHAR(50),
password VARCHAR(60),
PRIMARY KEY (id )
);
... |
JavaScript | UTF-8 | 403 | 2.578125 | 3 | [] | no_license | const initState = {
allProduct: [],
searchedProducts: [],
}
const productReducers = (state = initState, action) => {
switch (action.type) {
case "FETCH_SEARCHED_PRODUCT":
return {
...state,
searchedProducts: action.payload.searchedProducts,
}
d... |
C | UTF-8 | 262 | 3.953125 | 4 | [] | no_license | #include <stdio.h>
void cuadrado(float x);
int main()
{
float x;
printf("Introduce un número para elevar al cuadrado:");
scanf("%f", &x);
cuadrado(x);
return 0;
}
void cuadrado(float x)
{
float x2;
x2=x*x;
printf("El cuadrado de %f es %f\n", x, x2);
}
|
C++ | UTF-8 | 2,818 | 2.828125 | 3 | [] | no_license | // command.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
// Behavior design pattern
#include <iostream>
#include <string>
#include <thread>
#include <chrono>
using namespace std;
class ActionEvent
{
};
class ButtonPressed : public ActionEvent
{
};
... |
Python | UTF-8 | 3,713 | 3.546875 | 4 | [] | no_license | ##Run The Program Through The Interface File
from tkinter import *
#Displays the users most played song, and its total plays
class Song_Stat_Window():
def __init__(self, stats, song, plays, artist):
self.master = stats
self.song = song
self.plays = plays
self.artist = artis... |
PHP | UTF-8 | 504 | 2.828125 | 3 | [
"MIT"
] | permissive | <?php
/**
* Created by PhpStorm.
* User: dgreenberg
* Date: 4/6/16
* Time: 9:37 AM
*/
namespace Code_Alchemy\DateTime;
use Code_Alchemy\Core\Boolean_Value;
/**
* Class Is_Date_Past
* @package Code_Alchemy\DateTime
*
* Is this date in the past?
*/
class Is_Date_Past extends Boolean_Value{
/**
* I... |
TypeScript | UTF-8 | 3,710 | 2.59375 | 3 | [] | no_license | import * as sqlite3 from "sqlite3";
import * as moment from "moment";
import { Conf } from "./conf";
//sqlite3.verbose();
export class Pagesdb {
private static tabname = "pages";
private static filename = "pages.db";
private static db;
static init() {
return new Promise(resolve => {
... |
Java | UTF-8 | 166 | 1.867188 | 2 | [] | no_license | package ae.co.comtrust.payment.IPG.SPIj;
public class TransactionException
extends Exception
{
public TransactionException(String msg)
{
super(msg);
}
}
|
Python | UTF-8 | 357 | 3.3125 | 3 | [] | no_license | #!/usr/bin/env python3
import pandas as pd
def subsetting_by_positions():
df = pd.read_csv("UK-top40-1964-1-2.tsv", sep='\t',
usecols=["Title", "Artist"])
return df.iloc[0:10]
def main():
top_10 = subsetting_by_positions()
print(top_10)
print(f"Shape = {top_10.shape}")
i... |
Ruby | UTF-8 | 237 | 2.734375 | 3 | [] | no_license | h,w,k = gets.chomp.split.map(&:to_i)
chos = h.times.map{gets.chomp.split.map(&:to_i)}
(2 ** (h-1)).times do |n|
sum = 0
idx = Array.new(h, 0)
(h-1).times do |j|
sum += n[j]
idx[j+1] = idx[j] + n[j]
end
p sum
p idx
end |
Python | UTF-8 | 5,125 | 2.625 | 3 | [] | no_license | import datetime
from typing import List
from flask import Flask, jsonify, request, abort
from recommender.RecommenderClient import RecommenderClient
from data_import.AmadeusClient import AmadeusClient
from planner.PlannerClient import GoogleMapsClient
import pickle
import settings
import sys
import json
import logging... |
Java | UTF-8 | 3,366 | 2.25 | 2 | [] | no_license | package com.familyedu.student;
import android.content.Intent;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import co... |
Python | UTF-8 | 2,388 | 2.921875 | 3 | [
"MIT",
"LicenseRef-scancode-w3c-03-bsd-license",
"BSD-3-Clause",
"GPL-1.0-or-later",
"LGPL-2.0-or-later",
"Apache-2.0"
] | permissive | # -*- coding: utf-8 -*-
from __future__ import generators
import py
import sys
saferepr = py.io.saferepr
class TestSafeRepr:
def test_simple_repr(self):
assert saferepr(1) == '1'
assert saferepr(None) == 'None'
def test_maxsize(self):
s = saferepr('x'*50, maxsize=25)
assert l... |
Java | UTF-8 | 1,748 | 2.390625 | 2 | [] | no_license |
package domain;
import java.util.Date;
import javax.persistence.Access;
import javax.persistence.AccessType;
import javax.persistence.Entity;
import javax.persistence.OneToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.Valid;
import javax.validation.constraints... |
Markdown | UTF-8 | 4,121 | 2.671875 | 3 | [] | no_license | ---
description: "Step-by-Step Guide to Make Perfect Boneless Root Beer Pork Ribs"
title: "Step-by-Step Guide to Make Perfect Boneless Root Beer Pork Ribs"
slug: 1535-step-by-step-guide-to-make-perfect-boneless-root-beer-pork-ribs
date: 2020-09-14T15:34:32.937Z
image: https://img-global.cpcdn.com/recipes/59686771071385... |
Markdown | UTF-8 | 2,626 | 2.828125 | 3 | [] | no_license | ---
title: Excel2013:[46]如何绘制半圆饼图
date: 2015-01-23 18:03:03
tags: [excel]
author: mlln.cn
---
很多时候需要美化你的图表这样才能让人感觉你是一个有创意的员工,是一个对工作有激情的员工。额。。好吧,其实这句话我也不信,但信不信由你,我现在开始讲如何绘制一个半圆的饼图。
- 先来看一下我的数据,下面要对这些数据绘制半圆饼图;先选中这些数据
{% asset_img 245e8bcad1c8a786a48d52616509c93d71cf50fe.jpg Excel2013:[46]如何绘制半圆饼图 %}
- 在插入一... |
C | UTF-8 | 254 | 2.921875 | 3 | [] | no_license | #include <stdlib.h>
#include <stdio.h>
int main(){
char vendedor[30];
double salario, TOTAL;
scanf("%s %lf %lf", vendedor, &salario, &TOTAL);
TOTAL = TOTAL* 0.15 + salario;
printf("TOTAL = R$ %.2lf\n", TOTAL);
return 0;
}
|
SQL | UTF-8 | 2,828 | 3.65625 | 4 | [
"MIT"
] | permissive | CREATE DATABASE IF NOT EXISTS red_social;
USE red_social;
CREATE TABLE IF NOT EXISTS users (
id int(255) auto_increment not null,
role varchar(50),
name varchar(100),
surname varchar(100),
nick varchar(100),
email varchar(255),
password varchar(255),
image varchar(255),
created_at datetime,
updated_at datetime,
remem... |
SQL | UTF-8 | 3,773 | 3.734375 | 4 | [] | no_license | create schema if not exists securestore;
use securestore;
create table if not exists game (
game_id int(11) not null auto_increment primary key,
title varchar(50) not null,
esrb_rating varchar(50) not null,
description varchar(255) not null,
price decimal(5, 2) not null,
studio varchar(50) not ... |
Java | UTF-8 | 562 | 1.84375 | 2 | [] | no_license | package com.wntime.customer.region;
import lombok.Getter;
import lombok.Setter;
import org.springframework.data.annotation.Id;
import org.springframework.data.gemfire.mapping.annotation.Region;
/**
* @author 79448
* @date 2020/10/29 15:22
*/
@Setter
@Getter
@Region("bus_drive_station_info")
public cl... |
Python | UTF-8 | 2,893 | 3.3125 | 3 | [] | no_license | """
Various utility functions for os and numpy related stuff
"""
import os
import sys
import numpy as np
# Numpy
def mysincf(x):
"""Numerically stable sinc function (sin(x)/x)
Input: x (float)
Output: z (float) - sin(x)/x, numerically stable around 0
"""
z = x if x != 0 else 1e-16
return np.sin(z) / z
de... |
Markdown | UTF-8 | 2,448 | 2.703125 | 3 | [
"MIT"
] | permissive | # axios-case-converter
[](https://badge.fury.io/js/axios-case-converter)
[](https://travis-ci.org/mpyw/axios-case-converter)
Axios transformer/interceptor that converts _s... |
Python | UTF-8 | 41 | 2.609375 | 3 | [] | no_license | # int 类型
i = 5
print(i.bit_length())
|
Java | UTF-8 | 813 | 2.21875 | 2 | [] | no_license | package co.edu.uniandes.centralAbastos.vos;
public class PedidoLocalValue
{
String idPedido;
double cantdadNeta;
String deadline;
String correoAdmin;
String codigoLocal;
public PedidoLocalValue(String idPedido, double cantdadNeta,
String deadline, String correoAdmin, String codigoLocal) {
supe... |
Java | UTF-8 | 9,191 | 2.234375 | 2 | [] | no_license | package com.example.carnote;
import android.app.Activity;
import android.app.DatePickerDialog;
import android.content.Intent;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.DatePicker;
import android.w... |
C++ | UTF-8 | 1,457 | 3.265625 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <range/v3/all.hpp>
template <typename T>
std::string print_vector (std::vector<T> & v)
{
std::cerr << "{ ";
for (auto & x : v) {
std::cerr << x << ", ";
}
std::cerr << '}';
return "";
}
//template <typename I, typename O>
//O sum (I range)
//... |
C++ | UTF-8 | 722 | 2.828125 | 3 | [] | no_license | /*
* CompositeGameObject.cpp
*
* Created on: May 1, 2012
* Author: max
*/
#include "CompositeGameObject.h"
CompositeGameObject::CompositeGameObject() :
// sorting algorithm: by z-index, then by ptr value (who cares)
gameObjects(
[](GameObjectShared a, GameObjectShared b) {
return a->getZ() < b->getZ(... |
Java | UTF-8 | 4,203 | 2.09375 | 2 | [] | no_license | package myApp.service.sys;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.SqlSession;
import myApp.client.sys.model.RoleMenuModel;
import myApp.frame.service.ServiceRequest;
import myApp.frame.service.ServiceResult;
impo... |
Markdown | UTF-8 | 1,355 | 3.03125 | 3 | [
"MIT"
] | permissive | ---
title: A new blog!
date: 2019-05-06
path: /new-blog
excerpt: Fingers crossed I can do something cool going forward.
draft: false
---
I've been rebuilding this site/blog for a little while. Moving from [Hugo](https://gohugo.io/) to [Gatsby](https://www.gatsbyjs.org/).
Hugo is absolutely excellent and I strongly en... |
Go | UTF-8 | 1,004 | 3.5 | 4 | [] | no_license | package main
import (
"bufio"
"fmt"
"io"
"log"
"net/http"
"strconv"
"strings"
)
func sumFloatField(r io.Reader, s byte, p int) (int, float64) {
var (
count int
sum float64
)
reader := bufio.NewReader(r)
line, err := reader.ReadBytes(s) // avoid header
for {
line, err = reader.ReadBytes(s)
if err... |
Java | UTF-8 | 1,003 | 1.679688 | 2 | [] | no_license | package cc.dfsoft.project.biz.base.maintain.dao.impl;
import cc.dfsoft.project.biz.base.maintain.dao.AbandonedRecordDao;
import cc.dfsoft.project.biz.base.maintain.dao.DataCollationDao;
import cc.dfsoft.project.biz.base.maintain.dto.AbandonedRecordReq;
import cc.dfsoft.project.biz.base.maintain.entity.AbandonedRecord;... |
PHP | UTF-8 | 2,492 | 2.703125 | 3 | [] | no_license | <!DOCTYPE html>
<html>
<head>
<title> Transcript </title>
<link rel="icon" type="image/png" href="images/favicon-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="images/favicon-16x16.png" sizes="16x16" />
<link rel = "stylesheet" type="text/css" href="style.css"/>
</head>
<body>... |
Python | UTF-8 | 859 | 3.84375 | 4 | [] | no_license | # -*- coding: utf-8 -*-
"""
反转链表
解题思路将使用虚拟before指针,将head的值依次传递给before,最终形成反转链表。
https://leetcode.com/explore/featured/card/recursion-i/251/scenario-i-recurrence-relation/2378/
"""
# Definition for singly-linked list.
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
class Sol... |
C++ | UTF-8 | 4,672 | 2.65625 | 3 | [] | no_license | #include "../include/menu.hpp"
#include "../include/game.hpp"
#include "../include/item.hpp"
#include <SFML/Graphics/Color.hpp>
#include <SFML/System/Vector2.hpp>
#include <SFML/Window/Event.hpp>
#include <SFML/Window/Mouse.hpp>
#include <cstdlib>
extern state currentState;
MainMenu::MainMenu(Game *game,sf::RenderWin... |
JavaScript | UTF-8 | 550 | 2.75 | 3 | [] | no_license | describe("normalizeData", function () {
it("normalizeData function unit test", function () {
var personInfo1 = '{"Name": "Maria", "Id": 2111858,"Age":25}';
var personInfo2 = '{"Name": "Smith", "Id": 2234324,"Age":30}';
var norm1 = normalizeData(personInfo1);
var no... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.