language stringclasses 15
values | src_encoding stringclasses 34
values | length_bytes int64 6 7.85M | score float64 1.5 5.69 | int_score int64 2 5 | detected_licenses listlengths 0 160 | license_type stringclasses 2
values | text stringlengths 9 7.85M |
|---|---|---|---|---|---|---|---|
JavaScript | UTF-8 | 282 | 3.421875 | 3 | [] | no_license | let myFn = async() => {
return "Hello there";
};
async function foo() {
try {
let response = await fetch("http://random.dog/woof.json"); //this replaces .then
let json = await response.json();
} catch(err) {
console.error(err);
}
}
foo(); |
Java | UTF-8 | 1,649 | 3.234375 | 3 | [] | no_license | package com.company;
import com.company.sistema.SistemaMenuLogin;
import java.util.InputMismatchException;
import java.util.Scanner;
public class MenuLogin {
Scanner input = new Scanner(System.in);
public void MenuLogin() {
int opcao = 0;
boolean continua = true;
Sistema... |
C# | UTF-8 | 322 | 2.5625 | 3 | [] | no_license | using System;
namespace eXpressionParsing
{
class PI : RealNumber
{
public PI() : base("pi")
{ }
public override Operand Copy()
{
return new PI();
}
public override double Calculate(double x)
{
return Math.PI;
}
}
}
|
Markdown | UTF-8 | 7,171 | 2.765625 | 3 | [] | no_license | TP N°4 Monitoreo
Teoria:
Maven:
Goals: Comandos Para la consola de mvn que realizan distintas acciones.
$ mvn compile – compila el proyecto y deja el resultado en target/classes
$ mvn test – compila los test y los ejecuta
$ mvn package – empaqueta el proyecto y lo dejará en taget/autentiaNegocio-1.0-SNAPSHOT.ja... |
JavaScript | UTF-8 | 2,810 | 3.734375 | 4 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /* Your Code Here */
/*
We're giving you this function. Take a look at it, you might see some usage
that's new and different. That's because we're avoiding a well-known, but
sneaky bug that we'll cover in the next few lessons!
As a result, the lessons for this function will pass *and* it will be available
for yo... |
PHP | UTF-8 | 8,919 | 2.625 | 3 | [
"MIT"
] | permissive | <?php
namespace Ipunkt\LaravelJsonApi\Resources;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Support\Collection;
use Ipunkt\LaravelJsonApi\Contracts\FilterFactories\FilterFactory;
use Ipunkt\LaravelJsonApi\Contracts\RelatedRepository;
use Ipunkt\LaravelJsonApi\FilterFactories\ArrayFilterFactory;
u... |
Markdown | UTF-8 | 905 | 2.5625 | 3 | [
"CC-BY-4.0",
"MIT"
] | permissive | ---
description: Page-Space to Device-Space Transformations
ms.assetid: 5505cf7a-7b9c-4728-934d-7faa4bdfde30
title: Page-Space to Device-Space Transformations
ms.topic: article
ms.date: 05/31/2018
---
# Page-Space to Device-Space Transformations
The page-space to device-space transformation determines the mapping mod... |
Python | UTF-8 | 74 | 2.734375 | 3 | [] | no_license | x=int(input())
print(sum([x-int(input())for _ in range(int(input()))])+x)
|
Java | UTF-8 | 6,276 | 2.203125 | 2 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package porto2;
/**
*
* @author newton
*/
public class EntradaProdutoJPanel extends javax.swing.JPanel {
/**
* Creates ne... |
Markdown | UTF-8 | 869 | 2.9375 | 3 | [] | no_license | # Expenses and Cash Flow
- Similar to cash for sales, expenses payment can go out before, at or after the services/goods have been delivered.
Acompany pays rent of $1000
## Case 1: Expense and Payment happens at same time
<img src="../Images/S6_Expense_Payment_atsametime.PNG" alt="Expense cash at same time"/>
## Ca... |
C | UTF-8 | 831 | 2.71875 | 3 | [] | no_license | #ifndef RSF_VLSTACK_H
#define RSF_VLSTACK_H
#include <stdlib.h>
#define ST_E_HEADNULL 10
#define ST_E_GROWUPFAIL 11
#define ST_E_HEADEMPTY 12
#define ST_E_NOERR 0
typedef struct _STACK_BLOCK{
long top; // Point to the top item of stack block
long capacity; // Capacity of the stack
char *dat... |
Markdown | UTF-8 | 3,014 | 2.59375 | 3 | [
"MIT"
] | permissive | ---
layout: about
title: about
permalink: /
description: The Lawler group research site seeking breakthroughs in condensed matter physics.
profile:
align: right
image: Michael_Lawler_in_Erice.jpg
address: >
<p>2012 Smart Energy Building</p>
<p>Binghamton University, Vestal, NY 13850</p>
<p>523 Clark ... |
Python | UTF-8 | 715 | 3.4375 | 3 | [] | no_license | class TreeNode:
def __init__(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
class Solution:
def maxPathSum(self, root: TreeNode) -> int:
res = [-float('inf')]
self._max_path_sum(root, res)
return res[0]
def _max_path... |
Markdown | UTF-8 | 4,454 | 3.1875 | 3 | [
"MIT"
] | permissive | # caesar
_a classic cipher cli_
## Installation
```shell
$ go install github.com/stripedpajamas/caesar/cmd/...
$ caesar help
```
generally the syntax is
```shell
caesar -c <cipher> -k <key> -t <text> <encrypt|decrypt>
```
leave off `-t <text>` and caesar will read from stdin.
optionally you can also provide a `--... |
Markdown | UTF-8 | 671 | 2.84375 | 3 | [] | no_license | # Is it possible to break the «curse of dimensionality»? Spatial specifications of multivariate volatility models
Code for the paper in [Applied Econometrics](https://econpapers.repec.org/article/risapltrx/0249.htm) journal, 2014.
The article is devoted to the estimation of multivariate volatility of a portfolio cons... |
SQL | UTF-8 | 1,647 | 3.546875 | 4 | [] | no_license | SET FOREIGN_KEY_CHECKS =0;
DROP TABLE IF EXISTS `ers_operation_step`;
CREATE TABLE `ers_operation_step` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增编码',
`userId` bigint(20) NOT NULL COMMENT '员工编码',
`empName` bigint(20) NOT NULL COMMENT '员工名称',
`itemId` bigint(20) NOT NULL COMMENT '对象编码',
`itemType` v... |
Shell | UTF-8 | 2,272 | 3.921875 | 4 | [] | no_license | #!/bin/bash
rawurlencode() {
local string="${1}"
local strlen=${#string}
local encoded=""
for (( pos=0 ; pos<strlen ; pos++ )); do
c=${string:$pos:1}
case "$c" in
[-_.~a-zA-Z0-9] ) o="${c}" ;;
* ) printf -v o '%%%02x' "'$c"
esac
encoded+="${o}"
done
echo ... |
C | UTF-8 | 955 | 3.359375 | 3 | [] | no_license | #include <stdio.h>
#include <setjmp.h>
#include <signal.h>
jmp_buf env; // 保存待跳转位置的栈信息
/*信号SIGRTMIN+15的处理函数*/
void handler_sigrtmin15(int signo)
{
printf("recv SIGRTMIN+15\n");
longjmp(env, 1); // 返回到env处,注意第二个参数的值
}
/*信号SIGRTMAX-15的处理函数*/
void handler_sigrtmax15(int signo)
{
printf("recv SIGRTMAX-15\n"... |
Python | UTF-8 | 678 | 2.78125 | 3 | [] | no_license | import pandas as pd
import numpy as np
dt = pd.read_csv("train.csv")
nv = ['PassengerId','Pclass','Age','SibSp','Parch','Fare']
dt['Age'] = dt['Age'].fillna(dt['Age']).median()
y = dt['Survived']
from sklearn.model_selection import train_test_split
X_train, X_test, Y_train, Y_test = train_test_split(dt[nv],dt['Survi... |
Go | UTF-8 | 442 | 3.109375 | 3 | [] | no_license | package main
import "fmt"
import "github.com/texttheater/golang-levenshtein/levenshtein"
/*
Doesn't work, raised ticket
https://github.com/texttheater/golang-levenshtein/issues/11
*/
func main() {
source := "kitten"
target := "sitting"
distance := levenshtein.DistanceForStrings([]rune(source), []rune(target), le... |
Markdown | UTF-8 | 3,166 | 3.671875 | 4 | [] | no_license | # Angular Visibility API
This is an Angular service for interacting with Browser's Visibility API.
This API is useful when you want to know whether your application is currently being viewed by the user or if the tab/window is in the background.
## Usage
To use this service, the `VisibilityModule` must be imported ... |
Java | UTF-8 | 12,476 | 1.84375 | 2 | [] | no_license | package com.yunma.controller.mapCount;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.sql.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Con... |
C# | UTF-8 | 523 | 2.609375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace FINAL.Models
{
public class Factory
{
public static ITask create_task(string tasktype)
{
switch (tasktype)
{
case "task":
return new Task()... |
Java | UTF-8 | 618 | 2.359375 | 2 | [] | no_license | package net.cagox.game.entities.components;
import com.badlogic.ashley.core.Component;
/**
* A Component that identifies the Entity as containing map data.
*
* @author Kenneth M. Burling (burlingk) <burlingk@cagox.net>
* @version 0.1
* @since 0.1
*/
public class MapComponent implements Componen... |
Python | UTF-8 | 1,317 | 3.40625 | 3 | [] | no_license | # 状态:超出时间限制
# 最后执行的输入:[8,2,6,8,9,8,1,4,1,5,3,0,7,7,0,4,2,2,5,5]
from copy import copy
class Solution:
solu_dict = None
def maxCoins(self, nums: List[int]) -> int:
if self.solu_dict is None:
self.solu_dict = {}
if len(nums) == 1:
return nums[0]
# 记忆化搜索,查找结果
... |
Markdown | UTF-8 | 1,957 | 2.703125 | 3 | [
"MIT"
] | permissive | ---
layout: post
title: 무료 wildcard DNS 서비스
image: /assets/img/dns-300x300.png
---
## 무료 wildcard DNS 서비스
무료 wildcard DNS 서비스는 사용자가 도메인을 발급 받지 않아도,
서비스 IP 주소와 비슷한 형태로 도메인을 사용할 수 있게끔 해주는 서비스 입니다.
Wildcard DNS 서비스는 *.IP주소.{DNS service provider} 와 같은 형태의 도메인 쿼리가 오면,
항상 도메인에 포함된 {IP주소}를 반환하는 서비스 입니다.
사용할 수있는 여러 가지 서비스가 있습... |
Python | UTF-8 | 4,513 | 3.078125 | 3 | [] | no_license | import discord
from random import randint
from random_username.generate import generate_username
import string
import time
import requests
randomWordAPI = "https://random-word-api.herokuapp.com/word?number=1"
token = "NDM2NTkyNDYzNTI5MTE1NjU4.Wtjeag.RPt5pKP5ItDsCt80T3KlkFWETcU"
client = discord.Client()
def emptyStri... |
Python | UTF-8 | 2,864 | 2.90625 | 3 | [
"Apache-2.0"
] | permissive | import torch.nn as nn
from torch_fidelity.helpers import vassert
class FeatureExtractorBase(nn.Module):
def __init__(self, name, features_list):
"""
Base class for feature extractors that can be used in :func:`calculate_metrics`.
Args:
name (str): Unique name of the subclass... |
JavaScript | UTF-8 | 3,013 | 3.984375 | 4 | [] | no_license | // for some questions
function max_num(num1, num2){
if (num1>num2)
console.log(String(num1), 'is greater than', String(num2));
else if (num1===num2)
console.log(String(num1), 'is the same as', String(num2));
else
console.log(String(num2), 'is greater than', String(num1));
}
max_num... |
Markdown | UTF-8 | 1,278 | 2.703125 | 3 | [] | permissive | ---
title: "Schematy Automatyzacji"
sidebar_label: Schematy Automatyzacji
---
## Wprowadzenie
Schematy automatyzacji to gotowe szablony automatyzacji, które można łatwo dostosować i dodać do swojego Asystenta domowego jako automatyzacje.
Czyli są to takie wstępnie skonfigurowane automatyzacje które wystarczy dostosow... |
JavaScript | UTF-8 | 780 | 3.78125 | 4 | [] | no_license | /**
* Дан массив целых неповторяющихся целых
* положительных чисел, надо вернуть строку
* где отличающиеся на один числа свернуты
*
* дано [6,1,3,9,2,4,11,7]
* вернуть “1-4,6-7,9,11"
*/
export const collapseNumbers = (numbers) => {
numbers = numbers.sort((a, b) => a - b);
const chunks = [];
let chunk = [... |
Java | UTF-8 | 448 | 1.757813 | 2 | [] | no_license | package com.makeramen.nowdothis.ui.imgur;
import com.makeramen.nowdothis.NowDoThisAppComponent;
import com.makeramen.nowdothis.dagger.PerImgurActivity;
import com.makeramen.nowdothis.data.imgur.ImgurModule;
import dagger.Component;
@PerImgurActivity
@Component(dependencies = NowDoThisAppComponent.class, modules = {Im... |
PHP | UTF-8 | 1,615 | 2.59375 | 3 | [] | no_license | <?php
/**
* Copyright © EcomDev B.V. All rights reserved.
* See LICENSE for license details.
*/
declare(strict_types=1);
namespace EcomDev\BenchmarkMySQLBatchInsert;
use Zend\Db\Adapter\Adapter;
class PreparedStatementMultiValueInsert implements InsertMethod
{
public function import(Adapter $adapter, string... |
PHP | UTF-8 | 11,123 | 2.515625 | 3 | [] | no_license | <?php
#
# ss_ipmitool_sensors.php
# version 0.5
# June 26, 2009
#
# Copyright (C) 2006-2009, Eric A. Hall
# http://www.eric-a-hall.com/
#
# This software is licensed under the same terms as Cacti itself
#
#
# load the Cacti configuration settings if they aren't already present
#
$no_http_headers = true;
if (isset($co... |
Java | UTF-8 | 1,822 | 2.734375 | 3 | [
"MIT"
] | permissive | package dsdsse.history;
import adf.utils.StandardFonts;
import javax.swing.*;
import javax.swing.border.EmptyBorder;
import java.awt.*;
/**
* Created by Admin on 10/4/2016.
*/
public class TraceLogTitlePanel extends JPanel {
private final String TITLE_PART_1 = "\u2193 - Current state \u00B7 ";
... |
TypeScript | UTF-8 | 1,090 | 2.703125 | 3 | [
"MIT"
] | permissive | import { createDictionaryTransformer } from './transformer/dictionary.transformer';
import { createGeneratorTransformer } from './transformer/generator.transformer';
import { createVariableStoreTransformer } from './transformer/variable-store.transformer';
import { Transformer } from './transformer.interface';
class T... |
Markdown | UTF-8 | 2,816 | 2.921875 | 3 | [] | no_license | # 区块链及初链初识
## 入行区块链之前
入行之前在一家金融监管自媒体公司。每天关心的是一行三会的各种突发监管政策,接触的是各类相关法律,打交道的是各类有业务创新及合规需求的金融机构。所以,从宏观角度能对金融略知一二,知道货币的发行、信用派生,以及货币对国家经济调节的重要性。没有想过如果,在没有郭嘉做信用背书的前提下,如果建立一个自由流动的货币价值体系,如何可以更高效的实现价值流动和传输。
## 炒币经历
离职后,一个很偶然的线下交流,接触了一两个虚拟货币的传道者。在我说,好茫然的时候,毅然决然且无比兴奋的告诉我,做区块链啊。于是我开始查一些区块链的相关资料,开始在其卖房炒币的带动下,投入越来越多资金到虚拟货币。并且我也很兴奋的觉... |
Java | UTF-8 | 133 | 1.671875 | 2 | [] | no_license | package com.user.process.dao;
public interface IUserDao {
String selectUserByUsername(String username) throws Exception;
}
|
Python | UTF-8 | 626 | 3 | 3 | [] | no_license | import os
import random
import re
import sys
# Complete the countApplesAndOranges function below.
c1=0
c2=0
st = map(int,raw_input().split())
s = st[0]
t = st[1]
ab = map(int,raw_input().split())
a = ab[0]
b = ab[1]
mn = map(int,raw_input().split())
m = mn[0]
n = mn[1]
apples = map(int, raw_input().split())
... |
PHP | UTF-8 | 1,119 | 3.5625 | 4 | [] | no_license | <?php
class Color
{
public $red;
public $green;
public $blue;
public static $verbose = False;
function __construct($rgb_arr)
{
if (isset($rgb_arr['rgb']))
{
$hex = $rgb_arr['rgb'];
$int = hexdec($hex);
$this->red = ($int >> 16) & 255;
$this->green = ($int >> 8) & 255;
$this->blue = $int & 25... |
Ruby | UTF-8 | 371 | 3.265625 | 3 | [] | no_license | n = gets.chomp.to_i
cards = {"S" => Array.new(13, false), "H" => Array.new(13, false), "C" => Array.new(13, false), "D" => Array.new(13, false)}
while line = gets
line = line.chomp.split(/ /)
cards[line[0]][line[1].to_i - 1] = true
end
cards.each do |k,v|
if v.count(true) < 13
v.each_with_index do |n, i|
... |
Java | UTF-8 | 317 | 1.953125 | 2 | [] | no_license | package org.fish.code.boot.source.context.editor;
import java.util.Date;
import lombok.Data;
import lombok.ToString;
/**
* Birthday, age, sex, etc.
*
* @author chenjunfeng1
*
*/
@Data
@ToString
public class Person {
private Date birthDate;
private int age;
private int sex;
}
|
Python | UTF-8 | 146 | 3.625 | 4 | [] | no_license | def my_func(a, b):
a, b = int(a), int(b)
print(a+b)
print(a-b)
print(a*b)
print(a//b)
print(a%b)
a, b = input().split()
my_func(a, b) |
Java | UTF-8 | 568 | 2.984375 | 3 | [] | no_license | package by.bntu.fitr.varabei.javalabs.lab07.model;
import java.util.Random;
public class Mood {
public final static String GOOD_MOOD = "=)";
public final static String FURIOUS = "=(";
public final static String NORMAL_MOOD = "=|";
public final static int MAX_SPIRITS = 3;
public static String determine... |
Markdown | UTF-8 | 863 | 2.75 | 3 | [
"Unlicense"
] | permissive | ## Project Soul
**Project description:** This project is still in development. Its a 2D roguelike game set in Japan during the Edo period. It follows a pair of sibblings battling through enemies utilizing elemental abilities and weapons.
**Tasks:** My task for this project was to construct the core game architecture,... |
Java | UTF-8 | 29,000 | 1.53125 | 2 | [] | no_license | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2014.03.03 at 01:06:5... |
Java | UTF-8 | 1,080 | 2.25 | 2 | [] | no_license | package system.controller;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.sprin... |
Markdown | UTF-8 | 4,727 | 3.65625 | 4 | [] | no_license | ## 1\.Exercice 1
Selon vous, qu'est ce qui s'affiche à l'écran avec le programme suivant ?
```
var i = 0;
while (i <= 9) {
console.log("One run of the loop");
i ++;
}
```
Combien de fois la phrase est-elle affichée ? Pourquoi ? Est-ce le bon nombre de répétition de la boucle ?
Remplacez "i ++" par "i += 2". Que s... |
Python | UTF-8 | 98 | 2.515625 | 3 | [] | no_license | try:
print 1/0
except ZeroDivisionError, e:
print e
except:
print "error or exception occured"
|
Java | UTF-8 | 2,165 | 2.3125 | 2 | [] | no_license | package com.infoworks.lab.controllers.rest;
import com.infoworks.lab.domain.entities.Passenger;
import com.infoworks.lab.rest.models.ItemCount;
import com.it.soul.lab.data.simple.SimpleDataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import j... |
Java | UTF-8 | 360 | 2.6875 | 3 | [] | no_license | package moderate;
public class Rand{
public int rand7(){
int result = 10;
while(result > 6){
int side = rand5();
while(side == 2){
side = rand5();
}
if(side < 2){
result = rand5();
}else{
result = rand5() + 5;
}
}
return result;
}
protected int rand5(){
int result = (int)(M... |
C++ | UTF-8 | 901 | 3.421875 | 3 | [] | no_license | // Given a non-empty array of integers, every element appears three times except for one, which appears exactly once. Find that single one.
// Note:
// Your algorithm should have a linear runtime complexity. Could you implement it without using extra memory?
// Example 1:
// Input: [2,2,3,2]
// Output: 3
// Example... |
C# | UTF-8 | 1,618 | 3.265625 | 3 | [] | no_license | using System;
using JetBrains.Annotations;
namespace LoggingProxyExample
{
/// <summary>
/// Implementation of the <see cref="ICommand" /> interface.
/// </summary>
[UsedImplicitly]
public class Command : ICommand
{
public Command(Action action)
{
if (action == ... |
Go | UTF-8 | 594 | 2.671875 | 3 | [] | no_license | package storage
const (
ErrorIfExist OpenOption = "Error If Exist"
DefaultOpenOption OpenOption = "Default"
)
const (
ErrNotFound KVStorageError = "Not Found"
)
type KVStorage interface {
Put(key string, value interface{}) (err error)
Get(key string, value interface{}) (err error)
Has(key string) (ret boo... |
Java | UTF-8 | 437 | 1.515625 | 2 | [] | no_license | package com.kabba.transform;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.transaction.annotation.EnableTransactionManagement;
@SpringBootApplication
@EnableTransactionManagement
public class TransformApplication {
... |
Java | UTF-8 | 107 | 1.65625 | 2 | [] | no_license | package com.assignment.User.exception;
public class NoUserInDatabaseException extends RuntimeException{
}
|
Go | UTF-8 | 3,546 | 2.921875 | 3 | [] | no_license | package main
import (
"bytes"
"database/sql"
"fmt"
"net/http"
"github.com/gin-gonic/gin"
_ "github.com/go-sql-driver/mysql"
)
func main() {
db, err := sql.Open("mysql", "root:root@tcp(localhost:3306)/apiweb")
if err != nil {
fmt.Print(err.Error())
}
defer db.Close()
//membuat koneksi ke database
err = ... |
Java | UTF-8 | 1,345 | 2.015625 | 2 | [
"Apache-2.0",
"LicenseRef-scancode-unknown"
] | 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 may not ... |
C | UTF-8 | 3,662 | 3.890625 | 4 | [] | no_license | #include <stdio.h>
#include <math.h>
//MENU
void Menu (){
printf("!!!MENU!!!\n");
printf("1 : Cálculo de fatorial\n");
printf("2 : Verificação número primo\n");
printf("3 : Encontrar números primos\n");
printf("4 : Cálculo de potência\n");
printf("5 : Cálculo de raiz\n:");
printf("6 : Verificar se ano é bissexto\n:")
... |
C# | UTF-8 | 1,089 | 2.75 | 3 | [
"MIT"
] | permissive | using NBitpayClient;
using System.Linq;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
namespace BTCPayServer.Services.Rates
{
public class BitpayRateProvider : IRateProvider
{
Bitpay _Bitpay;
public BitpayRateProvider(Bitpay bitpay)
{
... |
TypeScript | UTF-8 | 780 | 2.609375 | 3 | [] | no_license |
import { NegociacaoParcial, Negociacao } from "../models/index";
export class NegociacaoService {
getNegociacoes(handleErrors: HandlerFunction): Promise<Negociacao[]> {
return fetch("http://localhost:8080/dados")
.then(response => handleErrors(response))
.then(response => respons... |
PHP | UTF-8 | 3,379 | 3.09375 | 3 | [] | no_license | <?php
/**
*
*/
class indexlink
{
//参照されたことのない置き去りhtm
public $notrefs = array();
//参照されてるけど存在しないリンク
public $notexist = array();
//存在しないリンクを張ってるhtm
public $errorlink = array();
function __construct($workdir)
{
//カウンタ用のリスト
$refDepthCount = array();
//全htmlを取得
... |
PHP | UTF-8 | 2,299 | 2.625 | 3 | [] | no_license | <?php
namespace App\Http\Controllers;
use App\Jobs\PlaceBet;
use App\Models\Contact;
use Symfony\Component\HttpFoundation\Response;
class TransactController extends Controller
{
/**
* @param string $mobile
* @param string $action
* @param int $amount
* @return Contact|null
*/
public ... |
Java | UTF-8 | 643 | 3.453125 | 3 | [
"MIT"
] | permissive | package noNeg;
import java.util.ArrayList;
import java.util.List;
public class NoNeg {
//Dada a lista numérica "nums", retorne outra em que não haja números abaixo de 0.
public List<Integer> noNeg(List<Integer> nums) {
nums.removeIf(n -> n < 0);
return nums;
}
//RELEMBRANDO...
pu... |
C++ | UTF-8 | 2,676 | 2.953125 | 3 | [
"BSL-1.0"
] | permissive | // Copyright Justinas Vygintas Daugmaudis, 2010.
// Use, modification and distribution is subject to the
// Boost Software License, Version 1.0. (See accompanying
// file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0)
#ifndef HEADER_DETAIL_LIST_ASSIGNMENT_HPP_INCLUDED
#define HEADER_DETAIL_LIST_ASSIGNMENT_HPP_INCLUD... |
Java | UTF-8 | 179 | 2.125 | 2 | [] | no_license | package io.jsd.training.designpattern.book.chap3.ObjetsGraphiques.objetsgraphiquesavecannule;
public interface Commande {
public void lance();
public void annule();
}
|
JavaScript | UTF-8 | 7,380 | 3.0625 | 3 | [] | no_license |
function startBlinkingTextWrapper(){
var typing_simulators = (() => {
var typing_simulator_node_list = document.querySelectorAll(".typing-simulator");
var selves = [];
Array.prototype.forEach.call(typing_simulator_node_list, self => {
var next_character_index = 0;
var added_ch... |
C++ | UTF-8 | 4,330 | 2.796875 | 3 | [
"BSD-3-Clause"
] | permissive | /*=========================================================================
Program: Visualization Toolkit
Module: vtkSmartPointerBase.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
T... |
PHP | UTF-8 | 2,252 | 2.8125 | 3 | [] | no_license | <?php
namespace App\Cms;
use App\Entity\CmsPage;
use App\Repository\CmsPageRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use RuntimeException;
use Twig\Environment;
class PageManager
{
/** @var CmsPageRepository */
private $pageRepository;
/** @... |
Java | UTF-8 | 1,337 | 2.453125 | 2 | [] | no_license | package com.twx.transfer;
import com.twx.VO.QueryVO;
import com.twx.entity.WarnEntity;
import com.twx.enums.WarnTypeEnum;
import org.springframework.beans.BeanUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collector;
import java.util.stream.Collectors;
public class WarnEntity2Query... |
PHP | UTF-8 | 1,718 | 2.765625 | 3 | [] | no_license | <?php
namespace vir;
class ObjectGroup implements \Iterator, \ArrayAccess, \JsonSerializable {
private $position = 0;
private $container = [];
public function __construct() {
Debug::Log();
$this->position = 0;
}
///// Iterator functions
function rewind() {
$this->posi... |
Markdown | UTF-8 | 4,411 | 2.890625 | 3 | [] | no_license | +++
date = "2016-08-21T11:26:34+07:00"
title = "Hướng dẫn dùng Hugo để viết blog"
+++
Trong bài viết này mình sẽ hướng dẫn sử dụng Hugo để viết bài. Các bạn cũng sử dụng Hugo để viết bài cho Golangvn. Mình hoan nghênh mọi sự đóng góp từ các bạn. Các bạn có thể sử dụng chức năng pull requests của Github, mình sẽ merg... |
Shell | UTF-8 | 1,105 | 3.5 | 4 | [
"Apache-2.0"
] | permissive | #!/bin/bash
set -e
PACKER_VERSION=1.0.4
TERRAFORM_VERSION=0.10.2
TERRAGRUNT_VERSION=0.13.0
TOOLS_DIR=$1
mkdir -p ${TOOLS_DIR}
BIN_DIR=${TOOLS_DIR}/bin
mkdir -p ${BIN_DIR}
export PATH=${BIN_DIR}:$PATH
### Install Terraform
TERRAFORM_DL=${TOOLS_DIR}/terraform-${TERRAFORM_VERSION}
if [ ! -d "${TERRAFORM_DL}" ]
then
... |
Python | UTF-8 | 11,779 | 2.6875 | 3 | [] | no_license | import numpy
import math
import DNA_matrix
def base_pair_parameters(rotation_1,rotation_2,origin_1,origin_2):
z1_v=numpy.array([rotation_1[i][2] for i in range(3)])
z2_v=numpy.array([rotation_2[i][2] for i in range(3)])
if numpy.dot(z1_v,z2_v.T) < 0:
for i in range(3):
for j in range(1... |
Java | UTF-8 | 2,993 | 2.375 | 2 | [] | no_license | package in.ac.iiit.cvit.heritage;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.Button;
/**
* Created by HOME on 03-11-2016.
*/
public class InstructionsActivity extends AppCompatAct... |
Java | UTF-8 | 189 | 1.976563 | 2 | [
"MIT"
] | permissive | package wraith.quivermd.mixin_interfaces;
import net.minecraft.item.ItemStack;
public interface IItemStack {
void setQuiverStack(ItemStack stack);
ItemStack getQuiverStack();
}
|
Java | UTF-8 | 1,236 | 4.5 | 4 | [] | no_license | package com.java.collection;
import java.util.Iterator;
import java.util.TreeSet;
public class TreeSetExample {
/**
* TreeSet is sorted
* How to iterate a TreeSet
* How to check empty
* How to retrieve first/last element
* How to remove an element
*/
public static void main(String[] args) {
TreeSet<I... |
Java | UTF-8 | 3,600 | 2.3125 | 2 | [] | no_license | package com.rexar.islandcraft;
import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.graphics.Colors;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Pixmap;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.... |
Rust | UTF-8 | 2,566 | 3.015625 | 3 | [
"MIT"
] | permissive | use std::error;
use std::fmt;
use std::string;
use serde_json;
use ring;
use data_encoding;
#[derive(Debug)]
pub enum JwtError {
Decode,
Verify
}
impl fmt::Display for JwtError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("Token decode error")
}
}
impl error::Error fo... |
Python | UTF-8 | 453 | 3.328125 | 3 | [] | no_license | class Solution:
def issubstring(self,a,b):
i,j=0,0
while i<len(a) and j<len(b):
if a[i]==b[j]:
i+=1
j+=1
else:
i+=1
return j==len(b)
def findLongestWord(self, s: str, d: List[str]) -> str:
d.sort(key=lambda w... |
Ruby | UTF-8 | 914 | 2.609375 | 3 | [] | no_license | class Post < ApplicationRecord
belongs_to :user
has_many :comments
has_many :likes
has_many :post_categories
has_many :categories, through: :post_categories
has_many :liked_users, through: :likes, source: :user
has_many :commented_users, through: :comments, source: :user
has_one_attached :image
#Vali... |
Go | UTF-8 | 3,017 | 2.578125 | 3 | [
"BSD-3-Clause",
"Apache-2.0",
"TCL",
"HPND",
"LicenseRef-scancode-unknown-license-reference",
"OpenSSL",
"LicenseRef-scancode-openssl",
"MIT",
"LicenseRef-scancode-ssleay-windows",
"ISC",
"BSD-2-Clause"
] | permissive | package server
import (
"github.com/gin-gonic/gin"
"net/http"
"runtime"
"sort"
"strconv"
"fmt"
)
const (
RunTime = "info"
Health = "health"
GC = "gc"
Conn = "conn"
)
type MonitorResp struct {
//Code int `json:"code"`
Message string `json:"message"`
Data interface{} `json:"data,omite... |
Python | UTF-8 | 1,432 | 3.5 | 4 | [] | no_license | import tkinter
class Menubutton(tkinter.Tk):
def __init__(self):
tkinter.Tk.__init__(self)
self.title("MenuButton")
self.geometry("200x200")
menubutton = tkinter.Menubutton(text="Cities")
menubutton.pack()
self.var = tkinter.StringVar()
cities = ["Houston",... |
Python | UTF-8 | 2,362 | 3.578125 | 4 | [] | no_license | # extracts only relevant words from frontpage, returns one string
# param doc: PDF document to iterate through of type <class 'fitz.fitz.Document'>
def get_clean_frontpage_text(doc):
page = doc.loadPage(0)
text = page.getText('text') # extract text from pdf
clean_text = text.split() # removes formatting ... |
Python | UTF-8 | 1,684 | 3.5 | 4 | [] | no_license | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
def boundaryOfBinaryTree(self, root: TreeNode) -> List[int]:
def isLeaf(node:TreeNode) -> bool:
return node.... |
Java | UTF-8 | 2,294 | 3.515625 | 4 | [] | no_license | /*
@Copyright:LintCode
@Author: vadxin
@Problem: http://www.lintcode.com/problem/kth-smallest-number-in-sorted-matrix
@Language: Java
@Datetime: 16-07-18 05:35
*/
class Element {
public int val;
public int row;
public int col;
public Element(int val, int row, int col) {
this.val = val;
... |
C | UTF-8 | 311 | 2.84375 | 3 | [
"0BSD"
] | permissive | #include <stdio.h>
int a[50000];
int main(){
int i,j,A=0,B=0;
for(i=0;i<50000;i++)a[i]=i*(i+1)/2+1;
int v[2];
scanf("%d%d",v,v+1);
for(j=0;j<2;j++){
for(i=0;i<50000;i++){
if(a[i]>v[j]){
int x=a[i]-v[j];
A+=x,B+=i+1-x;
break;
}
}
}
int x=A+B-2;
printf("%d\n",a[x]+B-1);
return 0;
} |
Java | UTF-8 | 318 | 2.5625 | 3 | [] | no_license | package Factory;
public class factory {
public static void main(String[] args) {
// TODO Auto-generated method stub
String str1="CheesePizza";
String str2="PepperoniPizza";
String str3="ClamPizza";
PizzStore ps=new PizzStore();
ps.orderPizza(str1);
ps.orderPizza(str2);
ps.orderPizza(str3);
}
}
|
JavaScript | UTF-8 | 2,349 | 3 | 3 | [] | no_license | var weatherObject = new XMLHttpRequest();
weatherObject.open('GET','/EmilyTheApple.github.io/lesson-9/JSON/towndata.JSON',true)
weatherObject.send();
weatherObject.onload = function() {
var weatherInfo = JSON.parse(weatherObject.responseText);
console.log(weatherInfo);
document.getElementById('presto... |
Markdown | UTF-8 | 3,137 | 3.625 | 4 | [] | no_license | # 单例模式
- 系统中被唯一使用
- **一个类只能初始化一个实例**
## 示例
- 登录框
- 购物车
- redux
- vuex
## 说明
- 单例模式需要用到Java的特性(private)
- ES6中没有(typescript除外)
- 只能用Java代码来演示UML图的内容
Java单例实例
```java
public class SingleObject{
// 注意,私有化构造函数,外部不能new,只能内部new
private SingleObject() {}
// 唯一被 new 出来的对象
private SingleObject instance = ... |
Java | UTF-8 | 1,672 | 3.296875 | 3 | [] | no_license | import java.io.*;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
/**
* Created by Marvin on 28.11.2014.
*/
public class Main {
public static void main (String[] args) throws UnsupportedEncodingException, NoSuchAlgorithmException {
int i = 0;... |
Java | UTF-8 | 3,935 | 2.140625 | 2 | [
"MIT"
] | permissive | package com.example.together.activities;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.ap... |
Java | UTF-8 | 10,361 | 3.234375 | 3 | [] | 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 cine;
import java.util.Scanner;
import java.util.LinkedList;
/**
*
* @author Usuario Estandar
*/
public clas... |
Markdown | UTF-8 | 13,192 | 3.25 | 3 | [] | no_license | **Udacity Self-driving Car NanoDegree Project2** -- **Traffic Sign Recognition**
---
## **Introduction**
In this project, a deep convolutional neural network is implemented using Python under TensorFlow framework to classify traffic signs. Deep learning techniques and computer vision methods are employed to do the da... |
Python | UTF-8 | 802 | 3.234375 | 3 | [] | no_license | def memoize(hash_func = lambda args : args):
def memoize_wrap(f):
mem = {}
def memorized(*args):
hash_value = hash_func(*args)
if hash_value not in mem:
# Note args are wrapped as a tuple not list, so it is hashable
mem[hash_value] = f(*args)
return mem[hash_value]
return... |
C# | UTF-8 | 1,124 | 2.625 | 3 | [] | no_license | using SDL2;
public class EndScreen : IScreen
{
public ScreenType NextScreen { get; set; }
private static Image background;
private Font font;
private Text text;
static EndScreen()
{
background = new Image
(Game.LanguageTranslation[Game.GameLanguage + "EndPath"],
... |
Python | UTF-8 | 511 | 2.625 | 3 | [] | no_license | #!/usr/bin/env python
import sys
sys.path.append("../lib/");
sys.path.append("../swig/");
import PyMesh
def main():
print("Start!");
filename = "holey.obj"
mesh = PyMesh.MeshFactory.create_mesh(filename);
vertices = mesh.get_vertices();
faces = mesh.get_faces();
voxels = mesh.get_voxels();
... |
Java | UTF-8 | 1,521 | 2.671875 | 3 | [
"Apache-2.0"
] | permissive | package neuralnet.output;
import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.util.Arrays;
import neuralnet.lossfunctions.LossFunction;
import neuralnet.transferfunctions.TransferFunction;
import org.jblas.DoubleMatrix;
public class Probabi... |
PHP | UTF-8 | 2,264 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
namespace Omnipay\Pagarme\Message;
use Omnipay\Tests\TestCase;
class FetchTransactionRequestTest extends TestCase
{
public function setUp()
{
$this->request = new FetchTransactionRequest($this->getHttpClient(), $this->getHttpRequest());
$this->request->initialize(
array(
... |
PHP | UTF-8 | 2,856 | 2.546875 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers\Vendor;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Hash;
use App\Models\User;
use App\Models\VendorDetail;
class RegisterController extends Controller
{
public function index()
{
return view('vendor.regist... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.