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 |
|---|---|---|---|---|---|---|---|
SQL | UTF-8 | 265 | 3.890625 | 4 | [] | no_license | SELECT *
FROM
(SELECT EmployeeID, FirstName, LastName, Salary,
(DENSE_RANK() OVER(PARTITION BY Salary ORDER BY EmployeeID)) AS [Rank]
FROM Employees
WHERE Salary >= 10000 AND Salary <= 50000
) AS temp
WHERE [Rank] = 2
ORDER By Salary DESC
|
Python | UTF-8 | 2,034 | 3.5625 | 4 | [] | no_license | from typing import Iterator, List
def first(puzzle_input: Iterator[str]) -> int:
counts = find_jolt_diff_counts(int(n.strip()) for n in puzzle_input)
return counts[0] * counts[2]
def second(puzzle_input: Iterator[str]) -> int:
return count_arrangements(int(n.strip()) for n in puzzle_input)
def find_jo... |
Java | UTF-8 | 7,762 | 1.914063 | 2 | [] | no_license | package uk.ac.tees.aad.W9299136;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import an... |
Python | UTF-8 | 512 | 2.890625 | 3 | [
"MIT"
] | permissive | import numpy as np
import cv2
img = cv2.imread('obstacle_scene_5.jpg')
dst = cv2.fastNlMeansDenoisingColored(img,None,10,10,7,21)
lower = np.array([40,40,40]) #-- Lower range --
upper = np.array([110,110,110]) #-- Upper range --
mask = cv2.inRange(dst, lower, upper)
#cv2.imshow('Mask',mask)
mask = 255 - mask
res =... |
Python | UTF-8 | 448 | 3.65625 | 4 | [] | no_license | print('Nhap chuoi co dang: A=B. ex: 120=111')
s = input('Input:')
index = s.find('=')
A = s[:index]
B = s[index+1:]
n = len(A)
m = len(B)
count = 0
for i in range(1, n):
for j in range(1, m):
aL = A[:i]
aR = A[i:]
bL = B[:j]
bR = B[j:]
if int(aL) + int(aR) == int(bL) + i... |
Shell | UTF-8 | 2,845 | 4.21875 | 4 | [] | no_license | #!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the active virtualenv
# * the branch/status of the current git repository
# * the return value of the previous command
#
# USAGE:
#
# 1. Save this file as ~/.bash_prompt
# 2. Add the following line to the end of your ~/.bashrc or ~/.b... |
Java | UTF-8 | 1,767 | 2.859375 | 3 | [] | no_license | package com.ticket.management.data;
import java.util.HashMap;
import java.util.Map;
public class Level {
private int id;
private String name;
private int totalRows;
private float pricePerSeat;
private int totalSeatsPerRow;
private Map<Character,Row> rows;
private int totalAvailableSeats;
public Level(in... |
Java | UTF-8 | 216 | 2.171875 | 2 | [] | no_license | package com.codewars;
//public class KataTests {
// @Test
// public void exampleTests() {
// assertEquals(8, Kata.dontGiveMeFive(1,9));
// assertEquals(12, Kata.dontGiveMeFive(4,17));
// }
//} |
C# | UTF-8 | 1,132 | 2.578125 | 3 | [] | no_license | using InvoicingSystem.Data.Repositories;
using InvoicingSystem.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace InvoicingSystem.Data.Mocks {
class AddressMock {
AppDbContext context = new AppDbContext();
AddressRe... |
Markdown | UTF-8 | 6,476 | 2.90625 | 3 | [] | no_license | # Image镜像
* 介绍
* 父镜像
* 基础镜像
* 镜像ID
* 获列出本地镜像取镜像
* 创建镜像
* 修改已有镜像
* 利用 Dockerfile 来创建镜像
* 从本地文件系统导入
* 上传镜像
* 存出和载入镜像
* 存出镜像
* 载入镜像
* 移除本地镜像
* 镜像的实现原理
---
# 介绍

在 Docker 的术语里,一个只读层被称为镜像,一个镜像是永久不... |
Java | UTF-8 | 978 | 2.078125 | 2 | [] | no_license | /**
*
*/
package ec.com.taxinet.webapp.dto;
import java.io.Serializable;
import ec.com.taxinet.webapp.model.paymentManagement;
/**
* @author Juan Campos
*
*/
public class paymentManagementDTO extends BaseDTO implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
private pay... |
TypeScript | UTF-8 | 1,629 | 3 | 3 | [
"MIT"
] | permissive | import { getImageUrl } from '../../../../utils/get-image';
import cardType from '../../../internal/SecuredFields/lib/utilities/cardType';
export const getCardImageUrl = (brand: string, loadingContext: string): string => {
const imageOptions = {
type: brand === 'card' ? 'nocard' : brand || 'nocard',
... |
Markdown | UTF-8 | 1,762 | 3.109375 | 3 | [] | no_license | # 0x08. Python - More classes and objects
## Learning Objectives
- Why Python programming is awesome
- What is OOP
- "first-class everything"
- What is a class
- What is an object and an instance
- What is the difference between an class and an object or instance
- What is an attribute
- What are and how to use public... |
Python | UTF-8 | 288 | 3.46875 | 3 | [] | no_license | #program to insert in a dictionary
a={}
a.setdefault('key','value')
a.setdefault('key1','value1')
a.setdefault('key2',[]).append('value2_1') #appending as a list
a.setdefault('key2',[]).append('value2_2')
a.setdefault('key2',[]).append('value2_3')
a.setdefault('key3','value3')
print a |
C++ | UTF-8 | 4,720 | 3.1875 | 3 | [] | no_license | //
// Created by rnetuka on 22.12.19.
//
#include <algorithm>
#include <deque>
#include <functional>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include "../utils.h"
using namespace std;
using deck = deque<long>;
constexpr long oversized_deck_size = 119'315'717'514'047;... |
C | UTF-8 | 3,514 | 2.953125 | 3 | [] | no_license | #include <stdlib.h>
#include <unistd.h>
#include <SDL.h>
#include <SDL_audio.h>
#include <stdint.h>
#include <math.h>
typedef float sample_t;
typedef int samplecount_t;
typedef float freq_t;
typedef float msec_t;
samplecount_t samplerate;
static freq_t basefreq=55;
static freq_t freq;
// Converts a sample count int... |
C++ | UTF-8 | 7,955 | 3.34375 | 3 | [] | no_license | #include "myBlock.h"
#include <stddef.h>
#include <memory>
#include <iostream>
# define myEpsilon 100
using namespace std;
//default constructor
myBlock::myBlock(){
theObject = nullptr;
cout<<"default constructor called"<<endl;
}
myBlock::myBlock(int lengthOfString){
//check for space
//create 3 blo... |
C | UTF-8 | 614 | 3.921875 | 4 | [] | no_license | // Counts digits in a given number
#include <stdio.h>
#include <stdlib.h>
void repetedDigits(int n){
int *p = (int *) malloc(1 * sizeof(int));
int digit, i=0, j, index = 0;
int arr[10] = {0};
while(n/10 != 0){
digit = n % 10;
n /= 10;
p[i] = digit;
realloc(p, 1 * sizeof(int));
i++;
}... |
Go | UTF-8 | 1,107 | 3.28125 | 3 | [
"MIT"
] | permissive | package perftest
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"sync"
"testing"
"time"
)
func hitURLShortner() (interface{}, interface{}) {
requestBody, _ := json.Marshal(map[string]string{
"url": "https://youtu.be/dQw4w9WgXcQ?t=43",
"request_id": "asdlfjhlaksdjffsajkflkjghjasfflkg",
})
resp,... |
C++ | UTF-8 | 1,161 | 3.015625 | 3 | [] | no_license | class Solution {
public:
vector<vector<int>> ans;
void dfs(vector<int>& nums, vector<int>& path, int start) {
if (path.size() >= 2) ans.push_back(path);
if (start >= nums.size()) return;
unordered_set<int> s;
// 如果set里已经记录了当前的值,则跳过;因为之前唤起的dfs里会把之后所有的同样的值都选中;
// 只需要考虑从之后开... |
C++ | UTF-8 | 6,276 | 2.53125 | 3 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /*
* ******** merced: calculate the transfer matrix ********
* $Revision: 601 $
* $Date: 2017-12-12 $
* $Author: hedstrom $
* $Id: quad_methods.hpp 601 2017-12-12Z hedstrom $
* ******** merced: calculate the transfer matrix *********
*
* # <<BEGIN-copyright>>
* # <<END-copyright>>
*/
// Classes for Gaussian... |
Java | UTF-8 | 3,293 | 2.8125 | 3 | [
"MIT"
] | permissive | package goliathoufx.panes;
import javafx.event.Event;
import javafx.event.EventHandler;
import javafx.scene.control.Tab;
import javafx.scene.control.TabPane;
public class AppTabPane extends TabPane
{
public static boolean POWER_ONLY = false;
public static boolean BLOCK_TAB_CREATION;
private final ... |
Go | UTF-8 | 1,300 | 2.59375 | 3 | [] | no_license | package services
import "testing"
func TestCreateMerchantInvalidRateN(t *testing.T) {
actual := MS.CreateMerchant([]string{"merchantTest", "abc"})
if actual {
t.Errorf("Merchant Created despite invalid rate of interest")
}
}
func TestCreateMerchantInvalidArgsN(t *testing.T) {
actual := MS.CreateMerchant([]stri... |
Go | UTF-8 | 34,509 | 3.109375 | 3 | [
"MIT"
] | permissive | package container
type ArrayList_int struct {
items []int
}
type ArrayList_int8 struct {
items []int8
}
type ArrayList_int16 struct {
items []int16
}
type ArrayList_int32 struct {
items []int32
}
type ArrayList_int64 struct {
items []int64
}
type ArrayList_uint struct {
items []uint
}
type ArrayList_uint8 ... |
JavaScript | UTF-8 | 424 | 3.1875 | 3 | [] | no_license | var x=document.getElementById("text");
console.log(x.innerHTML);
var tag=document.getElementsByTagName("h1")[1];
console.log(tag.innerHTML);
var input=document.getElementsByName("my name")[0]
console.log(input.type);
var span = document.getElementsByClassName("clas")[0]
console.log(span.innerHTML)
var button=document.g... |
Go | UTF-8 | 237 | 2.9375 | 3 | [] | no_license | package main
import "net/http"
// http.ListenAndServe() じゃなくて http.Server を直接使う場合
func main() {
server := http.Server{Addr: "", Handler: nil}
err := server.ListenAndServe()
if err != nil {
panic(err)
}
}
|
Markdown | UTF-8 | 1,604 | 3.8125 | 4 | [] | no_license | #### 0598.范围求和 II
[题目链接](https://leetcode-cn.com/problems/range-addition-ii)
> 给定一个初始元素全部为 **0**,大小为 m*n 的矩阵 **M** 以及在 **M** 上的一系列更新操作。
>
> 操作用二维数组表示,其中的每个操作用一个含有两个**正整数 a** 和 **b** 的数组表示,含义是将所有符合 **0 <= i < a** 以及 **0 <= j < b** 的元素 **M[i][j]** 的值都**增加 1**。
>
> 在执行给定的一系列操作后,你需要返回矩阵中含有最大整数的元素个数。
>
> **示例 1:**
>
> `... |
Java | UTF-8 | 504 | 2.578125 | 3 | [] | no_license | package resume;
import java.util.ArrayList;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
ArrayList<PersonData> myArrayList = new ArrayList<PersonData>();
PersonData personData = new PersonData();
personData.setName("Genzeb");
personData.s... |
SQL | UTF-8 | 1,780 | 4.03125 | 4 | [] | no_license | create table Department(
ID int primary key,
DEPT_NAME varchar(50) not null,
LOCATION varchar(50) not null,
SUPERVISOR varchar(50)
);
insert into Department values (801,'CSE','Rajshahi','Nur E Alam');
insert into Department values(802,'EEE','Dhaka','Faisal Imran');
insert into Department values(803,'CIVIL','Khulna','M... |
PHP | UTF-8 | 2,139 | 2.609375 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
namespace common\models;
use Yii;
use yii\data\ActiveDataProvider;
/**
* This is the model class for table "favorite".
*
* @property int $user_id
* @property int $post_id
* @property int $add_time
* @property int $type
*/
class Favorite extends \yii\db\ActiveRecord
{
const TYPE_LAUD=1;
const TYP... |
Shell | UTF-8 | 4,219 | 2.625 | 3 | [] | no_license | #!/bin/bash
cat <<-EOF > /tmp/mcdata/mapcache-source.xml
<?xml version="1.0" encoding="UTF-8"?>
<mapcache>
EOF
cat <<-EOF > /var/www/html/mapcache-sandbox-browser/mapcache-source.js
var mapcache_source = new ol.layer.Group({
title: 'Sources externes',
fold: 'open'
});
layers.unshift(mapcache_source)
EOF
... |
Markdown | UTF-8 | 590 | 3.53125 | 4 | [
"MIT"
] | permissive | ## Problem 389 of Euler Project
https://www.projecteuler.net/problem=389
An unbiased single 4-sided die is thrown and its value, T, is noted.T unbiased 6-sided dice are thrown and their scores are added together. The sum, C, is noted.C unbiased 8-sided dice are thrown and their scores are added together. The sum, O, i... |
C++ | UTF-8 | 4,144 | 3.53125 | 4 | [
"MIT"
] | permissive | /*
==============================================================================
Interpolator.h
Created: 1 Aug 2018 6:34:02pm
Author: stefa
==============================================================================
*/
#pragma once
#include <vector>
#include <cassert>
namespace In... |
C# | UTF-8 | 494 | 2.609375 | 3 | [] | no_license | using UnityEngine;
public class SimpleBullet : MonoBehaviour
{
float speed = 10, lifeTime = 0.5f, dist = 10000, spawnTime = 0;
private Transform tr;
void OnEnable()
{
tr = transform;
spawnTime = Time.time;
}
void Update()
{
tr.position += tr.forward * speed * Tim... |
C++ | UTF-8 | 1,142 | 3.09375 | 3 | [] | no_license | #include <iostream>
using namespace std;
template <typename T>
struct TypeTrait {
enum { typeid_ = -1 };
};
#define DEFINE_TRAIT(type, id) \
template <> \
struct TypeTrait<type> { \
enum { typeid_ = id}; \
};
DEFINE_TRAIT(int, 1);
DEFINE_TRAIT(float, 2);
DEFINE_TRAIT(dou... |
Markdown | UTF-8 | 1,359 | 4 | 4 | [] | no_license | ### [1.Two Sum](https://github.com/MorrisLee000/Practice/blob/master/Leetcode/1%23_Two%20Sum_06170243.py)
* 在寫Two Sum 我先設置一個空list,因為在最後還傳出來的東西會是一個list裡面包含兩個答案,然後設迴圈去尋找答案。
### [7.Reverse Interger](https://github.com/MorrisLee000/Practice/blob/master/Leetcode/7%23_Reverse%20Interger_06170243.py)
* 先把數字取絕對值再轉換成str去倒著排... |
C# | UTF-8 | 2,218 | 3.765625 | 4 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Verk_1
{
class Program
{
public static int duplicatesLetters(string input)
{
SortedDictionary<char, int> repeats = new SortedDictionary<char, int>();
... |
Java | UTF-8 | 749 | 1.726563 | 2 | [] | no_license | package code.expressionlanguage.exec.opers;
import code.expressionlanguage.Argument;
import code.expressionlanguage.ContextEl;
import code.expressionlanguage.exec.StackCall;
import code.expressionlanguage.exec.variables.ArgumentsPair;
import code.expressionlanguage.fwd.opers.ExecOperationContent;
import code.util.IdMa... |
C# | UTF-8 | 418 | 2.90625 | 3 | [] | no_license | using System;
namespace BehaviorTree {
[Serializable]
public class BlackboardKey<T> {
private T param;
public BlackboardKey(T value) { param = value; }
public void SetValue(T value) { param = value; }
public T GetValue() { return param; }
public void Nullify() { p... |
Java | UTF-8 | 3,125 | 2.4375 | 2 | [] | no_license | package services;
import dao.EventPointDAO;
import dao.EventPointDAOImpl;
import models.EventPoint;
import models.User;
import org.hibernate.SessionFactory;
import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
import org.hibernate.cfg.Configuration;
import org.hibernate.service.ServiceRegistry;
import ut... |
C++ | UTF-8 | 1,788 | 2.78125 | 3 | [] | no_license | #ifndef IpWidget_H
#define IpWidget_H
/**
* IP地址输入框控件 作者:feiyangqingyun(QQ:517216493) 2017-8-11
* 1. 可设置IP地址,自动填入框
* 2. 可清空IP地址
* 3. 支持按下小圆点自动切换
* 4. 支持退格键自动切换
* 5. 支持IP地址过滤
* 6. 可设置背景色/边框颜色/边框圆角角度
*/
#include <QWidget>
class QLabel;
class QLineEdit;
#ifdef quc
class Q_DECL_EXPORT IpWidget : public QWidget... |
JavaScript | UTF-8 | 1,650 | 2.75 | 3 | [
"MIT"
] | permissive | 'use strict'
/**
* @fileoverview Discourage repeating parts of CSS selectors
* @author Alexander Afanasyev
*/
var isCSSLocator = require('../find-css-locator')
module.exports = {
meta: {
schema: []
},
create: function (context) {
// keeping the processed CSS selectors to check the next one against
... |
C++ | UTF-8 | 846 | 3.171875 | 3 | [] | no_license | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
int pairSum(ListNode*... |
PHP | ISO-8859-1 | 21,149 | 3.265625 | 3 | [] | no_license | <?php
/**
* @copyright (C) 2005 Hugo Ferreira da Silva. All rights reserved
* @license http://www.gnu.org/copyleft/lesser.html LGPL License
* @author Hugo Ferreira da Silva <eu@hufersil.com.br>
* @link http://www.hufersil.com.br/lumine/ Lumine Project
* Lumine is Free Software
**/
/**
* Utility class, just for hold t... |
Python | UTF-8 | 23,233 | 2.921875 | 3 | [] | no_license | #Importation des packages:
import string
import regex as re
import pandas as pd
from nltk.tokenize import word_tokenize
from nltk.probability import FreqDist
import unicodedata
#Importation de la base de données:
df = pd.read_csv("s3://projet-stat-ensai/Lacentrale.csv",sep=';', dtype=str)
df = pd.read_csv(".aws/autom... |
Java | UTF-8 | 6,135 | 2.5 | 2 | [] | no_license | package Paneles;
import Botones.BtnCancelar;
import ManejadoresEventos.EmpleadoEventos;
import Colecciones.HashTEmpleado;
import ClasesBase.Departamento;
import Colecciones.ArrayLDepartamentos;
import TextFields.JEnterosField;
import TextFields.JFloatField;
import TextFields.JLetrasField;
import java.awt.Dimension;
im... |
Python | UTF-8 | 7,216 | 2.9375 | 3 | [] | no_license | import pygame, sys, random
from pygame.locals import *
class Grille:
def __init__(self, x, y):
self.matrice = [[ESPACE for i in range(y)] for j in range(x)]
self.longueur = x
self.largeur = y
class Snake:
def __init__(self):
self.list_blocks = []
self.direction = "righ... |
Markdown | UTF-8 | 1,872 | 4.09375 | 4 | [] | no_license | 1. `charAt`
- Parameter: (index) defaults to 0 - (number data type)
- Return: character at specific index in the string (string data type)
- Example:
```js
let name = 'Arya Stark';
name.charAt(2); //"y"
let sentance = 'A quick brown fox jumped over a lazy dog';
sentance(4); // "i"
... |
PHP | UTF-8 | 746 | 2.5625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Requests;
use pebibits\validation\Rule\Alpha\Alpha;
use Illuminate\Foundation\Http\FormRequest;
class SpecificEvent extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
r... |
Java | UTF-8 | 2,785 | 2.765625 | 3 | [] | no_license | package dao;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import entities.Definition;
public class DefinitionDao extends Dao<Definition> {
@Override
public Definition findById(int id) throws SQLException {
Definition def = null;
String query = "SELECT * FROM Defi... |
C | UTF-8 | 1,421 | 3.84375 | 4 | [] | no_license | /*************************************************************************
> File Name: 9.c
> Author: Crow
> Mail: qnglsk@163.com
> Created Time: Thu Sep 3 15:56:03 2020
************************************************************************/
#include<stdio.h>
/*
* Write a program that initializes a two-dime... |
Python | UTF-8 | 597 | 3.34375 | 3 | [] | no_license | # # dictionary is a key value pair let suppose course is the dictonary 1 = english
#
# course ={ "khalid":"English","Ali":"urdu","salman":"Physics","imran":["English","Urdu","Dari"],
# "ikram":{"A":"Computer","B":"Web Developement"}}
#
# # print(course["ikram"]["B"])
#
# # methods
# # Get
#
# # print(course... |
Markdown | UTF-8 | 1,972 | 3.359375 | 3 | [
"MIT"
] | permissive | Data.TypeNat
============
The classic first example of a dependently typed program is the list of
fixed length, or `Vect`, where the length is in its type.
It's known that GHC's type system can handle this, through the
GADTs, KindSignatures, and DataKinds extensions.
This module provides the fixed-length list type `... |
Java | UTF-8 | 930 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | package com.hofer.tij.common;
/**
* @author hofer.bhf
* created on 2018/05/19 5:28 PM
*/
public class HelloWorld {
public static void main(String[] args) {
/**
* http://baike.corp.taobao.com/index.php/MemberPlatform/userTagWiki#promotedType
* userTag3 2的49次方 标记此用户是否为分销平台的供应商
*... |
PHP | UTF-8 | 2,889 | 2.953125 | 3 | [] | no_license | <?php
require_once './model/Actor.php';
//require_once '../model/data/MySQLiCustomerDataModel.php';
require_once './model/data/PDOMySQLCustomerDataModel.php';
class ActorModel
{
private $m_DataAccess;
public function __construct()
{
//$this->m_DataAccess = new MySQLiCustomerDataModel();
$... |
TypeScript | UTF-8 | 5,314 | 2.546875 | 3 | [] | no_license | import * as assert from "assert";
import * as discovery from "../lib/index";
const pairs = {
SERVICE_REDIS_TCP_PROTO: "tcp",
SERVICE_REDIS_TCP_HOST: "redis.com",
SERVICE_REDIS_TCP_PORT: "6379",
SERVICE_GOOGLE_API_PROTO: "https",
SERVICE_GOOGLE_API_HOST: "api.google.com",
SERVICE_GOOGLE_API_PORT: "80",
SE... |
Markdown | UTF-8 | 1,149 | 2.765625 | 3 | [] | no_license | # oddball
MATLAB code for auditory oddball task with eyetracking.
This is just a super simple example for how to play sound and record eyetracking using Psychtoolbox (http://psychtoolbox.org/) in MATLAB.
SPECIAL NOTE: The sounds in the folder 'SoundFiles' have not been RMS equalised!!!
SPECIAL NOTE 2: There might be *... |
Java | UTF-8 | 674 | 2.125 | 2 | [] | no_license | package com.juggle.juggle.primary.setting.dto;
import java.io.Serializable;
import java.util.List;
public class DomainRelation implements Serializable {
private Long id;
private String name;
private List<DomainRelation> children;
public Long getId() {
return id;
}
public void setId... |
C# | UTF-8 | 872 | 2.734375 | 3 | [
"MIT"
] | permissive | using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Cloney.Core.Reflection;
using Cloney.Core.SubRoutines;
namespace Cloney.Core
{
/// <summary>
/// This class can be used to find every sub routine
/// that is defined in the executing assembly.
... |
PHP | UTF-8 | 2,732 | 3.3125 | 3 | [] | no_license | <?php
include __DIR__ . '/vendor/autoload.php';
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
echo '<h2>-----Бинарный поиск-----</h2><br>';
$binarySearch = new \App\GrokkingAlgorithms\BinarySearch();
echo 'Исходный массив: ';
echo '<pre>';
var_dump($binarySea... |
C# | UTF-8 | 1,375 | 2.671875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace GUI.ViewModel
{
/// <summary>
/// Абстракная модель представления рабочей области(вкладки)
/// </summary>
public abstract class WorkSpaceViewModel : ValidatedViewModelBase
{
/// <summary>
... |
Markdown | UTF-8 | 2,048 | 2.703125 | 3 | [
"MIT"
] | permissive | onetwopunch
===========
Nmap is by far the most comprehensive port scanner, able to identify services, fingerprint operating systems, and even run several scripts against the services to identify potential vulnerabilities. This helps cut down the manual work involved in service enumeration. Nmap uses a default list of... |
Java | UTF-8 | 1,229 | 2.5625 | 3 | [] | no_license | package com.github.sdvic;
//******************************************************************************************
// * Application to extract Cash Flow data from Quick Books P&L and build Cash Projections
// * version 210115
// * copyright 2020 Vic Wintriss
//*******************************************************... |
Markdown | UTF-8 | 16,664 | 2.640625 | 3 | [] | no_license | # 3. Python을 활용한 머신러닝 정리
Python을 활용한 머신러닝에 있는 교재와 강의 내용을 재구성하여 정리합니다.
## 머신러닝
머신러닝은 데이터로부터 경험을 축적하여 스스로 학습할 수 있는 모델을 연구하는 분야입니다.
어떤 현상을 예측하는 모델(시스템)을 만들 때, 고전적인 방식으로는 통계적 알고리즘을 통해 모델을 만들었습니다. (이는 Python을 활용한 데이터분석과 시각화에서 했었습니다.) 최근에는 **머신러닝 알고리즘**을 통해 모델을 만듭니다. 고전적인 방식과는 달리 머신러닝 알고리즘은 새로운 데이터를 학습하여 모델을 ... |
Markdown | UTF-8 | 2,576 | 3.640625 | 4 | [] | no_license | # Asset Tree Overview
Asset tree is a key function of EnOS Device Management service. Asset tree mainly targets to asset owners who understand the enterprise asset management business. Therefore, they can quickly create the asset topology to manage assets in the cloud.
The asset tree function and the device managemen... |
Python | UTF-8 | 223 | 3.109375 | 3 | [] | no_license | import re
def validate_phone_number(number):
if re.match(r'^01[016789][1-9]\d{6,7}', number):
return True
return False
print(validate_phone_number('01042103117'))
print(validate_phone_number('0125077006')) |
Python | UTF-8 | 1,436 | 3.265625 | 3 | [] | no_license |
#!/usr/bin/env python3
def func(fore_color='black', back_color='white', link_color='blue', visited_color='yellow'):
return (fore_color, back_color, link_color, visited_color)
def test1_func():
test = ('red', 'blue', 'yellow', 'chartreuse')
assert test == func('red', 'blue', 'yellow', 'chartreuse')
def t... |
C++ | UTF-8 | 481 | 3.078125 | 3 | [] | no_license | #include <fstream>
#include <iostream>
#include <vector>
#include <string>
#include <string.h>
using namespace std;
void removeChar(string & source, unsigned int index) {
for(unsigned int i=0; i<source.size(); i++){
if(i >= index){
source[i] = source[i+1];
}
}
}
int main(int argc,... |
Go | UTF-8 | 1,555 | 2.859375 | 3 | [] | no_license | // Package main initializes server and in-memory map loaded from offline database,
// and registers handlers to controller functions.
package main
import (
"fmt"
"log"
"net/http"
"os"
"time"
"gpl/ch7/exercises/e7.12/ctrl"
"gpl/ch7/exercises/e7.12/model"
"gpl/ch7/exercises/e7.12/util"
)
func main() {
// cre... |
C++ | UTF-8 | 693 | 2.65625 | 3 | [] | no_license | #include <cstdio>
#include <vector>
using namespace std;
int vis[101], n, m, u, v;
vector<int> res;
vector<int> g[101];
void solve(int i){
vis[i] = 1;
for(int j : g[i]){
if(vis[j] == 0)
solve(j);
}
res.push_back(i);
}
int main(){
while(scanf("%d %d", &n, &m),n+m){
res.... |
Java | UTF-8 | 346 | 2.90625 | 3 | [] | no_license | package day15;
public class ExceptEx07 {
public static void main(String[] args) {
try {
System.out.println("try 구문");
//throw new Exception ("hello");
throw new RuntimeException ();
}catch (NullPointerException e) {
System.out.println("Null");
}catch (Exception e) {
System.out.println("모든 예외");... |
C++ | UTF-8 | 915 | 2.90625 | 3 | [] | no_license | #include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <iostream>
int main() {
char *str = (char*)malloc(1);
int i = 1, c;
while((c = getchar()) != EOF && c != '\n') {
i++;
str = (char*)realloc(str, i);
str[i - 2] = c;
str[i - 1] = '\0';
}
int flag = 0;
... |
C++ | UTF-8 | 546 | 2.96875 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <algorithm>
#include <set>
#include <sstream>
using namespace std;
set<string> dic;
int main(){
string s,buf;
while(cin>>s){
for(int i=0;i<s.length();i++){
if(s[i]>='A'&&s[i]<='Z') s[i]=tolower(s[i]);
else if(s[i]>='a'&&s[i]<='z') co... |
C# | UTF-8 | 9,114 | 3.109375 | 3 | [] | no_license | using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.ExceptionServices;
using System.Text;
using System.Threading.Tasks;
namespace Test.boolean_function
{
abstract public class BFType
{
public virtual object Generate()
{
... |
PHP | UTF-8 | 863 | 2.59375 | 3 | [
"MIT"
] | permissive | <?php namespace Gecche\Multidomain\Console;
use Symfony\Component\Console\Input\InputDefinition;
use Symfony\Component\Console\Input\InputOption;
class Application extends \Illuminate\Console\Application {
/**
* Get the default input definitions for the applications.
*
* @return \Symfony\Component\Console\Inp... |
Java | UTF-8 | 1,353 | 4 | 4 | [] | no_license | package day_56_exceptions;
public class TryCatch {
public static void main(String[] args) {
System.out.println("Before Try Catch: ");
//lets handle the following ArithmeticException
try{
System.out.println("In try block");
int result = 10/0; //if 10/2 then it doesn... |
JavaScript | UTF-8 | 2,139 | 2.625 | 3 | [
"MIT"
] | permissive | /**
* ButtonOptionWidget is a special type of {@link OO.ui.mixin.ButtonElement button element} that
* can be selected and configured with data. The class is
* used with OO.ui.ButtonSelectWidget to create a selection of button options. Please see the
* [OOUI documentation on MediaWiki] [1] for more information.
*
... |
Java | UTF-8 | 925 | 2.078125 | 2 | [] | no_license | package com.fileManager.service.user;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import com.fileManager.entity.user.User;
import com.fileManager.service.common.BaseService;
/**
* 描述:用户
* 项目名称:fileManager
* 创建日期:2015年9月22日上午11:25:00
* @author Administra... |
C++ | UTF-8 | 2,815 | 2.875 | 3 | [] | no_license | #include "tile.h"
#include "Vector2.h"
#include "Renderer.h"
#include "InputSystem.h"
Tile::Tile(int x, int y, TileCategory tileCategory)
: id(0, 0)
, tileType(UNDETERMINED)
, locked(false)
{
id.x = x;
id.y = y;
this->tileCategory = tileCategory;
}
Tile::~Tile()
{
}
bool
Tile::Initialise(Renderer& renderer, ... |
Python | UTF-8 | 1,447 | 3.25 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python3
import pygame
import pygame.gfxdraw
from PIL import Image, ImageDraw
# --- constants ---
BLACK = ( 0, 0, 0)
WHITE = (255, 255, 255)
BLUE = ( 0, 0, 255)
GREEN = ( 0, 255, 0)
RED = (255, 0, 0)
GREY = (128, 128, 128)
PI = 3.1415
# --- main ----
pygame.init()
screen = pygame.... |
C# | UTF-8 | 2,329 | 3.625 | 4 | [] | no_license | using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace _4
{
class Program
{
public static void Quicksort(int[] elements, int left, int right, int k1, int k2)
{
if (left > k2 || right < k1) return;
int i = left, j... |
SQL | UTF-8 | 10,346 | 3.78125 | 4 | [
"Apache-2.0"
] | permissive | --
---------------------------------------------------------------------
-- Declaraciones de la BDejemplo -- Sin PK's ni FK's para NORMALIZAR
-- Es una BD de Clientes "activos" que invierten en empresas.
-- Algunos clientes son morosos. Alg�n moroso no es cliente
-- Clientes que trabajan en cierto puesto. Client... |
Ruby | UTF-8 | 1,051 | 2.5625 | 3 | [] | no_license | class Condition < ApplicationRecord
validates_presence_of :date
validates_presence_of :max_temperature_f
validates_presence_of :mean_temperature_f
validates_presence_of :min_temperature_f
validates_presence_of :mean_humidity
validates_presence_of :mean_visibility_miles
validates_presence_of :mean_wind_spe... |
C | UTF-8 | 1,680 | 2.953125 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_pathjoin.c :+: :+: :+: ... |
Python | UTF-8 | 218 | 3.171875 | 3 | [] | no_license | def f(x):
res=0
for a in str(x):
res+=int(a)
return res
N=int(input())
L=[]
for i in range(max(0,N-200),N+1):
if i+f(i)==N:
L.append(i)
print(len(L))
for i in L:
print(i) |
JavaScript | UTF-8 | 11,176 | 2.859375 | 3 | [] | no_license | /* global $ */
function EventManager() {
/*
* _listenerHash looks like this:
* {
* "eventType1": { (etListenerHash)
* "_global_": [ func1, func2, func3 ], (idListenerArray)
* "id1": [ func4 ],
* "id2": [ func5, func6]
* },
* "eventType2": {
* ...
* }
* ...
... |
Java | UTF-8 | 1,711 | 2.359375 | 2 | [] | no_license | package de.enterprise.lokaServer.events.execution;
import java.util.ArrayList;
import net.sf.json.JSONObject;
import de.enterprise.lokaServer.events.CommandEvent;
import de.enterprise.lokaServer.events.ServerEvent;
import de.enterprise.lokaServer.pojos.DoubleLocPojo;
import de.enterprise.lokaServer.pojos.LocationPojo... |
Python | UTF-8 | 41,482 | 3.015625 | 3 | [] | no_license | # -*- coding: utf-8 -*-
'''
CalStressTensor.py
Script to calculate the assembly averaged stress tensor based on contact force and branch vector.
Usage:
python CalStressDrop.py -test 1 -filter median -param 21
python CalStressDrop.py -case shear-rate-10-press-1e5 -test 1
References:
[1] Dorostkar, O., Guyer, R. A., John... |
Python | UTF-8 | 1,036 | 4.34375 | 4 | [] | no_license | #Autor: Luis Ricardo Chagala Cervantes.
#Determinar que tipo de triangulo es, referente a las medidas de los lados ingresados.
def calculoTriangulo(a, b, c):
x = a**2
y = b**2
z = c**2
if a <= 0 or b <= 0 or c <= 0:
return "Estos lados no corresponden a un triángulo"
if int(float... |
Markdown | UTF-8 | 658 | 2.875 | 3 | [] | no_license | # Bookmark Challenge #
This web application has been designed to maintain a collection of bookmarks.
Users are able to save useful URLs and tag them in order to find them later on.
Additionally you can browse bookmarks that other users have added and comment on them.
Before building this project we created user stori... |
TypeScript | UTF-8 | 804 | 2.765625 | 3 | [] | permissive | import { getScrollBarSize } from '../../browser/scrollbar'
type HTMLBodyStyle = {
overflow: string | null
paddingRight: string | null
}
const memo: HTMLBodyStyle = {
overflow: null,
paddingRight: null
}
let locked = false
export function lock() {
const style = document.body.style
// cache
memo.overfl... |
C | UTF-8 | 1,554 | 3.609375 | 4 | [] | no_license | /*
Demostrar el problema de bloqueos cuando se invierten los mutexes
para proteger dos variables globales
*/
#include <stdio.h>
#include <pthread.h>
#define NTHREADS 2
#define VECES 50
pthread_mutex_t mutex_c = PTHREAD_MUTEX_INITIALIZER;
pthread_mutex_t mutex_p = PTHREAD_MUTEX_INITIALIZER;
int c, p;
void * con... |
PHP | UTF-8 | 2,728 | 3.140625 | 3 | [] | no_license | <?php
namespace Jazzee\Entity;
/**
* Message
*
* Messages between applicants and programs
*
* @Entity
* @Table(name="messages")
* @SuppressWarnings(PHPMD.ShortVariable)
* @author Jon Johnson <jon.johnson@ucsf.edu>
* @license http://jazzee.org/license BSD-3-Clause
*/
class Message
{
/**
* Sender Types
... |
PHP | UTF-8 | 3,249 | 2.796875 | 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>
<style>
.content {
width: 450px;
margin: 0 auto;
... |
Python | UTF-8 | 7,009 | 3 | 3 | [] | no_license | """
Audio Pre-processing Classes
"""
import torch
from torch.utils.data import Dataset
import random
import librosa
import numpy as np
"""
Class to apply data pre-processing for model input
"""
class LoadAudio():
# load audio data
def load(audio_file):
data, sr = librosa.lo... |
PHP | UTF-8 | 1,387 | 2.96875 | 3 | [
"BSD-2-Clause"
] | permissive | <?php
Rhaco::import("lang.StringUtil");
/**
* @author Kazutaka Tokushima
* @license New BSD License
* @copyright Copyright 2008- rhaco project. All rights reserved.
*/
class DocFunction{
var $description;
var $name;
var $vars = array();
var $tests = array();
/**
* コンストラクタ
* @param string $name
* @param ... |
Python | UTF-8 | 331 | 2.703125 | 3 | [] | no_license | import urllib.request
from app.controllers.save_file import save_file
# download and save image from url
def from_url(url: str):
filename = url.split('/')[-1] # name with which the file will be saved at ./upload directory
with urllib.request.urlopen(url) as f:
data = f.read()
save_file(filen... |
Markdown | UTF-8 | 694 | 2.609375 | 3 | [] | no_license | ## Hello guys! 👋
- 😃 My name is Jelson.
- 📚 I am graduated in IT management and I am currently studying database technology and web development (HTML, CSS, JAVASCRIPT).

🌎 where to find me:
<a target="_blank" ... |
C++ | UTF-8 | 2,336 | 2.640625 | 3 | [] | no_license | #pragma once
#include "azer/effect/effect.h"
#include "azer/effect/effect_creator.h"
#include "azer/effect/light.h"
#include "azer/effect/material.h"
namespace azer {
class AmbientColorEffect : public Effect {
public:
static const char kEffectName[];
AmbientColorEffect();
~AmbientColorEffect();
const char* ... |
Java | UTF-8 | 1,936 | 2.609375 | 3 | [] | no_license | package com.samajackun.sumascript.core.instructions;
import com.samajackun.rodas.core.eval.Context;
import com.samajackun.rodas.core.eval.EvaluationException;
import com.samajackun.rodas.core.eval.EvaluatorFactory;
import com.samajackun.rodas.core.model.Expression;
import com.samajackun.sumascript.core.Execution... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.