language
stringclasses
15 values
src_encoding
stringclasses
34 values
length_bytes
int64
6
7.85M
score
float64
1.5
5.69
int_score
int64
2
5
detected_licenses
listlengths
0
160
license_type
stringclasses
2 values
text
stringlengths
9
7.85M
JavaScript
UTF-8
1,990
2.515625
3
[]
no_license
const { Router } = require("express"); const ItemService = require("../services/ItemService"); const itemService = new ItemService(); const itemRoutes = Router(); itemRoutes.get("/itemlist", async (request, response) => { const {owner} = request.query; const items = await itemService.list(owner); ...
Java
UTF-8
2,284
2.359375
2
[]
no_license
package com.person.springboot.controller; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMappi...
Java
UTF-8
202
1.625
2
[]
no_license
package com.devdezyn.mollysclub.auth.dtos; import lombok.*; @Data @NoArgsConstructor @AllArgsConstructor @Builder public class RegisterResponse { private String username; private String email; }
SQL
UTF-8
3,076
3.03125
3
[]
no_license
INSERT INTO fused_recipes(fused_name, date_created, date_modified, fuse_ingredients, fuse_steps, base_cuisine, fuse_cuisine) VALUES ( 'Fruit Crepes', '07/25/2020', '08/15/2020', '1 cup all-purpose flour 2 large eggs 1/2 cup milk 1/2 cup wate...
Java
UTF-8
1,799
2.359375
2
[]
no_license
package com.thomas.dahouet.controller; import java.util.ArrayList; import com.thomas.dahouet.DAO.proprioDAO; import com.thomas.dahouet.DAO.voilierDAO; import com.thomas.dahouet.GUI.Confirmation; import com.thomas.dahouet.GUI.NavireFrml; import com.thomas.dahouet.GUI.NewProprio; import com.thomas.dahouet.mode...
JavaScript
UTF-8
1,071
2.59375
3
[]
no_license
import $ from 'jquery'; import { GeneralView } from '../chatView/generalView.js' import { ChatView } from '../chatView/chatView.js' import { ChatModel } from '../chatModel/ChatModel.js' export class ChatController { constructor() { this.generalView = new GeneralView(); this.init(); const $a...
JavaScript
UTF-8
691
2.53125
3
[]
no_license
import { FETCH_CAT_DATA_START, FETCH_CAT_DATA_SUCCESS, FETCH_CAT_DATA_FAILURE} from "../actions"; const intitialState = { test: "test", isLoading: false, dogs: [], error: '' } export const reducer = (state = intitialState, action) => { switch (action.type){ case FETCH_CAT_DATA_START: ...
Python
UTF-8
358
2.875
3
[]
no_license
T = int(input()) for tc in range(1, T+1): N = int(input()) M = list(map(int, input().split())) Max = 0 for num, m in enumerate(M): if num == 0: Max = m elif Max < m: Max = m if Max <= M[0]: print(0) else: Sum = 0 for i in M: ...
Java
UTF-8
1,050
1.945313
2
[ "Apache-2.0" ]
permissive
package top.fosin.anan; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.cloud.client.SpringCloudApplication; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import top.fosin.anan.core.banner.AnanBanner; import top.fosin.anan.swagge...
Java
UTF-8
551
2.734375
3
[ "MIT" ]
permissive
package net.sf.l2j.log; import java.text.SimpleDateFormat; import java.util.logging.Formatter; import java.util.logging.LogRecord; public class FileLogFormatter extends Formatter { private static final String CRLF = "\r\n"; private static final String SPACE = "\t"; @Override public String format(LogRecord recor...
C++
UTF-8
3,582
3.484375
3
[]
no_license
#include <iostream> #include <cmath> #include <string> #include <sstream> #include <algorithm> #include <iterator> #include <vector> #include <stack> #include <queue> #include "assignment.h" using namespace std; //Function prototypes void ex1_reverse_array(); void ex1_reverse_vector(); void ex1_reverse_stack(); voi...
Python
UTF-8
5,442
2.84375
3
[]
no_license
__author__ = 's' import mysql.connector import numpy as np import datetime as d import copy import sys #establishing database connection cnx = mysql.connector.connect(user='root', password='', host='127.0.0.1', database='thesis') # get a cursor to execute sql...
C#
UTF-8
1,702
2.8125
3
[]
no_license
using System; using System.Windows.Forms; namespace Media.Calc.WinFormApp { public partial class GaussForm : Form { public string A { get; set; } public string B { get; set; } public string C { get; set; } public string X { get; set; } public GaussForm() ...
Java
UTF-8
15,375
2.234375
2
[]
no_license
// // $Id$ // // Narya library - tools for developing networked games // Copyright (C) 2002-2010 Three Rings Design, Inc., All Rights Reserved // http://www.threerings.net/code/narya/ // // This library is free software; you can redistribute it and/or modify it // under the terms of the GNU Lesser General Publ...
JavaScript
UTF-8
2,087
2.984375
3
[ "Apache-2.0" ]
permissive
getDoctorId(); function getDoctorId(){ let selectionOfDoctor = document.getElementById("searchByIdDoctor"); fetch("https://ipc1project2.herokuapp.com/get-id-specific-doctor",{ method:"POST", headers:{ 'Content-Type':'application/json' }, body: JSON.stringify({ ...
C++
UTF-8
472
2.875
3
[]
no_license
#pragma once #include <iostream> #include <memory> #include "RuleOf5Resource.h" namespace IGTK { namespace SmartPointerTests { void TestUniquePtr() { std::unique_ptr<RuleOf5Resource> p1 = std::make_unique<RuleOf5Resource>(); if (p1 != nullptr) { std::cout << "p1 is valid \n"; } // code block ...
Markdown
UTF-8
3,645
2.671875
3
[ "Apache-2.0" ]
permissive
--- title: "Data on Azure Storage" meta_title: "Azure Storage" meta_description: "Using data on Azure Storage in your Polyaxon experiments and jobs. Polyaxon allows users to connect to one or multiple blobs on Azure Storage to access data directly on your machine learning experiments and jobs." custom_excerpt: "Azure S...
Python
UTF-8
555
3.5
4
[ "Apache-2.0" ]
permissive
# Задача 2. Вариант 27. # Напишите программу, которая будет выводить на экран наиболее понравившееся # вам высказывание, автором которого является Овидий. Не забудьте о том, что # автор должен быть упомянут на отдельной строке. # Чернов Михаил Сергеевич # 28.05.2016 print("Верь опыту") print("\n\t\tОвидий") input("\n\...
Java
UTF-8
199
1.898438
2
[]
no_license
package app.MT102xml; import java.util.List; public interface MT102xmlService { public List<MT102xml> findAll(); public MT102xml save(MT102xml MT102xml); public MT102xml findOne(Long id); }
Markdown
UTF-8
3,877
2.859375
3
[ "MIT" ]
permissive
![go workers](https://raw.githubusercontent.com/catmullet/go-workers/assets/constworker_header_anim.gif) [![Maintainability](https://api.codeclimate.com/v1/badges/402fee86fbd1e24defb2/maintainability)](https://codeclimate.com/github/catmullet/go-workers/maintainability) [![Go Report Card](https://goreportcard.com/badg...
Java
UTF-8
22,393
1.734375
2
[ "Apache-2.0" ]
permissive
package com.base.action; import java.io.BufferedInputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.UnsupportedEncodingException; import java.text.ParseException; import ja...
Python
UTF-8
5,057
2.671875
3
[]
no_license
# Load the necessary libraries import numpy as np import json import pandas as pd from functions import similarity_check_Word2Vec, percentage_accuracy, CountFrequency # Deriving the list of random words csv1 = "data/random_single_lemma.csv" df_random_single_lemma = pd.read_csv(csv1) col = ['index', 'list'] df_random_...
Python
UTF-8
34,906
2.625
3
[ "MIT" ]
permissive
__author__ = 'Todd.Hay' # ------------------------------------------------------------------------------- # Name: BcsReader # Purpose: # # Author: Todd.Hay # Email: Todd.Hay@noaa.gov # # Created: Mar 13, 2015 # License: New BSD # ---------------------------------------------------------------...
JavaScript
UTF-8
2,179
3.5
4
[]
no_license
//blockchain.js 모듈을 이곳에서 가져다 쓰겠다. const Blockchain = require('./blockchain'); //위에서 가져온 모듈의 객체를 만든다. const bitcoin = new Blockchain(); //제네시스 블락 console.log(bitcoin) //제네시스 블락 ! // Blockchain { // chain: // [ { index: 1, // timestamp: 1527475657742, // transactions: [], // nonc...
Markdown
UTF-8
4,483
2.625
3
[]
no_license
![Repository Status](https://img.shields.io/badge/Author-Ruben%20Tjok-blue) <h1 align="center">Hi 👋, I'm Ruben Tjok 👋🏼 👨🏻‍💻</h1> <img src="https://github.com/ruben-tjok/ruben-tjok/blob/main/Ruben-Tjok.png?raw=true" alt="banner that says Ruben Tjok - software engineer, content creator."> > A Pro-active minded, ...
Python
UTF-8
173
3.109375
3
[]
no_license
class Student(object): name = 'i am a student' dan = Student() dan.name='i am dan' print(dan.name) print(Student.name) del dan.name print(dan.name) print(Student.name)
Java
UTF-8
1,098
1.757813
2
[]
no_license
package com.legaoyi.storer.tjsatl.service.impl; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import co...
C++
UTF-8
1,225
3.34375
3
[]
no_license
/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { TreeNode * buildTree(vector<int> &inorder, int l1, int r1, vector<int> &postorder, int l2, int r2) { ...
Java
UTF-8
35,290
2.015625
2
[ "MIT" ]
permissive
package com.github.enerccio.vaadin.fontawesome; import com.vaadin.server.FontIcon; import com.vaadin.server.GenericFontIcon; public enum FontAwesome implements FontAwesomeBase { BICYCLE("bicycle", 0xf206), CHURCH("church", 0xf51d), BOOK_READER("book-reader", 0xf5da), LAPTOP_HOUSE("laptop-house", 0xe066), ARROW_C...
PHP
UTF-8
631
3.421875
3
[]
no_license
<!doctype html> <html> <head> <meta charset="utf-8"> <title>Documento sin título</title> </head> <body> <?php $referencia=0; // estp Un paso por referencia, un vinculo entre la variable que se envia y a la variable de la funcion function incrementa(&$var) { $var++; return $var; }function incrementa2($var) { ...
PHP
UTF-8
445
2.5625
3
[]
no_license
<?php include 'src/backend/core/Helper.php'; function autoload($class_name) { # List all the class directories in the array. $array_paths = array( 'core/', 'core/Products' ); foreach($array_paths as $path) { $file = sprintf('src/backend/%s/%s.php', $path, $class_name); ...
C++
UTF-8
687
3.421875
3
[]
no_license
//思路是用一个辅助栈,来储存没有输出的元素,然后一直把输出序列跟栈顶比 //相同就输出栈顶,不相同就把下一个元素入栈 class Solution { public: bool IsPopOrder(vector<int> pushV,vector<int> popV) { if(pushV.empty()&&popV.empty()) return true; stack<int> inStack; while(!popV.empty()){ if(!inStack.empty()&&inStack.top()==popV[0])...
Markdown
UTF-8
886
2.78125
3
[]
no_license
# Project 2 Web Programming with Python and JavaScript My implementation has three files: application.py has all of the python and flask code that handles routing and maintaining the channels. index.html is the first page a user visits and tests whether a user has previously visited the site. If so, the user is w...
Java
UTF-8
5,879
2.734375
3
[]
no_license
package com.ko.na.database; import java.sql.ResultSet; import java.sql.Statement; import java.util.ArrayList; import com.ko.na.Family; import com.ko.na.FamilyTreeWriter; import com.ko.na.Person; public class FamilyTreeFactory extends SqlTable { protected PersonFactory pFact = null; public static f...
C#
UTF-8
8,790
2.671875
3
[]
no_license
using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; using YzkSoftWare.Data; namespace YzkSoftWare.Database { /// <summary> /// 数据库连接适配器接口 /// </summary> public interface IDatabaseAdptor : IDisposable ...
TypeScript
UTF-8
423
3.421875
3
[ "MIT" ]
permissive
/* @internal */ export class ConcatIterable<T> implements Iterable<T> { constructor( private readonly xs: Iterable<T>, private readonly ys: Iterable<T>, ) {} [Symbol.iterator]() { return concatIters(this.xs, this.ys) } } function* concatIters<T>(xs: Iterable<T>, ys: Iterable<T>...
Java
UTF-8
330
1.640625
2
[]
no_license
package com.kainos.discoverydiary.views; import com.kainos.discoverydiary.models.Book; import io.dropwizard.views.View; import java.util.List; /** * Created by annem on 03/11/2016. */ public class AdvancedSearchView extends View { public AdvancedSearchView() { super("/Views/books/advancedSearch.ftl")...
Java
UTF-8
608
2.515625
3
[]
no_license
package se.ltu.ajl; /** * This is a Temperature service */ public class TemperatureSevice extends Service { private String unit; // should it be a constant? private float value; private int timeStamp; ProviderBehaviour providerBehaviour; public TemperatureSevice(Prosumer system, String serviceT...
Markdown
UTF-8
5,984
3.25
3
[ "MIT" ]
permissive
### 前言 在学习完灰度、翻转、旋涡、马赛克滤镜后是不是觉得滤镜也就这么回事,今天学习抖音部分滤镜:缩放、灵魂出窍、抖动、闪白、毛刺,其中那个灵魂出窍我最喜欢。 ### 缩放滤镜 ![](http://cloud.minder.mypup.cn/blog/OpenGL%20ES%E6%8A%96%E9%9F%B3%E6%BB%A4%E9%95%9C-%E7%BC%A9%E6%94%BE.gif) 还记得那段时间嘛,满屏都是小姐姐就这样搞了我头晕,这个滤镜的原理以及实现就是改变顶点数据来达到这样的变化,顶点着色器的代码如下: ```c attribute vec4 position; attribute vec2 t...
Markdown
UTF-8
544
2.5625
3
[]
no_license
# Article L5556-5 La pension est, le cas échéant, assortie de la bonification pour enfants prévue à l'article L. 5552-22. Elle peut être reversée aux ayants droit survivants dans les conditions fixées aux articles L. 5552-27 à L. 5552-40. **Liens relatifs à cet article** _Anciens textes_: - Loi n°97-1051 du 18 ...
Markdown
UTF-8
8,850
3.453125
3
[ "MIT" ]
permissive
# GeneralizedSuffixTree An implementation of generalized suffix tree using Ukkonen's algorithm. **In this page:** - [The longest common substring problem](#the-longest-common-substring-problem) - [How it works](#how-it-works) - [GST versus Dynamic programming](#gst-versus-dynamic-programming) --- **Inspired by:** ...
Markdown
UTF-8
894
3.4375
3
[ "MIT" ]
permissive
> Developed with [Giuseppe Marino](https://github.com/giuseppe16180) ## Global thresholding This is a heuristic algorithm inspired by [Otsu's method](https://en.wikipedia.org/wiki/Otsu%27s_method). It divides the histogram in two by finding a good threshold value. The solution is obtained iteratively. At first, we s...
Go
UTF-8
841
3.53125
4
[]
no_license
package main /* 散列法:根据各元素的值来确定存储的位置,然后将位置保管在散列表中,从而实现数据的高速搜索 insert(data) T(h(data.key))=data [T为hash table,h为hash函数,data.key 为数据的关键字] search(data) return T(h(data.key)) 函数的返回值要求在0~m-1之间;m 为 哈希表T的大小 例如根据k值求下标 h(k) = k mod m 冲突: 不同k值对应同一个hash值。 开放地址法是解决hash冲突的常用手段之一。双散列结构中使用的开放地址法 H(k) = h(k,i) = (h1(k)+i*h2(k...
Java
UTF-8
687
2.0625
2
[]
no_license
package pom_class; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.PageFactory; public class FlipKart_ShoppingCartPage { @FindBy(xpath="//span[.='Place Order']") private WebElement orderlink; ...
Java
UTF-8
1,085
3.71875
4
[]
no_license
package collections; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; public class MinOfNumbers { public static void main(String[] args) throws Exception { List<Integer> integerList = getIntegerList(); ...
Java
UTF-8
1,588
2.109375
2
[]
no_license
package pow.jie.powmoji; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; import androidx.viewpager.widget.ViewPager; import android.os.Bundle; import com.google.android.material.tabs.TabLayout; import java.util.ArrayList; import java.util.List; import pow.jie.powmoji.adap...
Java
UTF-8
259
1.804688
2
[]
no_license
package pro.littleworld.webapp.model; public class Product { int id; String name; String description; double price; // Make this a valid Entity class // Create a ProductController, ProductService // and the form and the list }
Java
UTF-8
751
3.765625
4
[]
no_license
package test18; public class Constructure3 { Constructure3(){ System.out.println("평범한 날 호출하다니.."); } Constructure3(int a){ System.out.println("인트를 넣어야만 날 호출할 수 있다구!!"); } Constructure3(String str){ System.out.println("스트링이 필요해!!"); } /* * 생성자는 메소드와 비슷은함~ * 그래서 overloading이 가능함 * 즉 여러개의 생성자를 만들수 있다는...
Markdown
UTF-8
463
2.875
3
[]
no_license
# flask-jsSankey Sankey Chart using d3.js and Flask. The data source is a static CSV file: no header; each line in the format of _source, target, weight_ ## To run: 1. Make sure you have flask installed 2. `git clone https://github.com/yingchi/flask-jsSankey.git` 3. `cd flask-jsSankey` 4. `python app.py` Now naviga...
Python
UTF-8
5,769
3.53125
4
[]
no_license
"""Arvore de busca binaria. classes: No, Arvore implementada por Jonathas F. Silva """ class No(): """No basico para arvore binaria.""" def __init__(self, chave, dados): u"""Classe No é iniciada com: chave e dados. Atributos: pai - no pai chave - identificador...
Python
UTF-8
5,641
2.859375
3
[]
no_license
# -*- coding: utf-8 -*- from __future__ import print_function, division import sys import os.path import numpy as np import functools import librosa as lf """ Module for waveform effects motivation: audio data augmentation florencia @ 06.09.14 """ ########################################################...
C
UTF-8
316
3.171875
3
[ "Apache-2.0" ]
permissive
#include<stdio.h> // funcion que crea que comportamiento necesario int numbers(int p1, int p2, int p3, int p4, int p5, int p6, int p7){ if (p7>4){ return p1 + p2 + p3 + p4 - p5 - p6; } else{ return p1 + p2 + p3 + p4 + p5 - p6; } } //main int main () { printf("%d\n", numbers(1,1,1,1,1,1,3)); }
C++
UTF-8
487
2.84375
3
[]
no_license
#include "bits/stdc++.h" using namespace std; int main() { string str1, str2; while(cin >> str1 >> str2) { int Count = 0; for(int i = 0; i < str1.length(); i++) { for(int j = 0; j < str2.length(); j++) { if(str1[i] == str2[j]) ...
C++
UTF-8
945
3.0625
3
[]
no_license
#include "Checksum.h" uint16_t Checksum::crcIn; /* CRC algorithm */ #pragma optimize=none unsigned int crc16_byte(unsigned int crc, unsigned int data) { const unsigned int Poly16=0xA001; unsigned int LSB; crc = ((crc^data) | 0xFF00) & (crc | 0x00FF); for (uint8_t i=0; i<8; i++) { LSB=(crc & 0x0001); crc >>=...
Python
UTF-8
2,872
2.515625
3
[ "MIT" ]
permissive
from tqdm.autonotebook import tqdm import torch import numpy as np from sklearn.neighbors import KDTree import logging class BaseTester: def __init__(self, cfg, models, test_dataset, batch_size, dataloader_num_workers, ...
Java
UTF-8
1,999
2.640625
3
[]
no_license
package test; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.BufferedReader; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.Scanner; import org.apache.hadoop.conf.Configuration; impo...
Java
UTF-8
6,506
1.859375
2
[ "MIT" ]
permissive
/** * Copyright (c) 2013 Jose Cruz-Toledo * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, pub...
PHP
UTF-8
489
2.578125
3
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
<?php namespace Mikulas\Migrations; use Phinx\Migration\AbstractMigration; abstract class Migration extends AbstractMigration { const RESTRICT = 'RESCTRICT'; public static function restrict() { return [ 'delete' => self::RESTRICT, 'update' => self::RESTRICT ]; } /** * @param string $tableName ...
Python
UTF-8
806
2.78125
3
[]
no_license
# coding: utf8 import sys import os import MeCab sys.path.append(os.path.join(os.path.dirname(__file__), '..')) from model import Morpheme class MorphologicalAnalysis: sentence = "hello" def __init__(self, sentence): self.sentence = sentence def analysis(self): morpheme_list = [] mecab = MeCab.Tagger('') ...
Python
UTF-8
1,549
2.640625
3
[]
no_license
# -*- coding:utf-8 -*- def sort_vocab_by_length(vocab): return sorted(vocab, key=lambda x:len(x), reverse=True) keyword_0102 = ["肝", "胆", "胰", "脾", "左肾", "右肾", "甲状腺", "前列腺"] keyword_0102 = sort_vocab_by_length(keyword_0102) keyword_0222 = ["鼻中隔", "鼻甲", "外耳道", "鼓膜", "扁桃体", "其他", "口咽黏膜", "鼻腔黏膜及分泌物"] keyword_0222 =...
Java
UTF-8
1,195
1.84375
2
[]
no_license
package fortscale.spring; import fortscale.common.dataentity.DataEntitiesConfig; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.ImportResource; import org.springframework.context.annotation.PropertySource; i...
Python
UTF-8
402
2.671875
3
[]
no_license
from abc import ABC import gym class Env(gym.Env, ABC): def __init__(self, env): self.env = gym.make(env) self.action_dim = self.env.action_space.n self.state_dim = self.env.observation_space.shape[0] def get_action_dim(self): return self.action_dim def get_state_dim(sel...
JavaScript
UTF-8
179
2.96875
3
[]
no_license
console.log("Hello World"); function myFunction(a, b) { return a + b; } var x = myFunction(5, 10); console.log(x); console.log("I caused a merge conflict.");
C#
UTF-8
1,073
2.96875
3
[]
no_license
using Microsoft.EntityFrameworkCore; using SchoolMVC.Models; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace SchoolMVC.Repository { public class SchoolRepository : IRepository { public SchoolRepository() : base() { } public SchoolRepository(SchoolDbCont...
Shell
UTF-8
2,567
3.625
4
[ "Apache-2.0" ]
permissive
#!/usr/bin/env bash if [[ $# -eq 0 ]] ; then echo "Missing arguments." echo "Usage: bash install_mesos_cluster.bash masterHostname1,workerHostname1,workerHostname2,..." exit 0 fi cluster=$1 eval $(echo $cluster | awk '{split($0, array, ",");for(i in array)print "host_array["i"]="array[i]}') function checkSSH() {...
C++
UTF-8
514
3.171875
3
[]
no_license
#include "units/Days.h" #include "units/Nanoseconds.h" #include "units/Seconds.h" namespace units { Seconds::Seconds(const Nanoseconds &n) : m_value(double(n.toSeconds())) { } Seconds::Seconds(const Days &n) : m_value(double(n.toSeconds())) { } Nanoseconds Seconds::toNanoseconds() const ...
Markdown
UTF-8
321
2.59375
3
[ "MIT" ]
permissive
--- title: js-sort-array date: 2015-10-23 10:12:56 tags: js --- ## #code ``` /** * 对数组根据其首字母进行排序 * * @param arr * @returns {*} */ utils.sortArray = function (arr) { arr.sort(function (a, b) { return a.toLowerCase() < b.toLowerCase() ? -1 : 1; }); return arr; }; ```
Markdown
UTF-8
4,240
2.53125
3
[]
no_license
# LYRASOFT CLI 工具 這是為了 LYRASOFT 日常工作與建立設定檔所開發的方便工具。 ## 快速安裝 ```bash php -r "copy('https://raw.githubusercontent.com/lyrasoft/lyra-cli/master/resources/installer/lyra-cli-installer.php', 'lyra-cli-installer.php');" php lyra-cli-installer.php php -r "unlink('lyra-cli-installer.php');" ``` ## 一般安裝方式 快速安裝無法正確執行時,請依照以下...
JavaScript
UTF-8
3,002
2.890625
3
[]
no_license
class BankAccounts extends React.Component{ constructor(props){ super(props); this.fetchBankAccounts = this.fetchBankAccounts.bind(this); this.newAccount = this.newAccount.bind(this); this.deleteAccount = this.deleteAccount.bind(this); this.state = { bankAccounts: [], netCalculation: 0 }; } co...
Python
UTF-8
2,715
3.71875
4
[]
no_license
from multiprocessing import Pool def factorial(arr): result = 1 for i in arr: result *= i return result """Breaking input number into chunks and calculating factorial of each chunk""" def main(n, workers): # Creating a process pool with number of processes given when main functio...
Python
UTF-8
2,089
3.03125
3
[ "MIT" ]
permissive
# built-in import os.path from hashlib import sha256 from urllib.parse import unquote from typing import Optional # app from ._cached_property import cached_property from ._constants import IS_WINDOWS class _PathLink: def __init__(self, link: str): self.short = link.split('#')[0] self.long = link...
TypeScript
UTF-8
1,521
2.609375
3
[]
no_license
import { IContext } from "./lib"; import { userCreate, userJoin } from "../models/user"; import { codeScene } from "./lib/scenes"; import { mainMenuKeyboard, shareCodeKeyboard, retryCodeKeyboard, } from "./lib/keyboards"; export const register = { setup: function (bot: any): void { bot.action("create", tri...
Python
UTF-8
269
3.921875
4
[ "MIT" ]
permissive
def sum_occurrences(N): count = 0 square_N = N ** 2 for num in range(square_N + 1): for digit in str(num): count += str(N).count(str(digit)) return count # Example usage N = int(input()) result = sum_occurrences(N) print(result)
Java
UTF-8
1,033
2.21875
2
[]
no_license
package com.gkzxhn.wisdom.property.adapter; import android.content.Context; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.gkzxhn.wisdom.property.R; /** * Created by Raleigh.Luo on 17/9/11. */ public class Mess...
Java
UTF-8
1,510
2.125
2
[]
no_license
package api.pruebas; import java.sql.SQLException; import api.controlador.DAO.Dao_Producto; import api.modelo.Categoria; import api.modelo.Empresa; import api.modelo.Marca; import api.modelo.Producto; import api.modelo.Unidad_Medida; public class Prueba_InsertarProducto { public static void main(String[] args) { ...
PHP
UTF-8
7,997
2.734375
3
[ "MIT" ]
permissive
<?php namespace Tests\Type; use Closure; use Ukon\Math; use Tests\Stubs\Length\Metre; use Tests\Stubs\Length\Length; use Tests\Stubs\Weight\Weight; use PHPUnit\Framework\TestCase; use Tests\Stubs\Length\Centimetre; use Tests\Stubs\Length\Millimetre; use Ukon\Exceptions\DifferentTypeException; class SubtractTest exten...
C
UTF-8
1,531
2.765625
3
[]
no_license
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* l_del.c :+: :+: :+: ...
PHP
UTF-8
2,113
2.609375
3
[]
no_license
<?php namespace Mediacurrent\CiScripts\Command; trait Theme { /** * Theme Build command. * * theme:build runs the following - * * nvm use * npm install * npm run build * * @param string $pathToTheme Absolute path to the theme directory. * * @return object...
Shell
UTF-8
536
3.515625
4
[]
no_license
#!/bin/bash if [ $# -ne 1 ]; then echo $(ls ~/.config/bkgs | sed 's/.png//') exit 0 fi if ls ~/.config/bkgs/ | grep -q "$1.png" ; then # The image exists if ! $(themer list | grep -q "$1"); then # no theme yet, generate it echo N | themer -t myi3 generate "$1" ~/.config/bkgs/$1.png > /...
Python
UTF-8
591
2.8125
3
[]
no_license
import scipy.io as sio import numpy as np import matplotlib.pylab as plt data = sio.loadmat("data.mat") x = data.get("x") y = data.get("y") u = data.get("u") v = data.get("v") xit = data.get("xit") yit = data.get("yit") velocity_components = np.sqrt(u**2 + v**2) plt.figure() plt.subplot(2, 1, 1) plt.plot(xit, yit, "...
Go
UTF-8
771
2.5625
3
[]
no_license
package handler import ( "github.com/spf13/cobra" "github.com/kzmake/example-uber-go-dig/infrastructure/renderer" "github.com/kzmake/example-uber-go-dig/interface/controller" ) // TaskHandler ... type TaskHandler struct { controller *controller.TaskController renderer *renderer.TaskRenderer } // NewTaskHandl...
C++
UTF-8
2,465
2.953125
3
[]
no_license
#ifndef TYPE_HPP #define TYPE_HPP #include "ast.cpp" #include <iostream> Type* check(Context& cxt, Expr* e) { struct V : Expr::Visitor { Context& cxt; Type* r; V(Context& c) : cxt(c) { } void visit(Bool_expr* e) { r = &cxt.bool_type; } void visit(Int_expr* e) { r = &cxt.int_type; ...
Markdown
UTF-8
954
3.09375
3
[ "MIT" ]
permissive
# Getting Started Install the package using npm: ``` npm install --save cmd-ts ``` or if you use Yarn: ``` yarn add cmd-ts ``` ## Using `cmd-ts` All the interesting stuff is exported from the main module. Try writing the following app: ```ts import { command, run, string, positional } from 'cmd-ts'; const app =...
C#
UTF-8
388
2.640625
3
[ "MIT" ]
permissive
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace BridgeDesignPattern.Lab_2.Abstraction { public abstract class MailSenderBase { public void Save() { Console.WriteLine("Message saved..!"); } ...
Java
UTF-8
667
1.757813
2
[]
no_license
/** * */ package com.offact.salesb.service.history; import java.util.List; import org.json.simple.JSONArray; import com.offact.framework.exception.BizException; import com.offact.salesb.vo.history.SmsHistoryVO; /** * @author 4530 * */ public interface SmsHistoryService { /** * SMS이력 ...
C#
UTF-8
1,301
3.34375
3
[]
no_license
using System; using System.Collections.Generic; using System.Text; namespace bai1 { public class Post : IPost { private int Id; private string Title; private string Content; private string Author; private float AverageRate; public const int MinRating = 1; ...
C++
UTF-8
1,835
2.53125
3
[]
no_license
#include "gameobject.h" int GameObject::countID = 0; GameObject::GameObject() { } GameObject::GameObject(char *newName) { name = newName; numImages = 0; numFrames = 0; state = DEAD; onScreen = false; countID++; objectID = countID; } GameObject::~GameObject() { } void GameObject::set...
SQL
UTF-8
1,363
3.765625
4
[]
no_license
CREATE TABLE Executions ( id varchar(36) primary key, source_name varchar(16) not null, trigger_type varchar(32) not null, trigger varchar(512) not null, time_created timestamp not null ); CREATE INDEX Executions_source ON Executions(source_name, trigger_type, time_created); CREATE INDEX Executions_time ON Execut...
C#
UTF-8
1,136
2.578125
3
[]
no_license
using System; using System.Web.UI; using System.Web.UI.WebControls; public partial class _Default : Page { protected void SubmitButton_Click(object sender, EventArgs e) { // Done: // The SubmitButton_Click event handler of the partial _Default class is modified // so that if the page is valid, the message "Pa...
C++
UTF-8
1,364
3.875
4
[]
no_license
#include<bits/stdc++.h> using namespace std; struct node{ int val; node* next; }; node* head=NULL; void push(int key) { struct node* new_node=new node(); new_node->val=key; new_node->next=head; head=new_node; } int search(int key) { struct node* it=head; int pos=1; while(it!=NULL) { if(i...
Python
UTF-8
87
2.78125
3
[]
no_license
#import turtle as t #t.shape('turtle') #t.forward(100) #t.right(90) #t.forward(200)
C++
UTF-8
7,270
3.671875
4
[]
no_license
#include "puzzle.h" #include <iostream> #include <algorithm> int main(int argc, char* argv[]) { // Test the At function // Puzzle is // a b c // d e f // g h i Puzzle puzzle("abcdefghi", 3); if(puzzle.At({0,0}) != 'a') std::cout << "At((0,0))" << std::endl; if(puzzle.At({0,1}) != 'b') std::cout << ...
Java
UTF-8
1,082
2.34375
2
[]
no_license
package com.example.finalwork.alarm; import android.content.DialogInterface; import android.media.MediaPlayer; import android.os.Bundle; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import com.example.finalwork.R; public class AlarmActivity extends AppCompatActivity { ...
C++
UTF-8
1,201
3.34375
3
[]
no_license
#include "area.hh" //constructor geometry::Area::Area() { } //destructor geometry::Area::~Area() { showResult(surface_area); } double geometry::Area::rectangle(double length, double width) { auto result = static_cast<double>(length * width); return result; } double geometry::Area::square(double side) { ...
Ruby
UTF-8
2,012
2.546875
3
[]
no_license
require 'test_helper' class EntriesControllerTest < ActionController::TestCase test "index action returns reader's initial entries if no parameters specified" do feed = FactoryGirl.create(:feed) get :index, feed_id: feed.id assert_response :success entries_json = JSON.parse(@response.body)['entries...
JavaScript
UTF-8
1,274
2.859375
3
[]
no_license
/* Express as your framework, MongoDB as the database, and a package called body-parser to help deal with JSON requests. -Nodemon as a dev dependency. It’s a simple little package that automatically restarts your server when files change. */ const express = require('express'); const bodyParser = require('body-...
Java
UTF-8
244
1.703125
2
[]
no_license
package com.app.utb.springframeworkpetclinic.repositories; import com.app.utb.springframeworkpetclinic.model.Pet; import org.springframework.data.repository.CrudRepository; public interface PetRepository extends CrudRepository<Pet, Long> { }
Java
UTF-8
22,499
1.578125
2
[]
no_license
package com.suusoft.restaurantuser.main; import android.app.Dialog; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.Fra...
PHP
UTF-8
411
2.578125
3
[]
no_license
<?php namespace app\login\model; use app\common\model\Base; class Admin extends Base{ protected $dateFormat = 'Y-m-d H:i:s'; protected $type = [ 'logintime' => 'timestamp', ]; /** * 根据用户名查询管理员信息 */ static public function adminWithUserName($userName) { $model = Admin::...
Java
UTF-8
124
1.9375
2
[]
no_license
package view; import model.Image; import java.util.List; public interface ImageLoader { public List<Image> load(); }