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
Markdown
UTF-8
1,552
2.515625
3
[]
no_license
1.将对象交给容器管理,你只需要在spring配置文件总配置相应的bean,以及设置相关的属性,让spring容器来生成类的实例对象以及管理对象。在spring容器启动的时候,spring会把你在配置文件中配置的bean都初始化好,然后在你需要调用的时候,就把它已经初始化好的那些bean分配给你需要调用这些bean的类(假设这个类名是A),分配的方法就是调用A的setter方法来注入,而不需要你在A里面new这些bean了 2.请说明JAVA语言如何进行异常处理,关键字:throws,throw,try,catch,finally分别代表什么意义?在try块中可以抛出异常吗? 3.内存泄漏的原因:垃圾回收机制的不完善,引用计数法...
C++
UTF-8
1,952
2.546875
3
[]
no_license
#include <bits/stdc++.h> using namespace std; bool checkByNinga(vector<int> me,vector<int> nin) { if(me[0]==nin[0]||me[1]==nin[1]||(me[0]-me[1]==nin[0]-nin[1])||(me[0]+me[1]==nin[0]+nin[1])) return true; // find all valid knight positions of ninja int xMove[8] = { 2, 2, -2, -2, 1, 1, -1, -1 }; int yMove[8] ...
JavaScript
UTF-8
3,337
2.515625
3
[ "MIT" ]
permissive
function languageSelectionClick(lang) { var languageClick = 'Lang:' + lang; digitalData.event.eventInfo.language.pageLanguage = digitalData.page.pageInfo.pageName + '^' + languageClick; digitalData.event.eventName = 'Page Language'; digitalData.event.eventInfo.eventName = 'Language Dropdown'; digitalData.event.eve...
TypeScript
UTF-8
1,260
3.765625
4
[]
no_license
// radix sort O(n) function createBuckets() { const result = []; for(let i = 0; i < 10; i++) { result.push([]); } return result } function baseSort(nums: number[]) { for (let i = 0; i < 9; i++) { const buckets = createBuckets(); nums.forEach((num) => { buckets[M...
Markdown
UTF-8
1,065
2.578125
3
[ "Apache-2.0" ]
permissive
# coffeedates A little utility for generating matches for coffee dates. Matches are optimized for people who haven't been matched before, or if that is not possible, for matches in the more distant past. Run the utility to create a new dataset: ``` $> ./coffeeDates.py No Datasets available. You must create one firs...
Python
UTF-8
4,102
3.171875
3
[]
no_license
#!/usr/bin/python # -*- coding: utf-8 -*- import re import json import cpca while (1): try: address = input() if(address == "END"): break except EOFError: break if(address[0:2] == '1!'): #划分等级后删除标识符 flag = 1 address = address.strip('1!') ...
Java
UTF-8
2,090
3.515625
4
[]
no_license
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.util.Scanner; public class DummyProcessor { private Dummy pd; public DummyProcessor(Dummy d) { pd = d; } public void write() throws IOException { System....
Markdown
UTF-8
2,976
2.609375
3
[ "MIT" ]
permissive
--- title: 'GPO: User Backup To File Share' date: 2016-05-29T04:24:00+00:00 author: gerryw1389 layout: single classes: wide permalink: /2016/05/gpo-user-backup-to-file-share/ categories: - WindowsServer tags: - GroupPolicy - Backup --- <!--more--> ### Description: This is a quick user backup solution for users ...
C#
UTF-8
1,445
2.9375
3
[]
no_license
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace Cuaderno { public partial class Form1 : Form { public Form1() { ...
SQL
UTF-8
1,034
3.6875
4
[]
no_license
DROP DATABASE service_platform; CREATE DATABASE service_platform; USE service_platform; DROP USER 'iot4pwc'@'localhost'; FLUSH PRIVILEGES; CREATE USER 'iot4pwc'@'localhost' IDENTIFIED BY 'Heinz123!'; GRANT ALL PRIVILEGES ON service_platform.* TO 'iot4pwc'@'localhost'; DROP TABLE sensor_topic_map; DROP TABLE sensor_hi...
C#
UTF-8
3,735
2.6875
3
[]
no_license
using HairForceOne.WinFormsDesktopClient.Model; using Meziantou.Framework.Win32; using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Configuration; using System.Net.Http; using System.Net.Http.Headers; using System.Text; using System.Threading.Tasks; // håndter exceptions (custom excep...
C#
UTF-8
7,222
3.015625
3
[]
no_license
using System; using System.Collections.Generic; using System.Text; using System.IO; using System.IO.Compression; namespace ZipWork { public class ZipManager { private string wPath; private string wInfo; private string ZipFileName; // Total number of files inside each zip file...
JavaScript
UTF-8
5,302
2.953125
3
[]
no_license
//variables const database = firebase.database() const opt_div = document.getElementById('opt-div') const q_para = document.getElementById("q-para") const qNum_div = document.getElementById('qNum-div') const timer_div = document.getElementById('timer-div') const nxt_btn = document.getElementById('nxt') const quizApp =...
C++
UTF-8
885
2.515625
3
[]
no_license
#include <bits/stdc++.h> using namespace std; int main() { int len,g,p,r; while(scanf("%d %d",&len,&g),len||g){ vector<pair<int,int>> intervals; for(int i=0;i<g;i++){ scanf("%d %d",&p,&r); intervals.push_back({p-r,p+r}); } sort(intervals.begin(),intervals...
Python
UTF-8
763
3.5
4
[]
no_license
def permute(values): n=len(values) c=0 for i in (range(n-1)): if values[i]<values[i+1]: break c+=1 if c==n: values[:]=reversed(values[:]) return values c=0 for i in (range(n-1)): if values[i] > values[i+1]: break c += 1 ...
Rust
UTF-8
2,351
3.375
3
[ "MIT" ]
permissive
use crate::transformer::{TransformContext, UniqTransformer, Uniqueness}; use fake::faker::internet::raw::*; use fake::locales::EN; use fake::Fake; use serde::{Deserialize, Serialize}; /// Transformer generates random emails /// /// # Examples /// /// ```yaml /// #... /// rules: /// field_name: /// email: /// ...
Python
UTF-8
250
4
4
[]
no_license
# Dictionary Comprehension # Without Dict Comprehension (Conditional) dict1 = {} for n in range(10): if n%2==0 : dict1[n]=n*2 print(dict1) # With Dictionary Comprehension (Conditional) dict2 = {n:n*2 for n in range(10) if n%2==0} print(dict2)
C++
UTF-8
1,629
3.15625
3
[]
no_license
#include "StringTokenizer.h" #include <iostream> namespace sys{ StringTokenizer::StringTokenizer(const char* s) : m_string(s), m_tokens() {} StringTokenizer::~StringTokenizer() {} // from http://oopweb.com/CPP/Documents/CPPHOWTO/Volume/C++Programming-HOWTO-7.html const std::vector<std::str...
Shell
UTF-8
815
3.34375
3
[ "BSD-3-Clause" ]
permissive
#!/usr/bin/env bash # Copyright 2017, Reef Technologies (reef.pl), All rights reserved. PROJECT_DIR=`cd "$(dirname "${BASH_SOURCE[0]}")" && pwd` # Install pip packages if [ `pip freeze | wc -l` -le "1" ]; then echo "Installing pip development requirements" eval "pip install --upgrade -r ${PROJECT_DIR}/app/sr...
JavaScript
UTF-8
563
2.609375
3
[]
no_license
import { GET_ALL_INGREDIENTS, GET_INGREDIENT } from '../actions/types'; const initialState = { ingredient: null, ingredients: [], loading: true, error: {} }; export default function(state = initialState, action) { const { type, payload } = action; switch (type) { case GET_ALL_INGREDIENTS: retur...
Java
UTF-8
3,464
2.203125
2
[]
no_license
package edu.psu.ist.acs.micro.mid.scratch; import java.io.IOException; import java.util.List; import java.util.Random; import org.bson.Document; import edu.cmu.ml.rtw.generic.data.StoredItemSetInMemoryLazy; import edu.cmu.ml.rtw.generic.data.annotation.DocumentSetInMemoryLazy; import edu.cmu.ml.rtw.generic...
Java
UTF-8
276
1.992188
2
[]
no_license
package io.slack.blockchain.services.processing.exceptions; public class MissingDialogSubmissionException extends ProcessingException { private static final long serialVersionUID = 1L; public MissingDialogSubmissionException(final String message) { super(message); } }
Python
UTF-8
576
3.296875
3
[]
no_license
from collections import Counter from typing import List, Any def all_the_same(elements: List[Any]) -> bool: try: text = sorted(elements) count = Counter(text).most_common(len(elements)) if len(count) > 1: return False else: return True except TypeError: ...
Java
UTF-8
1,488
1.851563
2
[ "Apache-2.0" ]
permissive
/* * Copyright 2018-2020 adorsys GmbH & Co KG * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ...
Markdown
UTF-8
866
2.625
3
[]
no_license
# IPAdressingCSharp This repository demonstrates: - some experiments with different data structures to store IP addresses (`uint`, `byte[]`, `string`) - there is some *low-level byte-mangling* going on for the real nerds ;-) - shows how to use the dotnet `IPAddress`-class : `System.Net.IPAddress` - this makes...
Python
UTF-8
702
3.140625
3
[ "MIT" ]
permissive
class Country: # Complete the code for the initializer. The Country class has five private # properties: __countryName, __pop2007, __pop2008, __pop2009, __pop2010. # Note: Country names can stay as strings, but population data should be cast # to float! def __init__(self,line): # Complete the co...
Python
UTF-8
991
3.0625
3
[]
no_license
import pygame class Settings(): def __init__(self): self.bg_color = (0,0,0) #get information of the display winObject = pygame.display.Info() #gets height of the screen self.screen_height = winObject.current_h - int(winObject.current_h * 0.10 ) #gets width of the ...
JavaScript
UTF-8
4,617
3.328125
3
[ "MIT" ]
permissive
$('#search').on("click", function(){ //Prevents button from submitting form event.preventDefault(); //declares an empty variable to hold user input var word = ""; //catches user input, trims white space on ends, and makes it all lower case word = ($('#input').val().trim()).toLowerCase(); //all ...
C++
UTF-8
1,975
2.8125
3
[]
no_license
#include <iostream> #include <vector> using namespace std; const int N = 1e5; int father[N]; int sz[N]; // 以此节点为根节点的节点数量 // 并查集基本操作 void init(int n) { for (int i = 0; i < n; i++) { father[i] = i; sz[i] = 1; } } int find(int x) { return x == father[x] ? x : father[x] = find(father[x]); } ...
C++
UTF-8
515
2.8125
3
[]
no_license
#include<iostream> #include<cstdio> #include<map> using namespace std; int main() { map<int,int> m; map<int,int>::iterator p; int n,temp; cin >> n; for(int i = 0; i < n; i ++) { scanf("%d",&temp); p = m.find(temp); if(p == m.end()) m[temp] = 1; else p->second ++; } int max = m.begin()->f...
Markdown
UTF-8
3,357
4.28125
4
[]
no_license
# Practical-Sheet-04 - Encapsulation ### Q-01 Create a class called “Employee” which has 3 private variables (empID, empName, empDesignation) and create getters and setters for each field. Please note that this has no main method since this is just an added class to the console application. Inside the main class take u...
Python
UTF-8
2,393
3.4375
3
[ "Apache-2.0" ]
permissive
import os import sys import nltk from nltk.stem.snowball import EnglishStemmer from nltk.corpus import stopwords import pprint #Based on: http://tech.swamps.io/simple-inverted-index-using-nltk/ class Index: """ Inverted index datastructure """ def __init__(self, tokenizer, stemmer=None, stopwords=None): ...
Python
UTF-8
1,704
2.515625
3
[]
no_license
""" Expose the memfd create method. """ import sys import os import mmap import socket import struct import time import ctypes import fcntl import platform machine = platform.machine() __NR_memfd_create = 356 if machine == 'x86_64': __NR_memfd_create = 319 elif machine == '__i386__': __NR_memfd_create = 356 el...
Java
UTF-8
1,196
2.375
2
[]
no_license
package lk.ac.mrt.cse.dbs.simpleexpensemanager.data.impl; import android.content.Context; import java.util.Date; import java.util.List; import lk.ac.mrt.cse.dbs.simpleexpensemanager.data.TransactionDAO; import lk.ac.mrt.cse.dbs.simpleexpensemanager.data.model.DatabaseHelper; import lk.ac.mrt.cse.dbs.simpleexpenseman...
C
UTF-8
335
3.40625
3
[]
no_license
#include <stdio.h> int get_flag(const char *str) { if (str[0] == 'z') { puts(str); return 0; } else { puts("no"); return 1; } } int main(int argc, char **argv) { int ret; if (argc != 2) { printf("usage: %s <flag>\n", argv[0]); return 1; } ret = get_flag(argv[1]); printf("ret value: %d\n", ret);...
Java
UTF-8
558
2.21875
2
[]
no_license
package com.future.function.common.exception; import javax.validation.ConstraintViolation; import javax.validation.ConstraintViolationException; import java.util.Collections; import java.util.Set; @SuppressWarnings("squid:MaximumInheritanceDepth") public class BadRequestException extends ConstraintViolationException ...
Python
UTF-8
309
3.15625
3
[]
no_license
def strings_eq2_first_last(list): count = 0 for i in list: if (len(i) >= 2) and (i[0] == i[-1]): #print(i) count +=1 return count print(strings_eq2_first_last(['aba', 'xyz', 'aa', 'x', 'bbb'])) print(strings_eq2_first_last(['x', 'xy', 'xyx', 'xx', '']))
C++
UTF-8
3,951
2.53125
3
[]
no_license
#include <vector> #include <list> #include <map> #include <set> #include <queue> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <cstdio> #include <cmath> #include <cst...
Java
UTF-8
71
1.5
2
[]
no_license
package Traitements; public enum TypeSVC { LancementES,FinPrgm; }
Java
UTF-8
263
1.6875
2
[]
no_license
package com.example.cuni.service; import java.util.Map; import com.example.cuni.dto.Member; public interface MemberService { Map<String, Object> join(Map<String, Object> param); Member getMemberByLoginId(String loginId); Member getMemberById(int id); }
Markdown
UTF-8
8,124
3.125
3
[ "MIT" ]
permissive
--- layout: post title: "밑바닥부터 시작하는 딥러닝3 - STEP 18" date: 2021-01-17 12:15:15 author: Hoon categories: 딥러닝 --- ---- #### 필요 없는 미분값 삭제 기존의 DeZero에서는 모든 변수가 미분값을 변수에 저장해두고 있다. ~~~python x0 = Variable(np.array(1.0)) x1 = Variable(np.array(1.0)) t = add(x0, x1) y = add(x0, t) y.backward() print(y.grad, t.grad) prin...
Java
UTF-8
1,603
2.75
3
[]
no_license
package com.intsmaze.redis.model; import java.util.ArrayList; import java.util.List; import redis.clients.jedis.JedisPoolConfig; import redis.clients.jedis.JedisShardInfo; import redis.clients.jedis.ShardedJedis; import redis.clients.jedis.ShardedJedisPool; public class ShardedJedisPoolDemo { public static void main...
Java
UTF-8
398
1.625
2
[]
no_license
/** * generated by Xtext 2.21.0 */ package dk.chcla15.mathinterpreter.mathAssignmentLanguage; /** * <!-- begin-user-doc --> * A representation of the model object '<em><b>Mult</b></em>'. * <!-- end-user-doc --> * * * @see dk.chcla15.mathinterpreter.mathAssignmentLanguage.MathAssignmentLanguagePackage#getMult(...
PHP
UTF-8
1,882
2.703125
3
[ "MIT" ]
permissive
<?php /** * This file is part of the ImboClientCli package * * (c) Christer Edvartsen <cogo@starzinger.net> * * For the full copyright and license information, please view the LICENSE file that was * distributed with this source code. */ namespace ImboClientCliTest; use ImboClientCli\Application, ImboClie...
Markdown
UTF-8
4,389
3.015625
3
[]
no_license
# FakeView English Document. 顾名思义,假的View。 开发Android应用时,特别是开发一个通用列表时,列表中基本只使用ImageView和TextView,且不会使用其中很多功能。 FakeView就是为了提取出日常使用较多,且容易造成layout层级过多或过度绘制而导致页面卡顿(主要是滑动卡顿)的View,经过处理后,合并层级,减少过度绘制。 附带减少view层级的[工具](Tools.MD) 新增[NewText](NewText.MD)强力推荐 ## 原理 FakeView提取出在屏幕绘制一个控件最基本的动作:创建-计算-布局-绘制,并将其封装为FView和FViewGroup,分...
Java
UTF-8
364
2.734375
3
[]
no_license
package uri; import java.util.*; public class MainClass { public static void main(String[] args) { // TODO Auto-generated method stub Scanner input=new Scanner(System.in); int i,n; //m=input.nextInt(); n=input.nextInt(); for(i=1;i<=n;i++) { if(i%2==0) { int m=i*i; System.out.println...
Python
UTF-8
443
3.015625
3
[]
no_license
""" 然而,标准库中所有执行阻塞型 I/O 操作的函数,在等待操作系统返回 结果时都会释放 GIL。这意味着在 Python 语言这个层次上可以使用多线 程,而 I/O 密集型 Python 程序能从中受益:一个 Python 线程等待网络响 应时,阻塞型 I/O 函数会释放 GIL,再运行一个线程。 因此,尽管有GIL,Python 线程还是能在 I/O 密集型应用中发挥作用。 """
Markdown
UTF-8
85,813
2.71875
3
[ "MIT" ]
permissive
# mattata mattata is a powerful, plugin-based Telegram bot similar to [topkecleon's](https://github.com/topkecleon/otouto). mattata boasts many nifty features such as a fully-fledged administration plugin, AI (native Cleverbot implementation, which utilises my [mattata-ai](https://github.com/wrxck/mattata-ai) library)...
Java
UTF-8
715
2.65625
3
[]
no_license
package com.yihang; /** * @Author: yihangjou(周逸航) * @Site: www.yihang.ml * @cnBlogs: https://www.cnblogs.com/yihangjou/ * @Date: create in 2020/7/17 22:35 */ public class TestDemo { static void tune(Rodents r) { r.play(10); r.eat(); System.out.println("------------------"); } ...
C++
UTF-8
864
2.75
3
[]
no_license
// // Created by michal on 08.01.19. // #include "SocketPuller.h" #include <unistd.h> #include <cstdio> #include <sys/select.h> #include <iostream> SocketPuller::SocketPuller(int socketDescriptor): socketDescriptor(socketDescriptor) {} bool SocketPuller::canRead(){ fd_set rfds; FD_ZERO(&rfds); FD_SET(s...
Java
UTF-8
6,841
1.789063
2
[ "Apache-2.0" ]
permissive
/* Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distribut...
Java
UTF-8
529
2.015625
2
[]
no_license
package vn.com.qlthuvien.repository; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; import vn.com.qlthuvien.model.BookCategory; import vn.com.qlthuvien.model.C...
Java
UTF-8
326
2.5625
3
[]
no_license
package model; public class NoteText { private String text; public String getText() { return text; } public void setText(String text) { this.text = text; } public void printText() { System.out.println(text); System.out.println("__________________________"); ...
C++
UTF-8
1,047
2.796875
3
[]
no_license
#ifndef _triangle_hpp_ #define _triangle_hpp_ 1 namespace bigcpp { namespace chapter2 { class Point { private: double x{0.0}; double y{0.0}; public: Point(double x, double y): x{x}, y{y}{}; inline double get_x(){return this->x;}; ...
Java
UTF-8
323
1.726563
2
[]
no_license
package com.smeshariks.pms.dto; import lombok.Data; import lombok.NoArgsConstructor; @Data @NoArgsConstructor public class MaterialDto { private String title; private String description; private Integer balance; private Integer cost; private Integer minimumVolume; private Integer isEquipment;...
Java
UTF-8
2,676
2.765625
3
[ "MIT" ]
permissive
package com.wennersanner.libraryapi.repository; import com.wennersanner.libraryapi.model.Book; import org.assertj.core.api.Assertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.beans.factory.annotation.Auto...
Java
UTF-8
1,624
2.546875
3
[]
no_license
package com.xpf.android.retrofit.mvp.base; import android.os.Bundle; import androidx.annotation.Nullable; import android.util.Log; /** * Created by x-sir on 2019/4/19 :) * Function:带有生命周期的所有 Presenter 的基类 * {@link # https://github.com/xinpengfei520/RxJavaRetrofit2Demo} */ public abstract class MvpBasePresenter<V ...
Java
UTF-8
232
1.625
2
[]
no_license
package com.liu.service; public interface LoginService { Integer getLoginInfoAdm(String id,String password); Integer getLoginInfoStu(String id, String password); Integer getLoginInfoTea(String id, String password); }
PHP
UTF-8
953
3.203125
3
[]
no_license
<?php $today = date("d"); $today2 = date("m"); $today3 = date("Y"); $todayt =date("H:i:s:A"); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Dates</title> </head> <style> small { color: green; font-size...
JavaScript
UTF-8
537
2.796875
3
[]
no_license
'use strict'; (function () { var ESC_KEYCODE = 27; var ENTER_KEYCODE = 13; var LEFT_MOUSE_BUTTON_CODE = 0; var ENTER_KEY = 'Enter'; var isEscEvent = function (evt, action) { if (evt.keyCode === ESC_KEYCODE) { action(); } }; var isEnterEvent = function (evt, action) { if (evt.keyCode ==...
Java
UTF-8
1,720
1.585938
2
[]
no_license
// isComment package privacyfriendlyshoppinglist.secuso.org.privacyfriendlyshoppinglist.ui.products.dialog.listeners.price; import android.text.InputFilter; import android.text.Spanned; import privacyfriendlyshoppinglist.secuso.org.privacyfriendlyshoppinglist.R; import privacyfriendlyshoppinglist.secuso.org.privacyfri...
Markdown
UTF-8
1,938
3
3
[ "MIT" ]
permissive
![Project Presentation](https://github.com/bytesbay/web3-token/raw/main/resources/logo.jpg "Web3 Token") # Web3 Token Web3 Token is a new way to authenticate users. A replacement for JWT in hybrid dApps. See [this article](https://medium.com/@bytesbay/you-dont-need-jwt-anymore-974aa6196976) for more info (later I'll ...
JavaScript
UTF-8
797
2.984375
3
[ "MIT" ]
permissive
$(document).ready(function(){ var quotes,authors,ran,newquote,newauthor,colors,newcolor; function getquote(){ quotes=["I'm hopeless and awkward and desperate for love.","I drink and I know things","I'm against having emotions, not against using them"]; authors=["-Chandler Bing","-Tyrion Lannister","-Harve...
C++
UTF-8
691
3.5
4
[]
no_license
#include "Person.h" using namespace std; Person::Person() { this->name = "No name"; this->mail = "no@mail.com"; } Person::Person(string name, string mail) { this->name = name; this->mail = mail; } string Person::getName() const { return name; } string Person::getMail() const { return mail; ...
Java
UTF-8
942
2.578125
3
[]
no_license
package com.rd.familytree.utils; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class PBTester { public static void main(String[] args) { ProcessBuilder pd = new ProcessBuilder("ssh", "-q", "-o", "\"StrictHostKeyChecking no\"", "qassp@10.50.152.223", "whoami")...
C++
UTF-8
1,800
2.75
3
[]
no_license
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef double ld; #define L 25 // Kevin Mathew T // Birla Institute of Technology, Mesra // GitHub - https://github.com/KevinMathewT // CodeForces - https://codeforces.com/profile/KevinMathew // CodeChef - https://www.codechef.com/users/KevinMathew /...
JavaScript
UTF-8
652
3.09375
3
[]
no_license
/** * 防抖 * 立即执行版实现 * @param {*} func * @param {*} wait * @param {*} immediate * @returns */ export function debounce(func, wait, immediate) { let timeout; return function () { const context = this; const args = arguments; if (timeout) clearTimeout(timeout); if (immediate) { // 立即执行 ...
Python
UTF-8
1,551
3.75
4
[]
no_license
#Exercise Question 3: Read all product sales data and show it using a multiline plot # Display the number of units sold per month for each product using multiline plots. (i.e., Separate Plotline for each product for each product). import pandas as pd import matplotlib.pyplot as plt df = pd.read_csv('company_sales_d...
Markdown
UTF-8
2,192
3.171875
3
[]
no_license
# Adverity assignment solution Here it is Kotlin/SpringBoot solution for given assignment. Main idea is to use SpringEL as a parser for expression and calculate group-by, filter, and fields values dinamically by SpringEL framework. ## Usage and main syntax Central model class is `ClickRow` which is the abstaction fo...
Java
UTF-8
618
2.609375
3
[]
no_license
package rmitest; import java.rmi.RemoteException; import java.rmi.server.UnicastRemoteObject; /** * * @author Derek * Defines the actual functions for the RMI. */ public class RMIDemoFunct extends UnicastRemoteObject implements RMIDemo { /** * Required for a Serializable Object */ private static final lo...
C#
UTF-8
7,842
3.421875
3
[]
no_license
using System; using System.Collections.Generic; namespace Battleship { public class Program { private const String PossibleColumns = "ABCDEFGH"; public ShipLocation Board1ShipLocation { get; set; } public ShipLocation Board2ShipLocation { get; set; } public readonly List<Lo...
C#
UTF-8
550
2.578125
3
[ "MIT" ]
permissive
using System.Text.RegularExpressions; public class PasswordFieldView : InputFieldView { Regex expectedString = new Regex("^.{22,}$"); protected void Start() { input.onValueChanged.AddListener( delegate { ValueChangeCheck(); } ); input.asteriskChar = "•"[0]; } protected override void ValueChangeCheck() { ...
Go
UTF-8
456
3.125
3
[]
no_license
package types type UnsignedShort uint16 func (short UnsignedShort) Encode(w Writer) (err error) { err = w.WriteByte(byte(short << 8)) err = w.WriteByte(byte(short)) return } func (short UnsignedShort) Decode(r Reader) (n int, err error) { var ( s1 byte //stream short 1 s2 byte //stream short 2 ) s1, err =...
Python
UTF-8
1,247
2.703125
3
[]
no_license
#-*- coding: UTF-8 -*- import pandas as pd import numpy as np from operator import itemgetter import time import copy def save_res(res): try: fp = open("F:\\ss\\py\\taobao\\output_data\\0320\\0320_3.txt","w+") for item in res: fp.write(str(item)+"\n") fp.close() except IOErr...
Rust
UTF-8
815
3.1875
3
[]
no_license
//$(which true); dst=/var/tmp/sut; out=${dst}/$0.bin; //$(which mkdir) -p ${dst}; //$(which rustc) -o "${out}" 1>&2 "$0" && "${out}" "$@"; exit $? ////////////////////////////////// // macros do not have namespaces!! ////////////////////////////////// macro_rules! say { // matches no argument () => { ...
Python
UTF-8
1,988
4
4
[]
no_license
#### # Stuart Kettenring # 6/27/2014 # # Because I do not have any projects to use as examples # of my programming, I have taken a few problems from # projecteuler.net and solved them here. I hope this # serves as a decent example of my programming abilities. ## import time #### # Helper functions ## #Will determi...
C++
UTF-8
1,559
3.5625
4
[]
no_license
// Program to use the dictionary lookup program #include <stdio.h> #include <string.h> #include<stdlib.h> #include <stdbool.h> struct entry { char word[15]; char definition[50]; }; bool equalStrings (const char s1[], const char s2[]) { int i = 0; bool areEqual; while ( s1[i] == s2 [i] && s1[i] != '\0' && s2[i] != '\...
Python
UTF-8
1,079
3.875
4
[]
no_license
import random rand = random.randint(0, 999) print("\nThis program generates a random number between 0 and 999") print("Please try and guess it!") b = 0 def guess(): global b global rand d = input("\nWhat is your guess? \n \n") b = b+1 strcheck(d) a = int(d) if a == rand: print("\nGood Job, you did it!") pr...
JavaScript
UTF-8
2,868
2.578125
3
[ "MIT" ]
permissive
const { buildYup } = require("../src"); let valid; test("yup inserts custom messages for required fields", () => { const message = { title: "users", type: "object", required: ["username"], properties: { username: { type: "string", matches: "foo" }, }, }; const config = { errMessages...
JavaScript
UTF-8
3,154
2.71875
3
[ "MIT" ]
permissive
// We commonly need to grab the url where we are or came from for our animation scenes // By default this will return a string enter- + the url path without domain var getEnterExitString = function(e) { var url = e + '-' + $(location).attr('pathname').replace(/\//g, ''); console.log(url) return url; } // Smooths...
C++
UTF-8
1,265
4.125
4
[ "LicenseRef-scancode-warranty-disclaimer", "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
#include <functional> #include <iostream> #include <mutex> #include <thread> #include <vector> using namespace std; /// List containing elements that cannot be removed class ThreadSafeGrowingList { private: mutex vec_mutex; // protects volatile data vector<int> vec; // contains data public: /// Thread-safe wrap...
C++
UTF-8
2,205
2.703125
3
[]
no_license
using VI = vector <int>; using VVI = vector <VI>; template <typename C> struct Edge { int to; int cp; C cap; Edge() {} Edge(int pt, C pcap, int pcp) : to(pt), cap(pcap), cp(pcp) { } }; template <typename C> class FlowGraph { using VE = vector <Edge<C>>; using VVE = vector <VE>; const C INF = 100...
C++
UTF-8
931
3.03125
3
[]
no_license
#include <iostream> #include <chrono> #include <thread> #include <mutex> #include <deque> #include <functional> #include <vector> #include <iterator> #include <algorithm> class thread_guard { public: std::thread t; explicit thread_guard(std::thread myt): t(std::move(myt)) { if(!t.joinable()) throw ...
Markdown
UTF-8
5,751
3.484375
3
[]
no_license
## JavaScript 标准对象 --- ### 内置对象 *内置对象*(internal object)指的是 JavaScript 核心语言中所包含的类与对象。它们直接由 ECMAScript 标准定义,与运行环境没有关系,但任何 JavaScript 环境都必须预先按照标准实现这些对象,无论是台式计算机,还是移动设备,抑或是手掌大小的单片机。内置对象与语法本身,构成了 JavaScript 的核心语言。 内置对象既包含真真正正的对象(如 `Math`),又包括基本类型所对应的类(如 `Number`)和建立其他一些对象的类(如 `Promise`),还有一些就是单纯的函数和变量(如 `parseIn...
Ruby
UTF-8
2,916
4.9375
5
[ "MIT" ]
permissive
require 'pry' =begin Convert a String to a Signed Number! In the previous exercise, you developed a method that converts simple numeric strings to Integers. In this exercise, you're going to extend that method to work with signed numbers. Write a method that takes a String of digits, and returns the appropriate numb...
Java
UTF-8
1,688
4.34375
4
[]
no_license
import java.util.*; import java.io.*; public class Main { public static void main(String[] args) { // Create tasks Runnable task1 = new Task1(1000000); Runnable task2 = new Task2(1000000); // Create threads Thread thread1 = new Thread(task1); Thread thread...
Java
UTF-8
1,265
1.84375
2
[]
no_license
package com.ps.credit.card; import com.ps.credit.card.repository.CreditCardRepository; import javax.annotation.PostConstruct; import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import ...
Java
UTF-8
797
2.015625
2
[]
no_license
package orderTest; import baseTest.BaseTest; import org.junit.Test; public class OrderTest extends BaseTest { @Test public void orderOrnaments() { homePage .openHomePage() .clickOnShoppingBagButton() .checkShoppingBagIsEmpty() .clickOnNextLog...
Java
UTF-8
893
2.78125
3
[ "Unlicense" ]
permissive
package za.co.blts.samples.i18n; import java.util.Locale; import java.util.ResourceBundle; /** * @author Kholofelo Maloma * @since 3/23/2017. */ public class JavaI18nExample { public static void main(String[] args) { //Default bundle ResourceBundle resourceBundle = ResourceBundle.getBundle("Ap...
JavaScript
UTF-8
1,272
3.203125
3
[ "Apache-2.0" ]
permissive
// A GameObject should be a geometric shape + a "draw" function // Eventually this should include a path to an image or animation const drawing = require('./drawing'); const physicsSettings = require('./physicsSettings').physicsSettings; const Victor = require('victor'); // Basic object just bundles a shape with a w...
TypeScript
UTF-8
2,259
3.421875
3
[]
no_license
import { NumberDial, radix } from './number-dials'; export const maxDigits = 3; export const minDigits = 1; export const power = maxDigits; /** * ## Model: NumberGroup * - Represent a group of number dials that collectively represent a number. * - Is iterable: start from the ends (`first`, `last`) and iterate us...
Java
UTF-8
7,461
1.796875
2
[]
no_license
package org.meta_environment.rascal.interpreter.load; import java.io.ByteArrayInputStream; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.MalformedURLException; import java.net.URL; import java.util.Collections; import java.util.LinkedList; import java.util.List...
Java
UTF-8
301
2.296875
2
[]
no_license
package com.dimitrisli.springHibernateMySQL.dao; import com.dimitrisli.springHibernateMySQL.model.Person; public interface PersonORMDao { public void create(Person person); public Person read(String name, String surname); public void update(Person person); public void delete(Person person); }
C#
UTF-8
1,226
3.6875
4
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ProgrammingRecovery.Recoveries { class FormatChecker { // This application takes an input and tells you if the input is a number or not public void FormatCheck() ...
PHP
UTF-8
473
3.140625
3
[ "MIT" ]
permissive
<?php namespace App\Exceptions; use Exception; class AppException extends Exception { protected string $status; public function __construct( string $message, string $status = 'error', int $statusCode = 400 ) { $this->message = $message; $this->status = $status; $this->statusCode = $sta...
C++
UTF-8
544
2.703125
3
[]
no_license
#include <iostream> #include <string> #include <clocale> using namespace std; int main() { setlocale(LC_CTYPE, "rus"); float a,b,s; string c; cin>>a>>b; cin>>c; if (c == "+"){ s=a+b; cout<<s<<endl; }else if (c == "-"){ s=a-b; cout<<s<<endl; }else if (c ==...
Swift
UTF-8
460
2.515625
3
[ "MIT" ]
permissive
// // RoundedView.swift // AtlasSDK // // Created by Yelyzaveta Kartseva on 19.05.2021. // import UIKit class RoundedView: BaseView { // MARK: - Properties @IBInspectable var cornerRadius: CGFloat = 8.0 { didSet { self.layer.cornerRadius = self.cornerRadius } } ...
Java
UTF-8
3,677
2.15625
2
[]
no_license
package com.cpe.backend; import com.cpe.backend.Addjob.entity.Addjob; import com.cpe.backend.Addjob.repository.AddjobRepository; import com.cpe.backend.Addjob.entity.Information; import com.cpe.backend.Addjob.repository.InformationRepository; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Befor...
C#
UTF-8
2,486
3.296875
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DeepInCShape { class 匿名方法捕获变量 { //static void Main(string[] args) //{ // // EnclosinMethod(); // //Methhod02(); // Method03(); //...
JavaScript
UTF-8
1,972
2.921875
3
[ "MIT" ]
permissive
class Partido{ constructor(nombre = "", dipu =0, imagen= "") { this.nombre=nombre; this.dipu=dipu; this.imagen=imagen; } } function success(data){ console.log("Ha ido todo guay"); //console.log("Objetos devueltos: " +data); let listado =[]; for (index in data){ l...