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 |
|---|---|---|---|---|---|---|---|
Shell | UTF-8 | 9,466 | 3.203125 | 3 | [] | no_license | #!/bin/bash -l
#-------------------------------------------------------------------------------
wkdir="$(cd "$( dirname "$0" )" && pwd)"
cd ${wkdir}
myname=$(basename "$0")
myname1=${myname%.*}
. admin.rc || exit $?
#-------------------------------------------------------------------------------
function unlock () ... |
C# | UTF-8 | 3,129 | 2.59375 | 3 | [] | no_license | using System.Collections.Generic;
using System.Linq;
using Teashop.Backend.Application.Commons.Models;
using Teashop.Backend.Domain.Product.Entities;
using Teashop.Backend.UI.Api.Product.Models;
namespace Teashop.Backend.UI.Api.Product.Mappings
{
public class ProductMapper
{
public PresentationalProdu... |
JavaScript | UTF-8 | 426 | 2.84375 | 3 | [] | no_license | import { DateTime } from 'luxon';
// Returns a formatted date based on time information and a format specifier
const formatDate = (timestamp, timezone, format) => {
const date = DateTime.fromSeconds(timestamp).setZone(timezone);
if (format in date) {
return date[format];
}
// if not found in date instanc... |
C++ | UTF-8 | 280 | 3.28125 | 3 | [] | no_license | #include "iostream.h"
class A {
int *p;
public:
A() { p = new int; }
int *G() { return p; }
void F(A &);
~A() {
cout << "Destruyendo...\n";
delete p;
}
};
void A::F(A &c) {
(*c.p)++;
}
main() {
A b;
int *q = b.G();
*q = 10;
b.F(b);
cout << *b.G() << endl;
}
|
Python | UTF-8 | 3,096 | 2.734375 | 3 | [] | no_license | # -*- coding: utf-8 -*-
import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.neighbors import KNeighborsClassifier
import matplotlib.pyplot as plt
import seaborn as sns
#% matplotlib inline
mydataset=pd.read_csv("city_... |
Markdown | UTF-8 | 2,474 | 2.921875 | 3 | [
"Apache-2.0"
] | permissive | # Proyecto Podcast
[Proyecto Podcast](https://ezeholz.github.io/Acamica/primerProyecto/) busca acaparar los conocimientos que aprendimos en la primera parte del curso con respecto a la maquetación en HTML utilizando CSS, o en mi caso SCSS
Fecha de inicio del trabajo: 07/11/19\
Fecha de entrega del trabajo: 19/12/19
... |
Java | UTF-8 | 1,650 | 3.078125 | 3 | [] | no_license | package buncoplus;
import framework.*;
/**
* Instancie les joueurs et les dés pour BuncoPlus.
*/
public class FabriqueBuncoplus extends Fabrique {
private final int NBRE_JOUEURS = 5;
private final int NBRE_DES = 3;
private static CollectionJoueurs collectionJoueurs;
private static CollectionDes col... |
Markdown | UTF-8 | 966 | 2.53125 | 3 | [] | no_license |
## Месяца того же в 18-й, память святых мучеников Платона и Романа
<*p. 97 / 296 / 295*>
Поется все, как и на всякий день: стихиры же и канон.
И читается тогда мучение святого Платона и похвала Златоуста о святом Романе.
---
*Подобает знать*, что в 9-ю неделю Евангелий от Луки, когда читается Евангелие, начало... |
Java | UTF-8 | 3,245 | 2.0625 | 2 | [] | no_license | package com.authright.happyPrime.config.appconfig;
import com.authright.happyPrime.config.propertyconfig.RestTemplatePropConfig;
import com.authright.happyPrime.handler.HttpClientResponseErrorHandler;
import com.google.common.collect.Lists;
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.... |
PHP | UTF-8 | 680 | 2.875 | 3 | [] | no_license | <?php
namespace App\Services\ItemsFormatter;
use App\Item;
use Illuminate\Database\Eloquent\Collection;
/**
* Formats items of the menu.
*
* @package App\Services\ItemsFormatter
*/
interface ItemsFormatter
{
/**
* Returns a nested array of items in the format specified by the task docs.
*
* @p... |
Markdown | UTF-8 | 1,807 | 2.671875 | 3 | [
"CC0-1.0"
] | permissive | ## Welcome to my learning notes pages.
各种markdown的笔记。
### Vue学习笔记
- [Vue技术要点笔记-快速入门](vue/Vue技术要点笔记-快速入门.md)
- [Vue技术要点笔记-组件](vue/Vue技术要点笔记-组件.md)
### Java学习笔记
- [69道Spring面试题和答案](java/69道Spring面试题和答案.md)
- [Spring Bean生命周期图](java/Spring%20Bean生命周期.png)
- [Spring AOP定义详解](java/Spring%20AOP定义详解.md)
- [java/spring... |
Java | UTF-8 | 8,457 | 2 | 2 | [] | no_license | package controllers;
import bussiness.licences.ILicencesService;
import bussiness.user.IActivateUserService;
import bussiness.user.ISaleDepartmentService;
import bussiness.user.IUserInfoService;
import bussiness.user.impl.UserInfoService;
import com.google.gson.reflect.TypeToken;
import models.iquantCommon.*;
import p... |
Python | UTF-8 | 135 | 3.390625 | 3 | [] | no_license | def faktoriyel(sayi):
if sayi==1:
return 1
else:
return sayi * faktoriyel(sayi-1)
print(faktoriyel(6)) |
Shell | UTF-8 | 2,611 | 3.40625 | 3 | [
"MIT"
] | permissive | #!/bin/bash
#
# GMT_Graph.sh
#
# Copyright 2011 Francisco Hernandez <FJHernandez89@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either... |
Java | UTF-8 | 828 | 2.8125 | 3 | [] | no_license | package model;
import java.math.BigInteger;
/**
*
* @author Admin
*/
public class ProductToCart {
private ProductWithMaterial productWithMaterial;
private int quantity;
public ProductToCart() {
}
public ProductWithMaterial getProductWithMaterial() {
return productWithMaterial;
}
... |
Python | UTF-8 | 1,901 | 3.0625 | 3 | [] | no_license | import csv
import datetime as dt
import sqlalchemy as db
from sqlalchemy.orm import sessionmaker
# импортируем классы Book и Base из файла database_setup.py
from database_setup import User, Author, Book, Base
engine = db.create_engine('postgresql+psycopg2://books:bNcO9ypR@192.168.1.120:5432/books')
# Свяжим engine с м... |
C# | UTF-8 | 1,471 | 2.640625 | 3 | [] | no_license | using SkiaSharp;
using SkiaSharp.Views.Forms;
using Xamarin.Forms;
namespace BottlesApp.Views
{
public partial class UserPage : ContentPage
{
public UserPage()
{
InitializeComponent();
}
private void OnCanvasViewPaintSurface(object sender, SKPaintSurfaceEventArgs a... |
JavaScript | UTF-8 | 551 | 2.578125 | 3 | [] | no_license | // simple server
'use strict';
const http = require('http');
const fs = require('fs');
const port = 8080;
const path = require('path');
const getContent = (req, res) => {
let url;
if (req.url === '/' || req.url === '/index.html')
url = 'index.html';
else if (req.url === '/js/main.js')
u... |
TypeScript | UTF-8 | 414 | 3.046875 | 3 | [] | no_license | export enum Pawns {
pawn = "PAWN",
rook = "ROOK",
knight = "KNIGHT",
king = "KING",
queen = "QUEEN",
bishop = "BISHOP",
}
export interface Cell {
player?: Turn;
taken: boolean;
pawn: Pawns | null;
id: number;
}
export type Grid = Cell[];
export type State = {
grid: Grid;
gameResult: null | st... |
JavaScript | UTF-8 | 360 | 3.3125 | 3 | [] | no_license | function addStuff() {
var add = 2+2;
document.getElementById("math").innerHTML = "It's " + add + "!";
}
function subStuff() {
var subtract = 8-3;
document.getElementById("math").innerHTML = subtract;
}
function modStuff() {
var modulus = 29%7;
document.getElementById("mod").innerHTML = -modul... |
Java | UTF-8 | 914 | 2.25 | 2 | [
"Apache-2.0"
] | permissive | package com.github.braisdom.objsql.sample.controllers;
import com.github.braisdom.objsql.sample.ResponseObject;
import com.github.braisdom.objsql.sample.model.Product;
import com.github.braisdom.objsql.sql.SQLSyntaxException;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bin... |
TypeScript | UTF-8 | 617 | 2.828125 | 3 | [] | no_license | import { v4 as uuidv4 } from 'uuid';
import { Id } from '@domainTypes/Id';
describe('Id type', () => {
it('create a new Id', () => {
const id = new Id;
expect(id.getValue()).toMatch(Id.validationRegex);
});
it('create a new id from uuid v4', () => {
const uuid = uuidv4();
const id = new Id(uuid);
exp... |
Markdown | UTF-8 | 2,385 | 3.53125 | 4 | [
"MIT"
] | permissive | # single_instance
`yba::single_instance` is a really small single-header library to assist
you in making a single-instance program.
This may be used for URL handlers, or application that needs to make sure only
one instance of it is running.
This library is compatible with Windows, and any UNIX platform supporinng... |
PHP | UTF-8 | 4,765 | 3.34375 | 3 | [] | no_license | <?php
class Post {
//DB stuff
private $conn;
private $table = 'post';
//post props
public $id;
public $title;
public $writer;
public $content;
public $published_date;
//constructor
public function __construct($db){
... |
Python | UTF-8 | 3,109 | 4 | 4 | [] | no_license | '''
Created on Mar 1, 2021
@author: rashmeade22
'''
one = 'Pick a number. 1, 4, 5, or 8: '
two = 'Pick a number. 2, 3, 7, or 9: '
def SecondNumber(first_number, color): # main code
first_number = int(first_number)
color = int(color)
if (color % 2) == 0 and (first_number % 2) == 0:
... |
Java | UTF-8 | 526 | 2.75 | 3 | [] | no_license | package com.shijin.learn.controller.dao;
public class Animal {
private int id;
private String name; //name
public Animal() {
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public ... |
Shell | UTF-8 | 3,976 | 3.90625 | 4 | [] | no_license | #!/bin/bash
GREEN='\033[0;32m'
RED='\033[0;31m'
BOLD='\033[1m'
DIM='\033[2m'
RESET='\033[0m'
# Check if the current folder contains .git folder and is active GIT repo
if [[ -z $(git rev-parse --is-inside-work-tree 2> /dev/null || false) ]]; then
echo -e "${RED}Your not in a GIT repository${RESET}"
exit 1;
fi
... |
Python | UTF-8 | 1,192 | 3.03125 | 3 | [] | no_license | #coding:utf-8
import pandas as pd
import numpy as np
#保存特征重要性
def feature_important(bst, filepath):
feature_score = bst.get_fscore()
feature_score = sorted(feature_score.items(), key=lambda x:x[1],reverse=True)
x1 = []
x2 = []
for (key,value) in feature_score:
x1.append(key)
... |
Markdown | UTF-8 | 2,182 | 2.609375 | 3 | [] | no_license | # [打个分] 常凯申同志泥潭各位打几分啊?
> tid: `21838621` 用户ID: `43242861` 发布时间: `2020-05-21 11:13:00`
> 毛主席定调七分功,三分过。那常凯申呢?我给打个三分功,七分过,应该很合理吧?
----------
> `2.楼` 用户ID: `12165189` 发布时间: `2020-05-21 11:14:00`
> 七三分你来了?
----------
> `3.楼` 用户ID: `43242861` 发布时间: `2020-05-21 11:14:00`
> <b>Reply to [pid=423699818,218386... |
Java | UTF-8 | 2,107 | 2.703125 | 3 | [] | no_license | package com.stewesho.ninjaboi;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.physics.box2d.Body;... |
Python | UTF-8 | 3,834 | 2.546875 | 3 | [] | no_license | import tensorflow as tf
#from tensorflow.keras.layers.experimental import preprocessing
import numpy as np
#for upscaling
#from tensorflow_examples.models.pix2pix import pix2pix
#from IPython.display import clear_output
import matplotlib.pyplot as plt
import cv2
#The second way to define a model... |
TypeScript | UTF-8 | 501 | 2.625 | 3 | [] | no_license | import {Category} from '../../categories/shared/category';
export class Location {
name: string;
address: string;
coordinates: string;
category: Category;
id: number;
private readonly locations: number[];
constructor(data: Partial<Location>) {
Object.assign(this, data);
this.id = new Date().getT... |
Java | UTF-8 | 2,185 | 2.328125 | 2 | [
"Apache-2.0"
] | permissive | package com.huaweicloud.sdk.dli.v1.model;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Objects;
/**
* Request Object
*/
public class ListResourcesRequest {
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "kind"... |
Markdown | UTF-8 | 988 | 2.609375 | 3 | [] | no_license | # Esame 2021/07/19 SPA
Questo documento serve a spiegare nel dettaglio come far partire l'applicativo
### Requisiti per il funzionamento dell'applicativo:
- `Node.js` scaricare ed installare da [Node.js](https://nodejs.org/). scaricare la versione `LTS` e seguire i passaggi per l'installazione.
- Scaricare json-serve... |
Java | UTF-8 | 6,863 | 2.0625 | 2 | [] | no_license | package com.hanglinpai.util;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.net.Uri;
import android.os.Build;
import android.util.Log;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
import com.hanglinpai.R;
i... |
JavaScript | UTF-8 | 1,604 | 2.96875 | 3 | [] | no_license | import React, {Component} from 'react';
import PropTypes from 'prop-types';
import NewsItem from './NewsItem';
import NewsForm from './NewsForm';
class News extends Component {
static propTypes = {
news: PropTypes.array.isRequired,
name: PropTypes.oneOfType([
PropTypes.number,
... |
JavaScript | UTF-8 | 10,462 | 2.75 | 3 | [] | no_license |
function GIF() {
this.width = 0;
this.height = 0;
this.nFrames = 0;
this.buffer = [];
this.version = "";
this.pos = 0; // Current Pos
this.fileSize = 0; // Stores the File Size
this.gloColTable = []; // Global Color Table
this.dictColor = {}; // Dictonary of colors with respective i... |
Swift | UTF-8 | 519 | 2.796875 | 3 | [] | no_license | //
// Secret.swift
// MarvelApp
//
// 17/04/2020.
//
//
import Foundation
import CryptoKit
struct Secret {
static private let privateKey = "23ec56ac540c405b94063afddc79bcda1fcac842"
static let publicKey = "ee77e6d97c8a8329dce2c8bff21d88c1"
static let ts = String(Date().timeIntervalSince1970)
... |
SQL | UTF-8 | 405 | 3.4375 | 3 | [] | no_license | -- Health Facts Diabetes, Dx + labs + meds
-- Only diagnostic ICD-9-CM codes (Volume 2).
-- Diabetes Codes: 250.*, includes Diabetes Mellitus type-1 and type-2
-- Here we select type-1 assuming "juvenile" is in all descriptions.
--
SELECT
dm.medication_id,
dm.generic_name,
dm.brand_name,
dm.ndc_code,
dm.route_desc... |
Java | UTF-8 | 1,094 | 2.53125 | 3 | [] | no_license | package ex.db2.product.domain;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import lombok.extern.slf4j.Slf4j;
import javax.persistence.*;
import java.util.Date;
@Slf4j
@Entity
@Getter
@ToString
@NoArgsConstructor
public class Product {
@Id
@GeneratedVa... |
Markdown | UTF-8 | 10,031 | 3.84375 | 4 | [
"Apache-2.0"
] | permissive | > ## 顺序容器概述
* string和vector将元素保存在连续的内存空间中,用下标计算地址非常快,但是在中间位置插入删除元素很耗时,因为在一次插入或删除后要移动插入或删除位置之后的所有元素,添加一个元素有时还需要分配额外的存储空间,此时每个元素都要移动到新的存储空间中
* list和forward_list在任何位置的插入删除都很快速,但不支持随机访问,只能遍历整个容器,与vector、deque和array相比这两个容器的额外开销也很大
* deque支持快速随机访问,在中间位置插入删除代价可能很高,但在两端很快,与list或forward_list相当
* 迭代器范围由一对迭代器begin、end表示,它们指向同一容器,... |
Markdown | UTF-8 | 4,323 | 3.40625 | 3 | [] | no_license | ## Assignment:
Please create a tool that can send shipment notifications as text messages. All of the functionality you create must be exposed through a single front-end interface. It must interact with back-end API’s to perform its functions.
The main flows to implement are:
- A user can choose a particular produc... |
C++ | UTF-8 | 2,277 | 2.75 | 3 | [] | no_license | #include "circle.h"
BBox Circle::object_bound() const
{
return BBox(Point3(-m_r,-m_r,0),Point3(m_r,m_r,0));
}
void Circle::copyToMesh(TriangleMesh* msh_)
{
double inR_ = m_r/(double)m_loops;
int loops_ = m_loops-1;
double deltaSlicesAng_ = 0.0174532925*(double)360.0/(double)m_slices;
double deltaR_ = (m_r-inR_)... |
Python | UTF-8 | 2,351 | 3.25 | 3 | [
"BSD-3-Clause"
] | permissive | # -*- coding: utf-8 -*-
neutral = [
#'Se abre el ascensor y hay un programador dentro, le preguntan: - Sube o baja? A lo que el programador responde: - Si.',
'Se abre el ascensor y hay un programador dentro, le preguntan: - Sube o baja? A lo que el programador responde: - Si.',
#'Que le dice un bit al otro... |
C++ | BIG5 | 233 | 2.6875 | 3 | [] | no_license | //arr_glo.cpp
#include <iostream.h> //cout
#include <conio.h> //getch()
int a[5]; //}Cܼ
void main()
{ for (int i=0;i<5;i++)
cout << a[i] << ' '; //CLa}C
cout << endl;
getch(); //Ȱ
}
|
Java | UTF-8 | 955 | 2.09375 | 2 | [] | no_license | package vip.pryun.dikas.admin.conf;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.co... |
Python | UTF-8 | 1,343 | 2.890625 | 3 | [] | no_license | import json
import sys
import time
#print(sys.argv)
if len(sys.argv) < 4:
print('Usage: python replace_id.py INPUT_JSON_FILE -sSTART_FRAME -eEND_FRAME')
print('Example: python replace_id.py ch5.json -s2703 -e3603')
exit()
for arg in sys.argv:
if arg.startswith('-s'):
start = int(arg[2:])
elif arg.s... |
PHP | UTF-8 | 609 | 2.546875 | 3 | [
"BSD-2-Clause"
] | permissive | <?php
$version['update_required'] = false;
function getCurrentVersion() {
global $settings;
$dbh = $settings->getDatabase();
$statement = $dbh->prepare('SELECT current FROM dbversion');
if ($statement && $statement->execute()) {
$result = $statement->fetch(PDO::FETCH_ASSOC);
return $result['current'];
} else... |
C++ | UTF-8 | 514 | 2.546875 | 3 | [] | no_license | /*
*Autor:Diego Silva
*Data:10/11/2018
*Descrição:Biblioteca para sensor RGB
* */
#ifndef SensorRGB_h
#define SensorRGB_h
#include <Arduino.h>
class SensorRGB{
public:
//declarando métodos de entra para seta portas
SensorRGB(int P1, int P2, int P3);
int getportA(void);
int getportB(void);
int getportC... |
Java | UTF-8 | 1,341 | 2.203125 | 2 | [] | no_license | package com.punjabivideostatus.latestsong.gettersetter;
public class Item_category {
String cid;
String category_name;
String category_image_thumb;
String language;
String type_layout;
public String getCid() {
return cid;
}
public void setCid(String cid) {
this.cid ... |
Python | UTF-8 | 571 | 2.71875 | 3 | [] | no_license | import pyodbc
def fetch_data():
conn = pyodbc.connect('DRIVER={SQL Server};SERVER=pocserver007.database.windows.net;DATABASE=POC;UID=demo;PWD=User@2021')
cursor = conn.cursor()
cursor.execute("SELECT * FROM dbo.Transactions")
for row in cursor.fet... |
Java | UTF-8 | 1,780 | 2.6875 | 3 | [] | no_license | package wangleijin;
import javax.swing.*;
import java.awt.*;
public class DisplayJFream extends JFrame {
private LeftJpanel leftJpanel;
private southJpanel southJpanel;
private northJpanel northJpanel;
private String sql = "SELECT goodsID AS 商品编号,type AS 类型,name AS 名称,price AS 价格,number AS 数量\n" +
... |
Markdown | UTF-8 | 7,578 | 3.453125 | 3 | [
"CC-BY-3.0",
"MIT"
] | permissive | ---
layout: default
title: Priority+ Navigation
name: NavPriority
description: Mobile navigation is often treated as show / hide only. Usability tests suggest that user experience can be improved by using a priority menu. NavPriority plugin adjust wide navigation to fit the viewport of any device.
---
### Bootstrap P... |
Java | UTF-8 | 1,432 | 2.859375 | 3 | [] | no_license | package lintcode._101_200._115;
public class Solution {
public int uniquePathsWithObstacles(int[][] obstacleGrid) {
// write your code
int rows = obstacleGrid.length;
if ( rows == 0 ) {
return 0;
}
int cols = obstacleGrid[0].length;
int[][] dp = new int[... |
Python | UTF-8 | 4,314 | 3.09375 | 3 | [] | no_license | from random import shuffle
# import os
import player
class Blackjack:
# Game Vars
__fresh_deck = []
__deck = []
__players = []
# Round vars
__pot = {}
__hands = {}
__totals = {}
def __init__(self, starting_score):
for i in range(1, 14):
if i == 1:
card = "A"
elif i == 11:
card = "J"
elif... |
Python | UTF-8 | 937 | 2.984375 | 3 | [] | no_license | __author__ = 'Kirby'
if __name__ == "__main__":
fr = open("A-large.in", "r")
fw = open("so2.out", "w")
T = int(fr.readline())
for i in range(1, T+1):
[Smax, S_vec] = fr.readline().split()
Smax = int(Smax)
S_vec = map(int, list(S_vec))
# General Algorithm:
# ... |
PHP | UTF-8 | 2,544 | 3.734375 | 4 | [] | no_license | <?php
function z1($a){
if ($a >= 0 && $a <= 100){
echo "liczba $a znajduje sie w przedziale 0-100 <br>";
}
else {
echo "liczba $a poza przedzialem <br>";
}
}
function z2($a){
if (($a >= 0 && $a <= 100) || ($a >= 200 && $a <= 1000)){
... |
Markdown | UTF-8 | 3,810 | 2.578125 | 3 | [
"CC-BY-4.0",
"MIT"
] | permissive | ---
title: Connect CEF data to Azure Sentinel Preview| Microsoft Docs
description: Learn how to connect CEF data to Azure Sentinel.
services: sentinel
documentationcenter: na
author: yelevin
manager: rkarlin
editor: ''
ms.service: azure-sentinel
ms.subservice: azure-sentinel
ms.devlang: na
ms.topic: conceptual
ms.tgt_... |
Java | UTF-8 | 1,152 | 2.078125 | 2 | [] | no_license | package com.codegym.services.impl;
import com.codegym.models.Payment;
import com.codegym.repositories.PaymentRepository;
import com.codegym.services.PaymentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Opt... |
Java | UTF-8 | 608 | 2.46875 | 2 | [] | no_license | package com.quickblox.task;
import com.quickblox.task.http.HttpServerFuture;
public class Main {
public static void main(String[] args) {
Server serverFuture = new HttpServerFuture();
if (args.length == 2 && args[0].equals("-p")) {
try {
serverFuture.setPort(Integer.pa... |
Python | UTF-8 | 3,831 | 2.734375 | 3 | [
"SunPro",
"BSD-2-Clause",
"MIT"
] | permissive | import functools
import textwrap
from typing import Any
from typing import Callable
from typing import Optional
from typing import TYPE_CHECKING
from typing import TypeVar
import warnings
from optuna.exceptions import ExperimentalWarning
if TYPE_CHECKING:
from typing_extensions import ParamSpec
FT = TypeVar... |
Python | UTF-8 | 4,170 | 2.921875 | 3 | [] | no_license | import numpy as np
import shared
import math
"""
Function to run problem one solution and generate the heat maps.
@param article_path: path to articles file
@param label_path: path to mapping of articles to groups
@param groups_path: path to file mapping of group ids to names
@param output_path: output perfix for heat... |
SQL | UTF-8 | 8,955 | 3.359375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version phpStudy 2014
-- http://www.phpmyadmin.net
--
-- 主机: localhost
-- 生成日期: 2019 年 02 月 24 日 15:13
-- 服务器版本: 5.5.53
-- PHP 版本: 5.4.45
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARA... |
C++ | UTF-8 | 934 | 3.4375 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
/**
* Record and retrieve name and scores.
*/
int main(){
vector<string> names;
vector<int> scores;
cout << "Enter name and score separated by space. Stop by entering: \"NoName 0\" \n";
int sc... |
C# | UTF-8 | 580 | 2.515625 | 3 | [
"MIT"
] | permissive | using Newtonsoft.Json;
using SquidsMovieApp.Data.Utilities.Parsers.Models;
using System.Collections.Generic;
using System.IO;
namespace SquidsMovieApp.Data.Utilities.Parsers
{
public class Parser
{
public ICollection<MovieParsedModel> ParseMovies(string path)
{
return JsonConvert.D... |
Java | UTF-8 | 2,358 | 2.59375 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | package org.pac4j.oauth.profile.facebook.converter;
import org.pac4j.core.profile.converter.AttributeConverter;
import org.pac4j.core.util.Pac4jConstants;
import org.pac4j.oauth.profile.facebook.FacebookRelationshipStatus;
/**
* This class converts a String into a FacebookRelationshipStatus.
*
* @author Jerome Lel... |
Ruby | UTF-8 | 2,224 | 2.890625 | 3 | [] | no_license | require 'nuvi/unzipper'
require 'nuvi/zip_downloader'
require 'nuvi/zip_index'
require 'logger'
require 'redis'
module Nuvi
extend self
def start(base_url)
# Get the list of zip files from the HTTP directory
index = ZipIndex.new(base_url)
zip_urls = index.zip_urls
logger.debug("Found #{zip_urls.c... |
PHP | UTF-8 | 492 | 2.546875 | 3 | [] | no_license | <?php
class Content
{
private $blogid;
public function __construct($id)
{
$this->blogid=$id;
}
//
public function getContent()
{
//sql
$sql='select blogsContent from blogs where blogsId=:id';
//
$conmand=Yii::app()->db->createCommand($sql);
//
$conmand->bindParam(':id',$this->blogid);
... |
TypeScript | UTF-8 | 1,618 | 2.671875 | 3 | [] | no_license | import { Message } from "discord.js";
function i18n(key: string, message: Message, ...args: any[]) {
return getValue(key, "en", args);
}
function getValue(key: string, lang: string, args: any[]) {
if (lang === "qqx") {
console.log(args);
if (args.length == 0) {
return `(${key})`;
... |
Markdown | UTF-8 | 1,567 | 2.640625 | 3 | [] | no_license | # TilerService Docker
A dockerized image of the [TilerService](https://github.com/maritime-web/TilerService).
## Prerequisites
* Docker
* A file called application.properties
* A license key for MapTiler Pro
## Configuration
The application.properties file must at least contain the following lines:
mapTiler.lice... |
Python | UTF-8 | 558 | 2.859375 | 3 | [
"MIT"
] | permissive | import tensorflow as tf
from PIL import Image
import numpy as np
def process_image(image_path):
#open image from path dir and convert it to numpy array
im = Image.open(image_path)
image = np.asarray(im)
#pre-procesing image and normalize it
image_size = 224
image = tf.convert_to_tensor(ima... |
JavaScript | UTF-8 | 826 | 2.53125 | 3 | [] | no_license | const Koa = require("koa");
const app = new Koa();
const Route = require("koa-router");
const route = new Route();
const redis = require("redis");
const client = redis.createClient(6999, "127.0.0.1"); // 客户端实例
app.use(async (ctx) => {
const start = new Date().getTime();
const questPromise = new Promise((resolve... |
Java | UTF-8 | 3,325 | 2.453125 | 2 | [
"Apache-2.0"
] | permissive | package Tables;
import java.sql.SQLException;
import java.util.ArrayList;
import classes.Ability;
/*
* @author Nikola Corkovic - cnik996@gmail.com
* @version beta 1.0
*/
public class NapadiDBL {
static int duzinaListeImenaNapada = 5; //Broj napada ne prelazi 5
static ArrayList<String> ListaImenaNapada = new... |
Java | UTF-8 | 3,665 | 2.171875 | 2 | [] | no_license | package me.weekbelt.naverreservation.web.controller;
import com.fasterxml.jackson.databind.ObjectMapper;
import me.weekbelt.naverreservation.web.dto.display.DisplayInfoResponse;
import me.weekbelt.naverreservation.web.dto.product.ProductDto;
import me.weekbelt.naverreservation.web.dto.product.ProductResponse;
import o... |
Java | UTF-8 | 6,510 | 2.84375 | 3 | [] | no_license | import java.io.*;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
public class ServerThread implements Runnable {
private final String hash;
private final int stringLeng... |
Python | UTF-8 | 4,653 | 2.828125 | 3 | [
"MIT"
] | permissive | import types
try:
import unittest2 as unittest
except ImportError:
import unittest
from marnadi.utils import Lazy
try:
str = unicode
except NameError:
pass
_test_tuple = ('foo', 'bar')
_test_list = ['foo', 'bar']
_test_set = set(_test_tuple)
_test_dict = {'foo': 'bar'}
_test_str = 'foo'
_test_by... |
C | UTF-8 | 1,467 | 2.765625 | 3 | [] | no_license | /*
** process_file.c for asm in /home/keyrise/Work/Repositories/Epitech/CPE/CPE_2015_corewar/asm/srcs/process/
**
** Made by Buyumad Anas
** Login <buyuma_a@anas.buyumad@epitech.eu>
**
** Started on Wed Mar 23 15:17:48 2016 Buyumad Anas
** Last update Sun Mar 27 03:14:32 2016 Buyumad Anas
*/
#include <stdlib.h>
#in... |
Swift | UTF-8 | 1,067 | 2.859375 | 3 | [] | no_license | //
// ViewController.swift
// MInhas_Anotacoes
//
// Created by Max Mendes on 16/05/19.
// Copyright © 2019 Curso iOS. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
let textKey:String = "userText"
@IBOutlet weak var textArea: UITextView!
@IBAction func btnSave(_ sender:... |
Rust | UTF-8 | 2,516 | 2.75 | 3 | [
"CC0-1.0"
] | permissive | extern crate sophia;
use std::collections::HashSet;
use std::error::Error;
use sophia::graph::{inmem::FastGraph, *};
use sophia::parser::turtle;
use sophia::term::TermKind;
use sophia::term::{RcTerm, TTerm};
use sophia::triple::stream::TripleSource;
use sophia::triple::Triple;
fn render_graph(graph: &FastGraph) -> R... |
JavaScript | UTF-8 | 545 | 2.71875 | 3 | [] | no_license | {
function name(type) {
if (type == "A") {
console.log("A");
}
if (type == "B") {
console.log("B");
}
if (type == "C") {
console.log("C");
}
}
function calculate(type, cb) {
const strategies = {
A: function () {
console.log("A");
... |
C++ | UHC | 269 | 2.890625 | 3 | [] | no_license | #pragma once
#include <iostream>
#define STACK_MAX_DATA_COUNT 10
class Stack
{
public:
int myData[STACK_MAX_DATA_COUNT] = { 0 }; // 迭
void Push();
int Pop();
int Count();
void PrintStackData();
private:
int dataCount = -1;
};
|
Python | UTF-8 | 3,992 | 2.640625 | 3 | [] | no_license | #!/usr/bin/python
import cv
import numpy as np
import random
import time
from scipy.cluster.vq import kmeans, vq
num_texcels = 16
num_hist = 7
window_size = 5
W1 = 0.5
W2 = 1.0
W3 = 0.5
def flatten( features ):
return features.reshape( [features.shape[0] * features.shape[1], features.shape[2]] )
def compute_fea... |
Python | UTF-8 | 169 | 3.34375 | 3 | [] | no_license | media = int(input("Média: "))
if (media >= 70):
print('Que bom')
print('passou')
print('legal')
else:
print('Que pena')
print('não passou')
print('chore') |
Java | UTF-8 | 13,599 | 2.59375 | 3 | [] | no_license | package com.optimization;
import javax.swing.*;
import javax.swing.table.DefaultTableModel;
import java.util.*;
import java.util.concurrent.CopyOnWriteArrayList;
import java.awt.event.ActionListener;
import java.sql.DriverManager;
import java.awt.event.ActionEvent;
import java.awt.*;
import java.sql.*;
publ... |
JavaScript | UTF-8 | 1,091 | 2.53125 | 3 | [] | no_license | const {user} = require('../models/user');
const {ValidationUserField} = require('../validation/UserFieldValidation');
const {validationAndGetValidDataForUpdate} = require('../validation/validationHelper');
const createUserValid = (req, res, next) => {
const validationFields = new ValidationUserField(res, next);
... |
C++ | UTF-8 | 1,129 | 2.765625 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <cstring>
using namespace std;
inline int pos(int m, int n, int i, int j, int k, int l) {
return i * n * m * n + j * m * n + k * n + l;
}
int main() {
int m, n;
cin >> m >> n;
++m, ++n;
int *matrix = new int[m * n];
int *dp = ne... |
Java | UTF-8 | 1,097 | 3.3125 | 3 | [] | no_license | package creatingapolygon;
import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.shape.Polygon;
import javafx.stage.Stage;
public class CreatingAPolygon extends Application
{
@Override
public void start(Stage primaryStage)
{
//Creating ... |
C++ | UTF-8 | 3,004 | 3.265625 | 3 | [] | no_license |
class Operator : public Node {
struct Twin {
//std::shared_ptr<Node> _left;
//std::shared_ptr<Node> _right;
//std::unique_ptr<Node> _left;
//std::unique_ptr<Node> _right;
Node* _left;
Node* _right;
} twin ;
const std::function<Operator**(const Symbol) > setS =... |
Java | UTF-8 | 648 | 2.125 | 2 | [] | no_license | package com.transmilenio.transmisurvey.http;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
public class API {
// public static final String BASE_URL = "http://10.0.2.2:8080/TmAPI/";
public static final String BASE_URL = "http://35.226.255.51:8080/TmAPI/";
private stati... |
Java | UTF-8 | 1,339 | 1.992188 | 2 | [
"Apache-2.0"
] | permissive | package io.semla;
import io.semla.cache.Cache;
import com.decathlon.tzatziki.steps.EntitySteps;
import io.semla.datasource.MysqlDatasource;
import io.semla.util.Maps;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.testcontainers.containers.JdbcDatabaseContainer;
import org.testcontainers.containe... |
Python | UTF-8 | 1,107 | 3.328125 | 3 | [] | no_license | # Python3 code to demonstrate
# getting numbers from string
# using re.findall()
import re
def To_Num(text):
# using re.findall()
# getting numbers from string
temp = re.findall(r'\d+\.?\d*', text)
res = list(map(float, temp))
# print result
return res[0]
def To_Storage(text):
... |
PHP | UTF-8 | 2,824 | 2.546875 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
use NotificationChannels\Twitter\TwitterChannel;
use NotificationChannels\Twitter\TwitterStatusUpdate;
use Notifica... |
Java | UTF-8 | 5,150 | 2.453125 | 2 | [] | no_license | package com.example.myapplication.controller.music;
import android.app.Service;
import android.content.Intent;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.os.Binder;
import android.os.Handler;
import android.os.IBinder;
import android.os.PowerManager;
import com.example.myappli... |
Java | UTF-8 | 1,036 | 2.0625 | 2 | [] | no_license | package com.tc.autobim.controller;
import com.tc.autobim.domain.model.*;
import com.tc.autobim.repository.IHouseRepository;
import org.kie.api.KieServices;
import org.kie.api.runtime.KieContainer;
import org.kie.api.runtime.KieSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springfra... |
Java | UTF-8 | 4,790 | 2.609375 | 3 | [] | no_license | package com.plan.respository.webutil.factory;
import org.apache.kafka.clients.producer.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
import java.util.concurrent.Future;
public class MyProducer{
public static void main(String[] args) {
/* //创建Kafka生产者的配置信息
Prope... |
Python | UTF-8 | 1,068 | 2.578125 | 3 | [] | no_license | from bs4 import BeautifulSoup
import requests
import random
import re
def scraping():
ng_list = ["the bridge"]
html = requests.get('https://thebridge.jp/')
soup = BeautifulSoup(html.text, "html.parser")
article = soup.find(class_="articles")
title = article.find(class_="entry-title").string
for... |
Markdown | UTF-8 | 6,354 | 2.953125 | 3 | [
"Apache-2.0"
] | permissive | ---
layout: work-with-us-layout
title: Qualitative Researcher
role: <b> Role </b> <br><br> We are looking for a full-time Social Science Researcher to join our team at Fields of View. You will be required to work with qualitative social data. You must have proficiency in qualitative research methodologies and must al... |
Markdown | UTF-8 | 3,004 | 2.984375 | 3 | [] | no_license | # CSAPP_Study
------
### 作者:冰红茶
### 参考书籍:《Computer Systems A Programmer’s Perspective(3rd)》
------
正式开始CSAPP了,有点儿小兴奋。据说这本书是国外许多著名大学的经典教材,深入讲解了计算机系统的底层原理,包括编码,汇编软件,指令,存储器层次结构,虚拟内存等。看完应该会很有收益,那事不宜迟,正式开始吧^_ ^
参考机:Intel Core i7... |
JavaScript | UTF-8 | 729 | 3.828125 | 4 | [] | no_license | const peso1 = 1.0
const peso2 = Number('2.0')
console.log(peso1, peso2)
console.log(Number.isInteger(peso1)) // Verificando se a variável é um inteiro
const avaliacao1 = 9.567
const avaliacao2 = 6.547
const total = avaliacao1 * peso1 + avaliacao2 * peso2
const media = total / (peso1 + peso2)
console.log(media.toFix... |
Ruby | UTF-8 | 333 | 3.140625 | 3 | [] | no_license | puts "Salut, bienvenue dans ma super pyramide ! Combien d'étages veux-tu ?"
print "> "
stage=gets.chomp.to_i
a=0
until (stage <= 25 && stage > 0)
puts "Veuillez entrer un nombre compris entre 1 et 25"
print "> "
stage=gets.chomp.to_i
end
puts "Voici la pyramide :"
until a>stage do
puts "#"*a
a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.