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 |
|---|---|---|---|---|---|---|---|
Java | UTF-8 | 3,133 | 2.671875 | 3 | [] | no_license | /**
* Copyright (C) 2012-2013 Dušan Vejnovič <vaadin@dussan.org>
*
* 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 ... |
C++ | UTF-8 | 3,125 | 4.28125 | 4 | [] | no_license | #include<iostream>
using namespace std;
class node{
public:
int data;
node* prev;
node* next;
};
class doublylinkedList{
node* head;
public:
doublylinkedList(){
head = NULL;
}
doublylinkedList(int data){
node* newNode = new node;
newNode->data = data;
head = newNode;
}
void insertAfter(int data,... |
Markdown | UTF-8 | 1,506 | 3.140625 | 3 | [] | no_license | # Notes app
***
### Tecnologias utilizadas:
1. Javascript
2. Node.js
3. Express.js
***
## Pasos para la instalación:
```
$ git clone git@github.com:ayrtoncravero/notes.git
$ cd notes
$ npm install (Instalacion de dependecias)
$ npm run dev (Ejecutar el servidor)
```
- El servidor esta disponible en 'http://localhost:30... |
PHP | UTF-8 | 908 | 2.9375 | 3 | [] | no_license | <?php
namespace Irate\Core;
use \PDO;
use Irate\System;
/**
* Base model
*/
abstract class Library
{
// Instance of the request class
protected $request;
// Instance of the security class
protected $security;
// Instance of the db class
protected $db;
// Instance of the email class
protected $e... |
C++ | UTF-8 | 270 | 2.84375 | 3 | [] | no_license | class Solution {
public:
int maxProfit(vector<int>& prices) {
if(prices.size()<=1) return 0;
int res=0;
for(int i=1;i<prices.size();i++){
res+=(prices[i]>prices[i-1]?prices[i]-prices[i-1]:0);
}
return res;
}
}; |
Markdown | UTF-8 | 7,235 | 2.8125 | 3 | [] | no_license | ---
title: "17.1 术语和定义"
slug: "术语和定义"
hidden: false
createdAt: "2018-12-14T15:21:51.034Z"
updatedAt: "2019-12-13T03:20:32.013Z"
---
[block:api-header]
{
"title": "术语和定义(BCX-NHAS-1808标准相关术语和定义)"
}
[/block]
## 分布记账 distributed ledger
也称分布式分类账、共享分类账、DLT等,是一种在多个账本间通过网络同步机制同步、共享数字信息的信息记录方式。在分布记账式中,没有中心数据存储或管理者,账本间通过P2P连接通... |
C# | UTF-8 | 2,476 | 2.5625 | 3 | [] | no_license | namespace Util.Webs.EasyUi.Buttons {
/// <summary>
/// 弹出窗口按钮
/// </summary>
public interface IDialogButton : IButtonBase<IDialogButton> {
/// <summary>
/// 设置弹出窗口网址
/// </summary>
/// <param name="url">弹出窗口网址</param>
IDialogButton Url( string url );
/// ... |
Python | UTF-8 | 5,967 | 3.375 | 3 | [] | no_license | import random
import math
import itertools
import operator
from heuristics import NearestInsertion, NearestNeighbour
import collections
import copy
def cartesian_distance(a, b):
"a and b should be tuples, computes distance between two cities"
return math.sqrt((a.x - b.x)**2 + (a.y - b.y)**2)
def compute_distances_m... |
Python | UTF-8 | 1,338 | 2.90625 | 3 | [] | no_license | import pandas as pd
import numpy as np
import pickle
from sklearn.impute import SimpleImputer
from sklearn.preprocessing import StandardScaler
base = pd.read_csv('credit-data.csv')
previsores = base.iloc[:, 1:4].values
classe = base.iloc[:, 4].values
impute = SimpleImputer()
impute = impute.fit(previsores[:, 1:4... |
Markdown | UTF-8 | 11,599 | 3.328125 | 3 | [] | no_license |
# Determine Sample Size for an A/B Test
### What is a “Sample Size”?
[[Statistics How To]][Sample Size in Statistics (How to Find it): Excel, Cochran’s Formula, General Tips]
A sample size is a **part of the population** chosen for a survey or experiment. For example, you might take a survey of dog owner’s brand pr... |
C | UTF-8 | 4,013 | 3.171875 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#if defined(__APPLE__)
#include <mach/mach_time.h>
#endif
// Structure for thread
struct thread_data {
// Shared value
double volatile *p_s;
// Lock variable s
pthread_mutex_t *p_s_lock;
// Number of iterations
long int nb_iter;
// Number... |
Python | UTF-8 | 2,200 | 3.390625 | 3 | [] | no_license | import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import json
import os
#visualization for the artist followers ordered increasingly and average track price
#get artist follower count
try:
dir = os.path.dirname(__file__)
full_path = os.path.join(dir,"data.json")
in_file = open(full_path... |
Markdown | UTF-8 | 4,123 | 2.953125 | 3 | [
"MIT"
] | permissive | Logistic Regression
-baseline classification model
model = LogisticRegression()
classifiers come with a .predict_proba, which gives the predicted probability of both outcomes
so .predict will give you the models answer, and .predict_proba will give you the reason behind the answer
.score returns accuracy in classifiers... |
PHP | UTF-8 | 3,614 | 2.53125 | 3 | [] | no_license | <?php
/**
* Created by IntelliJ IDEA.
* User: Bill
* Date: 8/02/2016
* Time: 11:02 AM
* Code to communicate with the RESTfm service to connect to FM and query if any meta records are incomplete
* (answers field is empty or null) using Value_Required_Failed_cn field of [WEB] Project Meta Fields layout
*/
include... |
Markdown | UTF-8 | 1,015 | 3.046875 | 3 | [] | no_license | # Events and event handlers
- 자바스크립트는 html, css 변경 외에도 이벤트에 반응하기 위해 만들어짐
- click, resize, submit, before, 등등
```
const title = document.querySelector("#title");
function handleResize(){
console.log("I have been resized")
}
window.addEventListener("resize", handleResize);
```
- 자바스크립트는 코드에서 명시한 이벤트를 받기 위해 대기하고 ... |
JavaScript | UTF-8 | 1,701 | 2.8125 | 3 | [] | no_license | import { useState, useEffect } from "react";
import { v4 as uuidv4 } from "uuid";
import Item from "./components/Item";
import Spinner from "./components/Spinner";
function App() {
const [items, setItems] = useState([]);
const [newitem, setNewItem] = useState({
id: uuidv4(),
title: "",
});
const getit... |
Go | UTF-8 | 1,218 | 3.359375 | 3 | [] | no_license | package algorithms
import "sort"
func twoSum(nums []int, target int) []int {
numSorted := make([]int, len(nums))
for i, num := range nums {
numSorted[i] = num
}
sort.Ints(numSorted)
numFirst, numSec := 0, 0
found := false
for i, num := range numSorted {
if num < 0 {
if numSorted[len(numSorted)-1] > tar... |
C# | UTF-8 | 1,865 | 3.703125 | 4 | [] | no_license | using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DayOfTheProgrammer
{
class Program
{
static void Main(string[] args)
{
int year = 2017;
string date = dayOfProgramme... |
Ruby | UTF-8 | 5,487 | 2.90625 | 3 | [
"MIT",
"Ruby"
] | permissive | # frozen_string_literal: true
require "active_model/validations/resolve_value"
module ActiveModel
module Validations
class LengthValidator < EachValidator # :nodoc:
include ResolveValue
MESSAGES = { is: :wrong_length, minimum: :too_short, maximum: :too_long }.freeze
CHECKS = { is: :==, mi... |
C++ | UTF-8 | 10,241 | 2.65625 | 3 | [] | no_license | #include <digitalWriteFast.h>
#include <eRCaGuy_Timer2_Counter.h>
#include <Servo.h>
// ==============================
// CONSTANTS
// ==============================
#define DEBUG 1
#define NR_CHANNEL_LIST 5
#define MIN_ANGLE_DIFF 2
// Channel threshold values for joysticks and toggle switches
#define CH... |
PHP | UTF-8 | 1,646 | 2.59375 | 3 | [] | no_license | <?php
/**
* 微博热度趋势
*/
class WeiboTrendAction extends CAction {
public function run($period, $id) {
if (! in_array ( $period, array (
'24',
'48',
'week'
) )) {
header ( 'Content-type: application/json' );
echo json_encode ( array (
'error' => '参数错误'
) );
return;
}
$end_date = da... |
JavaScript | UTF-8 | 4,506 | 2.921875 | 3 | [] | no_license | function addWelcomeTab(){
if (window.localStorage.length == 0) {
let welcome = {
title : 'Welcome!',
text : `Each project you create will have it's own tab! You can add projects by clicking the green plus at the top! Each project can
have its own tasks to ... |
Python | UTF-8 | 651 | 2.65625 | 3 | [] | no_license | import consts
import glob, os
from docx2pdf import convert
import time
import document
if __name__ == '__main__':
# update_player_data() # call every once in a while to keep this up to date
filename = 'week' + str(consts.WEEK()) + 'results'
print("Removing any previous files")
for f in glob.glob("*.do... |
PHP | UTF-8 | 535 | 2.546875 | 3 | [] | no_license | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<?php
try {
$bdd = new PDO('mysql:host=localhost:3307;dbname=... |
Python | UTF-8 | 360 | 2.546875 | 3 | [] | no_license | import requests
from m5stack import lcd
r = requests.get('http://www.example.com')
def test_requests_http_example():
r = requests.get('http://www.example.com')
if (r[0] != 200):
lcd.print('error found during fetching www.example.com with requests lib\n')
else:
lcd.print('test request to www.example.com... |
Shell | UTF-8 | 848 | 2.640625 | 3 | [] | no_license | #!/bin/bash
cd /var/lib/jenkins/jobs/Caramel/jobs/
cd "AM traffic Test Suits"
cd builds
buildnumber=$(echo `ls -lrt | grep lastSuccessfulBuild | cut -d" " -f14`)
cd $buildnumber
rm -rf /home/jenkins/testcase/AmTrafficReport
grep -n "tests total\|test total" log | cut -d":" -f1 > /home/jenkins/testcase/file3
for i in ... |
C# | UTF-8 | 10,468 | 3.09375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DBLibrary.DAO;
using DBLibrary.Entities;
namespace GamesLibrary.ConnectFour
{
/// <summary>
/// Handles the logic and the validation for the game.
/// </su... |
Swift | UTF-8 | 1,776 | 2.84375 | 3 | [] | no_license | // ViewController.swift
// UnitTesting-PowerPlant
// Created by Eric Widjaja on 3/10/20.
// Copyright © 2020 EricW. All rights reserved.
import UIKit
class ViewController: UIViewController {
//MARK: - IBOutlet
@IBOutlet weak var powerPlantTableView: UITableView!
//MARK: - Internal Varia... |
Java | UTF-8 | 8,815 | 2.125 | 2 | [
"curl",
"BSD-3-Clause",
"OpenSSL",
"MIT",
"LicenseRef-scancode-openssl",
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-ssleay-windows",
"JSON",
"LicenseRef-scancode-unknown-license-reference",
"ISC",
"BSL-1.0",
"blessing",
"Apache-2.0",
"NCSA",
"BSD-2-Clause",
"Libpng... | permissive | package com.mapabc.mapabcsdk.service.request;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.os.Handler;
import android.os.Looper;
import android.support.annotation.Keep;
import android.support.... |
Shell | UTF-8 | 636 | 2.90625 | 3 | [
"Apache-2.0"
] | permissive | #!/bin/bash
curl -s "https://api.github.com/repos/kubernetes/kubernetes/tags?page=1&per_page=100" |grep name |grep -v '-' |grep -v v0. |awk -F '"' '{print $4}' > ./k8s-version-new.txt
i=2
while (($i != 0)); do
kversion=`curl -s "https://api.github.com/repos/kubernetes/kubernetes/tags?page=${i}&per_page=100" |grep nam... |
C++ | UTF-8 | 668 | 3.171875 | 3 | [] | no_license | //This file also starts out empty.
//Implement the Turtle class here.
#include "turtle.h"
#include <iostream>
#include <cmath>
using namespace std;
Turtle::Turtle(double x0, double y0, double dir0)
{
x1 = x0;
y1 = y0;
dir = dir0;
color = draw::BLACK;
tra = 0;
}
void Turtle::move(double dist)
{
double x2 = x1 ... |
C | UTF-8 | 16,355 | 2.65625 | 3 | [] | no_license | #include "lf_hashmap.h"
atom_t hash_new(struct hash **h, int nbpow) {
int bucket_max = ((unsigned long) 1 << nbpow);
unsigned long bucket_mask = (unsigned long) bucket_max - 1;
*h = (struct hash *) aligned_malloc(sizeof(struct hash), LF_ALIGN_DOUBLE_POINTER);
if (*h != NULL) {
if (!init_hash_ta... |
Java | UTF-8 | 1,750 | 2.203125 | 2 | [
"Apache-2.0"
] | permissive | package com.huaweicloud.sdk.aom.v2.model;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Objects;
/**
* Request Object
*/
public class ShowActionRuleRequest {
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "rule... |
Python | UTF-8 | 233 | 3.3125 | 3 | [] | no_license | #!/usr/bin/python3
"""Determinant
is a scalar representation of the volume of the matrix"""
import numpy as np
from numpy.linalg import det
A = np.array([
[1, 2, 3],
[4, 5, 6],
[7, 8, 9]
])
print(A)
B = det(A)
print(B)
|
Markdown | UTF-8 | 3,581 | 2.765625 | 3 | [] | no_license | CFT2018 contest: исправление опечаток
==========================================
Материалы к соревнованию по исправлению опечаток [CFT2018 contest](https://datasouls.com/c/cft-contest/).
## Описание задачи
CFT2018 — соревнование по определению корректности введённых пользователями ФИО и исправлению опечаток в них. С... |
Java | UTF-8 | 429 | 2.25 | 2 | [] | no_license | package com.Interface.live;
import com.Interface.music.Playable;
import com.Interface.music.string.Veena;
import com.Interface.music.wind.SaxaPhone;
public class Main {
public static void main(String[] args) {
Playable veena = new Veena();
Playable saxaPhone = new SaxaPhone();
veena.play... |
Go | UTF-8 | 1,126 | 2.859375 | 3 | [] | no_license | package atypes
type AFloat32 []float32
func (ai AFloat32) Len() int { return len(ai) }
func (ai AFloat32) Less(i, j int) bool { return ai[i] < ai[j] }
func (ai AFloat32) Swap(i, j int) { ai[i], ai[j] = ai[j], ai[i] }
func (ai AFloat32) Get(i int) interface{} { return ai[i] }
func (ai AFloat32) LessD(i, ... |
Python | UTF-8 | 787 | 3 | 3 | [] | no_license | class Solution:
def jump(self, nums: List[int]) -> int:
"""
First solution: O(N^2) time, O(N) space
"""
jumps = [float('inf')] * len(nums)
jumps[0] = 0
for i, n in enumerate(nums):
for j in range(1, n+1):
if i+j < len(nums):
... |
TypeScript | UTF-8 | 568 | 2.53125 | 3 | [] | no_license | import mongoose, { Schema, Document } from "mongoose";
import { UserI } from './User';
import { ProductI } from './Product';
export interface CartI extends Document {
owner: UserI;
products: any[];
timestamp: Date;
}
const CartSchema = new Schema({
owner: {
type: mongoose.Schema.Types.ObjectId... |
C# | UTF-8 | 832 | 3.4375 | 3 | [] | no_license | // Javier Benajes
// Dates for every 7 days
using System;
using System.IO;
class Fechas7dias
{
public static void Main()
{
StreamWriter fichero = File.CreateText("tasks.txt");
DateTime fecha = DateTime.Now;
string[] meses = { "enero", "febrero", "marzo", "abril",
"mayo",... |
Python | UTF-8 | 995 | 2.984375 | 3 | [] | no_license | import unittest
from algo.sort.heap_sort import HeapSortContainer
from visualization.console.utils.colors.sort_color_collection import \
SortColorCollection
class TestHeapSortContainer(unittest.TestCase):
"""unit tests for heap sort container"""
def setUp(self):
"""setUp is overridden and is nee... |
TypeScript | UTF-8 | 1,029 | 3.921875 | 4 | [] | no_license | /* 29
타입스크립트에는 unknown 타입도 있다.
unknown 타입은 아직 정해지지 않았다는 의미로, any 타입과 비슷하게 어떤 타입이든 할당할 수 있지만,
다른 타입의 변수에 할당할 때 에러를 발생시킨다는 점이 다르다.
any를 쓰는 것보다 unknown을 쓰는게 조금 더 타입을 확실하게 결정하는 방법이고
나중에 타입체크를 하면서 사용하면 된다.
*/
let unknownVar: unknown;
let anyVar: any;
let stringVar: string;
stringVar = anyVar; // no error
// stringVar = unk... |
Java | UTF-8 | 574 | 1.546875 | 2 | [] | no_license | package com.tencent.qcloud.presentation.viewfeatures;
import com.tencent.TIMFriendGroup;
import com.tencent.TIMUserProfile;
import java.util.List;
/**
* @author wangjingwei
* @version 1.0.0
* @date 18/04/11
*/
public interface MyFriendGroupInfo extends MvpView {
/**
* 我的群列表
* @param timFriendGroups... |
Markdown | UTF-8 | 925 | 2.625 | 3 | [] | no_license | # Proof – Ackermann majorises all Primitive Recursive (PR) functions
This proof is done in NASA PVS and more or less follows the proofs listed below. This proof was done for the class programming verification at University of Applied Sciences Leipzig.
- [Ackermann Function – George Tourlakis](http://www.cs.yorku.ca/~... |
C | UTF-8 | 2,957 | 2.671875 | 3 | [] | no_license | #include "performance.h"
#include "socket.h"
#include "log.h"
p_per_ctx p_ctx;
void p_init_bandwidth(struct p_bandwidth *p) {
p->bytes = 0;
p->kbytes = 0;
p->mbytes = 0;
p->gbytes = 0;
}
void p_get_time_now(struct timeval *time_val) {
gettimeofday(time_val, NULL);
}
void * p_func(void *args) {
... |
C++ | UTF-8 | 2,927 | 3.6875 | 4 | [] | no_license | #include<iostream>
#include<string>
#include<vector>
#include<queue>
using namespace std;
struct TreeNode {
int val;
struct TreeNode * left;
struct TreeNode * right;
TreeNode (int x) : val(x), left(NULL), right(NULL) {}
};
class Codec {
public:
//the leetcode way of serialization
//ref:https://leetcode.com/... |
PHP | UTF-8 | 2,004 | 2.84375 | 3 | [] | no_license | <?php
namespace Leon\Controller;
use InvalidArgumentException;
use Leon\Response\HTMLResponse;
use ReflectionClass;
/**
* @author Nick Wakeman <nick@thehiredgun.tech>
* @since 2016-10-09
*
* @todo save request if not logged in,
* @todo then upon login resubmit their request
* @todo add twig function to get ro... |
Java | UTF-8 | 3,928 | 2.53125 | 3 | [] | no_license | package cl.laPalmera.Manejador;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.ArrayList;
import org.apache.log4j.Logger;
import cl.laPalmera.DTO.FuncionarioDTO;
import cl.laPalmera.connection.ConnectionLaPalmera;
public class ManejadorFuncionario {
... |
C | UTF-8 | 2,424 | 3.5625 | 4 | [] | no_license | //###############################################################################
/**
Liefert eine neue Matrix als Ergebnis aus der Addition zweier gegebener
quadratischer Matrizen
@param matrix1 Erste Matrix
@param matrix2 Zweite Matrix
@param dimension Anzahl Zeilen/Spalten der Matriz... |
TypeScript | UTF-8 | 438 | 2.609375 | 3 | [] | no_license | import axios, { AxiosResponse } from "axios"
import { User } from "src/domain/models/GitHub"
const BASE_URL = "https://api.github.com"
type CallGetMembersRequest = {
organizationName: string
}
export type CallGetMembersResponse = AxiosResponse<User[]>
export const callGetMembers = (
params: CallGetMembersReques... |
C# | UTF-8 | 586 | 3.40625 | 3 | [] | no_license | using System.Collections.Generic;
namespace CollectionHirahy
{
class MyList : IAddable, IRemoveable, IUseable
{
public Stack<string> Collection { get; set; }
public int Count { get ; set ; }
public MyList()
{
Collection = new Stack<string>();
Count = 0;... |
Java | UTF-8 | 1,826 | 2.546875 | 3 | [] | no_license | package com.github.wally.wcdbsample.util;
import android.content.Context;
import com.tencent.wcdb.database.SQLiteDatabase;
import com.tencent.wcdb.database.SQLiteOpenHelper;
import java.io.File;
import java.nio.charset.Charset;
/**
* Package: com.github.wally.wcdb_sample.util
* FileName: SimpleDBHelper
* Date: o... |
Java | UTF-8 | 3,866 | 2.3125 | 2 | [] | no_license | package com.example.drawer;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.View;
import android.widget.Toast;
import com.github.paolorotolo.appintro.AppIntro2;
import com.gi... |
Markdown | UTF-8 | 5,016 | 3.734375 | 4 | [] | no_license | # -Kaggle-Traveling-Santa-2018---Prime-Paths
This repository includes the codes I wrote for the titled competition on Kaggle.
>Link to competition: https://www.kaggle.com/c/traveling-santa-2018-prime-paths <br>
The core of the approach is **ACO (Ant Colony Optimization)**.
> For details, we refer the readers to http... |
PHP | UTF-8 | 1,057 | 2.828125 | 3 | [] | no_license | <?php
namespace Cube\CoreBundle\Form\Model;
class Register
{
private $username;
private $email;
private $plainPassword;
/**
* @return mixed
*/
public function getUsername()
{
return $this->username;
}
/**
* @param mixed $username
* @return Register
... |
Python | UTF-8 | 2,093 | 2.8125 | 3 | [] | no_license | from torch.nn import functional as F
from torch import nn
import torch
from math import sqrt
def hidden_layer_init(layer):
fan_in = layer.weight.data.size(0)
limit = 1 / sqrt(fan_in)
return -limit, limit
class Actor(nn.Module):
def __init__(self, observation_size, action_size, seed, fc1_units=400, ... |
Java | UTF-8 | 4,530 | 2.25 | 2 | [] | no_license | package com.techology.controller;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
imp... |
C++ | UTF-8 | 202 | 2.5625 | 3 | [] | no_license | #include<iostream>
#include"List.h"
using namespace std;
void main()
{
List a;
a.print();
a.add(7);
a.insert(2, 1000);
a.remove(3);
cout << '\n';
List b;
a = b;
a.print();
system("pause");
} |
TypeScript | UTF-8 | 1,232 | 2.546875 | 3 | [
"MIT"
] | permissive | import { Injectable } from '@nestjs/common';
import { UserRepository } from '../repositories/userRepository';
import { CreateUserDto } from '../dto/create-user.dto';
import { UserDto } from '../dto/user.dto';
import { ApplicationException } from '../common/exceptions/application.exception';
import { ResponseModel } fro... |
C# | UTF-8 | 2,705 | 2.625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using chefs_dishes.Models;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Http;
using Microsoft.EntityFrameworkCore;
namespace chefs_dishes.Contro... |
Python | UTF-8 | 355 | 2.765625 | 3 | [] | no_license | from abc import ABC, abstractmethod
class Split(ABC):
def __init__(self, user):
self.user = user
self.amount = 0
def getUser(self):
return self.user
def setUser(self, user):
self.user = user
def getAmount(self):
return self.amount
def setAmount(self, amo... |
Java | UTF-8 | 5,392 | 2.265625 | 2 | [] | no_license | package fw.supernacho.ru.foxweather.recyclers;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import java.text.DateFormat;
i... |
Python | UTF-8 | 1,278 | 3.296875 | 3 | [] | no_license | from pathlib import Path
original_inputs = list(map(int, (Path(__file__).parent / 'day2.input').read_text().split(',')))
inputs = original_inputs.copy()
inputs[1] = 12 # + 900000
inputs[2] = 2 # + 1
# part 1
def run_ops():
for op_idx in range(int(len(inputs)/4)):
if inputs[op_idx * 4] == 99:
... |
Python | UTF-8 | 5,538 | 3.296875 | 3 | [] | no_license | import psycopg2
import logging # will allow you to track what happens in the application, and identify problems with the code
import argparse
import sys
# set the log output file, and the log level
logging.basicConfig(filename="snippets.log", level=logging.DEBUG)
logging.debug("Connecting to PostgreSQL")
# connect to... |
JavaScript | UTF-8 | 3,291 | 3.046875 | 3 | [
"BSD-2-Clause"
] | permissive | // Copyright (c) Microsoft Corporation
// All rights reserved.
// BSD License
//
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
// following conditions are met:
//
// Redistributions of source code must retain the above copyright notice, this list of... |
Java | UTF-8 | 503 | 2.015625 | 2 | [] | no_license | package com.proj.emi.model.base;
public class InBody {
private String result; // result
private String description;// description
public String getResult() {
return result;
}
public InBody setResult(String result) {
this.result = result;
return this;
}
public Str... |
Java | UTF-8 | 1,293 | 2.125 | 2 | [] | no_license | package com.capgemini.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.capgemini.entities.ServiceRequest;
import com.capgemini.entities.ServiceRequestDetail;
import com.capgemini.repository.ServiceRequestDetailRepository;
import com.capg... |
Python | UTF-8 | 953 | 3.015625 | 3 | [] | no_license | from Date import Date
from card import Card
class VipCard(Card):
# Gọi tới constructor của lớp cha (card)
def __init__(self, userID, userName, lastDate, allMoney):
self.userID = userID
self.userName = userName
self.firstDate = Date(1,2,2020)
self.lastDate = lastDate
sel... |
C# | UTF-8 | 36,819 | 2.515625 | 3 | [
"MIT"
] | permissive | // Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
//
#pragma warning disable 0162
#pragma warning disable 0429
using System;
using System.Linq;
using System.Xml;
using System.IO;
using System.Reflection;
using Syste... |
Java | UTF-8 | 713 | 3.59375 | 4 | [] | no_license | public class Animal{
private String nombre;
private String lugarOrigen;
private String color;
public Animal(){}
public Animal(String nombre, String lugarOrigen, String color){
this.nombre = nombre;
this.lugarOrigen = lugarOrigen;
this.color = color;
}
public void hacerSonido(String sonido){... |
TypeScript | UTF-8 | 854 | 2.765625 | 3 | [
"WTFPL"
] | permissive | import mongoose from "mongoose";
// User typings
export type UserDocument = mongoose.Document & {
first_name: string,
last_name: string,
email: string,
sex: number,
city: {
id: number,
title: string,
}
country: {
id: number,
title: string,
}
photo_100... |
Markdown | UTF-8 | 1,072 | 2.875 | 3 | [
"MIT"
] | permissive | ### Project Overview
**Problem Statement**
Dream Housing Finance Inc. specializes in home loans across different market segments - rural, urban and semi-urban.
Their loan eligibility process is based on customer details provided while filling an online application form.
To create a targeted marketing campaign for ... |
Markdown | UTF-8 | 959 | 3.3125 | 3 | [] | no_license | ## 백준 14670 - [병약한 영정](https://www.acmicpc.net/problem/14670)
### 풀이법
1. 배열을 이용하여 약과 증상을 표시.
```JAVA
int[] drug = new int[101];
Arrays.fill(drug, -1);
for (int i = 0; i < n; i++) {
st = new StringTokenizer(br.readLine());
int effect = Integer.parseInt(st.nextToken());
int name = Integer.parseInt(st.nextT... |
C++ | WINDOWS-1250 | 2,007 | 2.765625 | 3 | [] | no_license | #include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#define __CL_ENABLE_EXCEPTIONS
#include <CL\cl.hpp>
#include "defines.hpp"
#include "CamShift.hpp"
using namespace cv;
using namespace std;
int main() {
try {
cvNamedWindow("main"... |
Java | UTF-8 | 933 | 3.546875 | 4 | [] | no_license | import java.io.*;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
while(true) {
String line = reader.readLine();
if(line.trim().equals("")) {
continue;
//line = reader.re... |
Markdown | UTF-8 | 21,232 | 2.765625 | 3 | [
"MIT"
] | permissive | # Setting Up a Local Mirror for Composer Packages With Satis
by Patkos Csaba 28 Jan
Installing all your PHP libraries with Composer is a great way to save time. But larger projects automatically tested and run at each commit to your software version control (SVC) system will take a long time to install all the requir... |
JavaScript | UTF-8 | 2,276 | 2.71875 | 3 | [] | no_license | import Job from "../../models/job.js";
import JobService from "./job-service.js";
let _jobService = new JobService
export default class JobController {
constructor() {
}
showJobsButton() {
_jobService.getJobs(this.showJobs)
}
showJobs() {
console.log('about to show some Jobs')
let jobs = _jobS... |
Java | UTF-8 | 121 | 1.914063 | 2 | [] | no_license | package com.highcrit.ffacheckers.domain.communication.objects;
public interface Event {
String getEventName();
}
|
Go | UTF-8 | 942 | 2.96875 | 3 | [] | no_license | package main
/*
* @lc app=leetcode.cn id=1406 lang=golang
*
* [1406] 石子游戏 III
*/
// @lc code=start
func stoneGameIII(stoneValue []int) string {
prefixSum := make([]int, len(stoneValue))
// aScore := 0
// bScore := 0
for i, v := range stoneValue {
if i == 0 {
prefixSum[i] = v
} else {
prefixSum[i] = ... |
Java | WINDOWS-1252 | 3,442 | 1.898438 | 2 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0",
"BSD-3-Clause",
"LicenseRef-scancode-generic-cla",
"LicenseRef-scancode-other-permissive",
"MIT",
"CDDL-1.1",
"LicenseRef-scancode-public-domain"
] | permissive | /*
* Copyright IBM Corp. 2010
*
* 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 applicable law or agreed t... |
Java | UTF-8 | 739 | 1.90625 | 2 | [] | no_license | package com.airplane.db.service;
import java.util.List;
import com.airplane.db.dto.FlightDTO;
import com.airplane.db.dto.PaymentDTO;
import com.airplane.db.dto.TicketDTO;
public interface TicketService {
public List<TicketDTO> listAllCTickets(String email);
public List<TicketDTO> listAllfCTickets(String email)... |
Java | UTF-8 | 244 | 1.546875 | 2 | [] | no_license | package net.ajcloud.wansviewplusw.support.http.bean;
import java.util.List;
/**
* Created by mamengchao on 2018/07/11.
* Function: 报警列表
*/
public class AlarmListBean {
public List<AlarmBean> alarms;
public String cts;
}
|
Java | UTF-8 | 825 | 2.296875 | 2 | [] | no_license | package ca.uqtr.dmi.inf1013.services.impl;
import ca.uqtr.dmi.inf1013.model.EducationLevel;
import ca.uqtr.dmi.inf1013.repos.EducationLevelRepo;
import ca.uqtr.dmi.inf1013.services.EducationLevelService;
import org.springframework.stereotype.Service;
import java.util.Optional;
@Service
public class EducationLevelSer... |
Python | UTF-8 | 3,447 | 2.984375 | 3 | [] | no_license | import re
from PIL import Image
class PhoneLinker:
mobile_operator_codes = (
'700', '701', '702', '705', '707', '708', '712', '713', '717', '718', '721', '725', '726', '778',
'727', '747', '750', '751', '760', '761', '762', '763', '764', '771', '775', '776', '777',
)
regex_str = '|'.join... |
Markdown | UTF-8 | 5,479 | 3.03125 | 3 | [] | no_license | % 金融工学
%
%
$$
\newcommand{\unit}[1]{[\mathrm{#1}]}
$$
## 債券とは
素朴な意味での債券とは,お金を貸したときに返済を約束する証書.
しかし,現代の金融市場においては,それ以上の意味がある.
- 債券を発効してお金を生み出す
- 債券の発行者は,自分の信用をもとにお金を得ることができる
- キャッシュフローを受ける権利
- 債券を買った人は債券に書かれている返済計画にのっとって,返済金を受け取ることができる
- 買う側はこのキャッシュフロー(いついくら貰えるか)を額面と比較して判断する
キャッシュフローをどう評価すればいいか?
## キャッシュフロー
... |
Java | UTF-8 | 2,781 | 2.578125 | 3 | [] | no_license | package com.javafx.windows;
import java.io.File;
import java.util.logging.Level;
import java.util.logging.Logger;
import example_TextReading.ExtractDocxDocument;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javaf... |
Python | UTF-8 | 1,985 | 2.78125 | 3 | [
"BSD-2-Clause-Views"
] | permissive | from bbcode import *
import re
class Center(BlockReplaceTagNode):
"""
Centers text.
Usage:
[code lang=bbdocs linenos=0][center]Text[/center][/code]
"""
verbose_name = 'Center Text'
open_pattern = re.compile(patterns.no_argument % 'center')
close_pattern = re.compile(patterns.... |
Java | UTF-8 | 1,394 | 3.5625 | 4 | [] | no_license | import java.util.Scanner;
/**
* Se quiere realizar un programa que lea por teclado las 5 notas obtenidas por un alumno (comprendidas
* entre 0 y 10). A continuación debe mostrar todas las notas, la nota media, la nota más alta que ha
* sacado y la menor.
*/
public class ProMaMiV { //PROMEDIO,MAXIMO,MINIM... |
Markdown | UTF-8 | 1,431 | 2.96875 | 3 | [] | no_license | # Slack Backend API
A backend application modeled after Slack, a communication platform for organizations. This application implements Workspapces, Users, Channels, Threads, Direct Messaging, and Images.
- **Workspaces**: A workspace is where on organization and its members be organized on and is made up of channels.... |
Python | UTF-8 | 55 | 2.984375 | 3 | [
"MIT"
] | permissive | import math
print(math.sin(1))
print(math.cos(1))
|
JavaScript | UTF-8 | 31,136 | 2.71875 | 3 | [] | no_license | /**
* -- jasTools js工具对象
* -- @GF created on 2019/1/21
*
* ---- jasTools.base 基础操作方法
* ------ jasTools.base.createuuid 创建uuid
* ------ jasTools.base.extend 对象继承
* ------ jasTools.base.rootPath 服务器路径中的项目名称
* ------ jasTools.base.setAppId 设置appId
* ------ jasTools.base.getAppid 获取appId
* ------ jasTools.base.ge... |
C | UTF-8 | 498 | 3.78125 | 4 | [
"MIT"
] | permissive | /*
* @Param
* int number
* findComplement:
* Given a positive integer, output its complement number.
* @Return
* int
* Returns the complement (on bits) of the given number
* References:
* Bitwise operators -> https://en.wikipedia.org/wiki/Bitwise_operations_in_C
* Explenation:
* The complement number is th... |
Ruby | UTF-8 | 4,309 | 2.5625 | 3 | [
"MIT",
"CC-BY-SA-4.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | # frozen_string_literal: true
module RuboCop
module CodeReuseHelpers
# Returns true for a `(send const ...)` node.
def send_to_constant?(node)
node.type == :send && node.children&.first&.type == :const
end
# Returns `true` if the name of the receiving constant ends with a given
# `String`.... |
C | UTF-8 | 552 | 3.359375 | 3 | [] | no_license | // find digits problem
// https://www.hackerrank.com/challenges/find-digits/problem?isFullScreen=false&h_r=next-challenge&h_v=zen
int findDigits(int n) {
int count =0;
int rem=0, num =0;
num = n;
while(n>0){
rem = n%10;
//printf("\n %d", rem);
//handle the arithmetic exception in case rem =... |
C | UTF-8 | 9,094 | 3.15625 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <getopt.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <limits.h>
#include <omp.h>
#include <math.h>
#define FILENAME "cells"
#define MAX_DISTANCES 3466 //number of max distances since values are between -10 and 10 (00,00 .... 34,65)
#def... |
Shell | UTF-8 | 2,441 | 2.859375 | 3 | [] | no_license | #!/bin/sh -x
# 以下脚本文件用在服务器端,对于OPENVPN客户端的下载流量进行限速(即服务器端出流量),带宽单位为kbits/s
#定义链路带宽
LinkCeilDownSpeed=30000 #链路最大下载带宽
LinkCeilUploadSpeed=30000 #链路最大上传带宽
LinkRateDownSpeed=6000 #链路保障下载带宽
LinkRateUploadSpeed=6000 #链路保障上传带宽
#定义VPN 用户的最大带宽和保障带宽
UserCeilDownSpeed=6000 #特殊用户最大下载带宽... |
Ruby | UTF-8 | 113 | 2.671875 | 3 | [] | no_license | s = 'abc'
puts s.public_methods.inspect
# https://docs.ruby-lang.org/en/2.6.0/Object.html#method-i-public_method |
Markdown | UTF-8 | 1,896 | 2.75 | 3 | [
"Apache-2.0"
] | permissive | # 升级 JuiceFS CSI Driver
## CSI Driver v0.10 及以上版本
JuiceFS CSI Driver 从 v0.10.0 开始将 JuiceFS 客户端与 CSI Driver 进行了分离,升级 CSI Driver 将不会影响已存在的 PV。如果你使用的是 CSI Driver v0.10.0 及以上的版本,执行以下命令进行升级:
* 如果您使用的是 `nightly` 标签,只需运行 `kubectl rollout restart -f k8s.yaml` 并确保重启 `juicefs-csi-controller` 和 `juicefs-csi-node` pod。
* 如果您已固定... |
Markdown | UTF-8 | 762 | 2.75 | 3 | [] | no_license | # letsvote
This is a freecodecamp fullstack project. Detailed requirements see: https://www.freecodecamp.org/challenges/build-a-voting-app.
This implemented all the user stories. This can be further improved:
1) Only logged in user can vote, and each user can only vote once in a given poll
2) More smooth UIs, esp the... |
C# | UTF-8 | 1,717 | 3.046875 | 3 | [] | no_license | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Diagnostics;
namespace JUtil
{
public static class JUtils
{
// courtesy of http://answers.unity.com/answers/893984/view.html
public static T FindComponentInChildWithTag<T>(this GameObject parent, string ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.