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
3,353
2.53125
3
[]
no_license
# Ansible module: ansible.module_netapp_e_amg NetApp E-Series create, remove, and update asynchronous mirror groups ## Description Allows for the creation, removal and updating of Asynchronous Mirror Groups for NetApp E-series storage arrays ## Requirements TODO ## Arguments ``` json { "api_password": "{'re...
C++
UTF-8
805
2.625
3
[]
no_license
#ifndef MOVIE_H #define MOVIE_H #include <QImage> #include <QString> #include <QVector> #include "GenericRegistry.h" #include "IdentifiedObject.h" class Movie : public IdentifiedObject { public: Movie(); QString name() const; void setName(const QString &name); QString description() const; void setDescript...
JavaScript
UTF-8
776
2.828125
3
[]
no_license
window.onload = function() { var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function(){ if(this.readyState == XMLHttpRequest.DONE && this.status == 200) { var data = this.responseText; var jsonResult = JSON.parse(data); console.log(jsonResul...
Java
UTF-8
2,614
2.796875
3
[]
no_license
package com.lipan.crud.test; import java.io.*; import java.text.*; import java.util.*; public class poidata { /** * @param args */ public static void main(String[] args) { try { long starTime = System.currentTimeMillis(); int recordNum=7389;//记录条数 String ID[]=new String[re...
Python
UTF-8
4,473
2.796875
3
[ "MIT" ]
permissive
from gtts import gTTS import pyaudio import queue import base64 import os SYS_BEEP_PATH = os.path.join(os.getcwd(),"assets/beepbeep.wav") class MicrophoneStream(object): """Opens a recording stream as a generator yielding the audio chunks.""" def __init__(self, rate, chunk): self._rate = rate ...
Markdown
UTF-8
431
2.546875
3
[]
no_license
# Pokemón Local Search This is a `vanilla.js` implementation using the data from the [Pokémon Api](https://pokeapi.co). Currently the search does partial match, shows the images of the Pokémon (front and back) and shows the results paginated in groups of 12 items. ## Tested on * Chrome (>= 60) * Opera (>= 47) * Saf...
Java
UTF-8
7,073
1.84375
2
[]
no_license
package b.a.a.x; import android.view.Choreographer; import b.a.a.c; import b.a.a.d; public class e extends a implements Choreographer.FrameCallback { /* renamed from: d reason: collision with root package name */ public float f2319d = 1.0f; /* renamed from: e reason: collision with root pac...
Python
UTF-8
392
3.734375
4
[]
no_license
print('ЛИСТЫ', '\n', '***'*10) a = [2,3,4,5,7,6] print(a) a.append('Python') print('First:', a[0], 'Last:', a[-1]) print(a[2:4]) print(len(a)) print(a.index(6)) a.remove('Python') print(a) print('СЛОВАРИ', '\n', '***'*10) user = {'name':'Masha', 'age':25, 'have_airplain':False} print(user['name']) print(user...
Markdown
UTF-8
4,407
2.609375
3
[ "MIT" ]
permissive
--- layout: post title: Spark 作业执行流程 subtitle: date: 2019-11-05 author: danner header-img: img/post-bg-ios9-web.jpg catalog: true tags: - Spark - YARN --- 本文是接着 [spark-shell 脚本剖析](https://vendanner.github.io/2019/10/25/spark-shell-%E8%84%9A%E6%9C%AC%E5%89%96%E6%9E%90/),上文描述作业最终是通过 `org.ap...
JavaScript
UTF-8
527
2.59375
3
[]
no_license
var axios = require("axios"); var cheerio = require("cheerio"); var scrape = function() { return axios.get("http://www.nytimes.com").then(function(res) { var $ = cheerio.load(res.data); var articles = []; $(".theme-summary").each(function(i, element) { var head ...
C
UTF-8
454
4.46875
4
[ "MIT" ]
permissive
/* Exercise 1 - Calculations Write a C program to input marks of two subjects. Calculate and print the average of the two marks. */ #include <stdio.h> int main() { int mark1,mark2,tot; float avg; printf("Enter mark for subject 1 :"); scanf("%d",&mark1); printf("Enter mark for subject 2 :"); scanf("%d"...
JavaScript
UTF-8
1,811
3.03125
3
[]
no_license
const faker = require('faker'); const fs = require('fs'); let generateFishermen = () => { let fishermen = []; for (let id = 1; id < 11; id++) { let firstName = faker.name.firstName(); let lastName = faker.name.lastName(); let email = faker.internet.email(); let contact = faker....
Python
UTF-8
9,306
2.640625
3
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
from pox.core import core from collections import defaultdict import pox.openflow.libopenflow_01 as of from pox.lib.packet.ethernet import ethernet from pox.lib.packet.arp import arp from pox.lib.util import str_to_bool import networkx as nx import json from itertools import islice import random log = core.getLogger()...
Java
UTF-8
305
1.773438
2
[]
no_license
package com.busan.cw.clsp20120924.interfaces; import com.busan.cw.clsp20120924.model.PointModel; public interface PointModelCallback { public void onPointLoadStart(PointModel model); public void onPointLoadComplete(PointModel model); public void onPointLoadError(PointModel model, String message); }
Python
UTF-8
275
3.171875
3
[]
no_license
def convert_to_dict(args: dict): json = dict() for key, value in args.items(): if "len" in key: pass key_vals = str(key).split("_") last_index = len(key_vals) json[str(key_vals[last_index-1])] = value return json
TypeScript
UTF-8
167
2.828125
3
[]
no_license
import Turn from 'src/Enums/Turn'; const updateTurn = (currentTurn: Turn): Turn => { return currentTurn === Turn.X ? Turn.O : Turn.X; }; export default updateTurn;
Markdown
UTF-8
5,519
2.53125
3
[ "Apache-2.0", "CC-BY-4.0" ]
permissive
# Docs & Community SIG meeting - 2021-05-11 Facilitator and meeting notes: Stephen Tramer ## Overall notes * For this first meeting participants are encouraged to submit a pull request to these notes adding contact information, filling out names, and other information that will help us collaborate as we start bringi...
C
UTF-8
305
3.03125
3
[]
no_license
#include"CircularQueue.h" int main() { CQueue *q; QueueInit(&q); QueuePush(&q, 1); QueuePush(&q, 2); QueuePush(&q, 3); QueuePush(&q, 4); QueuePush(&q, 5); QueuePrintf(&q); QueuePop(&q); QueuePop(&q); QueuePrintf(&q); printf("%d ", QueueFront(&q)); printf("%d ", QueueBack(&q)); return 0; }
Ruby
UTF-8
1,024
3.96875
4
[]
no_license
# 해쉬 생성 방법 # {}로 감싸고 , 로 성분을 구분한다 # 각 성분은 :키 => 값 형태로 입력한다 # : 이것은 심볼이라고 부른다. resume = {:name => "Steve", :isMale => true, :age => 30} puts "Avengers resume" puts resume # 빈 해쉬 만들고 성분 추가하기 avengers = Hash.new avengers[:name] = "Tony Stark" avengers[:isMale] = true avengers[:age] = 45 puts "Tony Stark's information...
Java
UTF-8
2,825
2.109375
2
[]
no_license
package pageobjects.EmailAdmin.ManageList; import org.openqa.selenium.By; import org.openqa.selenium.ElementNotVisibleException; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.ui.ExpectedConditions; import pageobjects.AbstractPageObject; import pageobjec...
C#
UTF-8
1,024
3.265625
3
[]
no_license
using System; namespace pelda_if_shortcircuit { class Program { static bool Teszt1() { Console.WriteLine("Teszt1 kiértékelése..."); return false; } static bool Teszt2() { Console.WriteLine("Teszt2 kiértékelése..."); retu...
Swift
UTF-8
1,259
2.78125
3
[]
no_license
// // ViewController.swift // StopJavaScript // // Created by Juanjo Ramos Rodriguez on 31/10/2019. // Copyright © 2019 JJR. All rights reserved. // import JavaScriptCore import UIKit class ViewController: UIViewController { @IBOutlet private weak var startButton: UIButton! @IBOutlet private weak var can...
Python
UTF-8
665
2.921875
3
[]
no_license
from bs4 import BeautifulSoup import requests URL_LINK="<URL_LINK_HERE>" body = requests.get(URL_LINK) soup = BeautifulSoup(body.text, 'html.parser') list_of_images = soup.find_all('img') #print(list_of_images) source = [img['src'] for img in list_of_images] imageCount=0 for i,link in enumerate(source): with ...
C#
UTF-8
1,704
2.515625
3
[]
no_license
using GoldenLion.Entity; using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Threading.Tasks; using Xamarin.Forms; namespace GoldenLion { public partial class MainPage : ContentPage { UserAccountManager userAccountMan...
C#
UTF-8
4,297
2.671875
3
[]
no_license
using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Me...
C++
UTF-8
734
2.59375
3
[ "MIT" ]
permissive
#include <bits/stdc++.h> using namespace std; int main(){ int t; cin>>t; while(t--){ int n; cin>>n; map<char, int> mp; queue<char> qu; char x; for(int i=0; i<n; i++){ cin>>x; if(mp.find(x) == mp.end()){ qu.push(...
Python
UTF-8
1,310
3.109375
3
[]
no_license
import Tkinter as tk import tkFileDialog from src.main.com.personal.conversions.ImagesToPDF import ImagesToPDF directory = "" def display_in_center(window, width=400, height=400, title="My App"): """ :param window: :param width: :param height: :param title: :return: """ ws ...
Java
UTF-8
3,307
2.203125
2
[]
no_license
package org.rz.midiplayer.xmlmodule.midispec; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for Sp...
Swift
UTF-8
474
2.703125
3
[ "MIT" ]
permissive
// // Parser.swift // uncomplicated-todo // // Created by Vladislav Morozov on 27/04/2019. // Copyright © 2019 misshapes. All rights reserved. // import Foundation class Parser<T: Decodable> { static func decode(_ data: Data) throws -> T { let decoder = JSONDecoder() decoder.dateDecodingStrate...
Rust
UTF-8
290
2.8125
3
[]
no_license
pub trait Stack<T> { fn empty(&self) -> bool; fn push(&mut self, x: T); fn pop(&mut self) -> T; fn length(&self) -> usize; } pub trait Queue<T> { fn empty(&self) -> bool; fn enqueue(&mut self, x: T); fn dequeue(&mut self) -> T; fn length(&self) -> usize; }
Java
UTF-8
1,604
3.28125
3
[]
no_license
package CCC._06; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.Scanner; public class J4_ItsToughBeingATeen { static HashMap<Integer, ArrayList<Integer>> limit=new HashMap<>(); static HashMap<Integer,ArrayList<Integer>> lock=new HashMap<>(); static void add(int f...
Rust
UTF-8
3,659
2.65625
3
[]
no_license
use mc_core::block::{Block, BlockState}; use mc_core::rand::JavaRandom; use mc_vanilla::block::*; use mc_vanilla::block::material::TAG_LEAVES; use crate::view::LevelView; use super::Feature; pub struct PlantFeature { block: &'static BlockState, try_count: u32, // search_floor: bool, can_plant_predi...
C++
UTF-8
261
2.703125
3
[]
no_license
#include <iostream> #include <cstring> using namespace std; int main() { string str; int size; getline(cin,str); size = str.size(); int data[size ]; int out[size + 1]; out[0] = 0; out[1] = 1; for(int i = 0; i < size; i++) data[i] = str[i] - '0'; }
C
UTF-8
839
4
4
[]
no_license
/*25. Write a C program that reads an integer between 1 and 12 and print the month of the year in English. Go to the editor Test Data : Input a number between 1 to 12 to get the month name: 8 Expected Output: August */ #include<stdio.h> int main() { int a; printf("Input a number between 1 to 12 to get the month nam...
Java
UTF-8
607
2.71875
3
[]
no_license
package coreservlets; /** From <a href="http://courses.coreservlets.com/Course-Materials/">the * coreservlets.com tutorials on servlets, JSP, Struts, JSF, Ajax, GWT, and Java</a>. */ public class Employee { private Name name; private Company company; public Employee(Name name, Company company) { setName...
Java
UTF-8
893
2.546875
3
[]
no_license
package com.example.gxtspringdemo.client.event; import com.example.gxtspringdemo.shared.model.Book; import com.google.gwt.event.shared.EventHandler; import com.google.gwt.event.shared.GwtEvent; public class BookAddedEvent extends GwtEvent<BookAddedEvent.BookAddedHandler> { private static Type<BookAddedHandler> TY...
C
UTF-8
699
2.609375
3
[]
no_license
#include<stdio.h> #include<string.h> int main() {//memset(c,0,sizeof(c)); long long int n,k=0,i,j; long long int c[105],mark=0,sum=1; long long int num=0,first=0,last=0,first1=0,last1=0; memset(c,0,sizeof(c)); scanf("%lld",&n); for(i=0;i<n;i++) scanf("%lld",&c[i]); for(i=0;i<n;i++) {if(c[i]==1) {first=i; br...
PHP
UTF-8
4,498
3.0625
3
[]
no_license
<?php class User{ protected $db; protected $user_name; protected $user_email; protected $user_pass; protected $has_pass; function __construct($db_connection) { $this->db = $db_connection; } // signUp User function signUp($username, $email, $password){ ...
Swift
UTF-8
1,506
2.734375
3
[]
no_license
// // FlickerPic.swift // virtualTourist // // Created by Sergio Costa on 31/07/18. // Copyright © 2018 Sergio Costa. All rights reserved. // // let flickerPic = try? JSONDecoder().decode(FlickerPic.self, from: jsonData) import Foundation struct FlickerPic: Codable { let photoAlbum: PhotoAlbum? let sta...
TypeScript
UTF-8
1,163
3.71875
4
[ "MIT" ]
permissive
/** * 포맷팅 기능을 제공합니다. * * @export * @class StringFormatter */ export class StringFormatter { /** * 숫자에 1000 단위 구분자를 추갛해서 문자열로 출력합니다. * * @param {(number | string)} value * @param {string} delimiter 구분자; 기본값: **,** 콤마 문자 * @returns {string} * @memberof StringFormatter */ pu...
C#
UTF-8
1,223
2.703125
3
[]
no_license
using Ionic.Zip; using System; using System.Drawing; using System.Drawing.Imaging; using System.Threading; namespace _91appExcelCreator { internal class PictureTheme { public Color BackgroundColor { get; set; } public string Words { get; set; } public int Width { get; set; } pu...
Python
UTF-8
991
3.171875
3
[]
no_license
class Solution(object): def calculate(self, s): """ :type s: str :rtype: int """ stack = [] result, number, sign = 0, 0, 1 for n in s: if n.isdigit(): number = number * 10 + int(n) else: if n == "+": ...
SQL
UTF-8
2,430
3.109375
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 5.0.3 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Tempo de geração: 26-Nov-2020 às 21:39 -- Versão do servidor: 10.4.14-MariaDB -- versão do PHP: 7.2.34 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_C...
Go
UTF-8
1,880
3.625
4
[]
no_license
package boogie import "github.com/davecgh/go-spew/spew" /* CtxState defines a state machine we can use to parse lines of code. */ type CtxState int const ( // START sets an undefined state, used as a jumping off point. START CtxState = 0 + iota // LABEL sets the label state LABEL // KEYWORD sets the keyword sta...
Java
UTF-8
1,086
2.921875
3
[]
no_license
package com.hibernate.hibernateproj; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.Transaction; import org.hibernate.cfg.Configuration; public class Client { //public void save1(int id, String name) method for servlet public void save1(Employee emp) { S...
Markdown
UTF-8
1,107
2.953125
3
[ "Apache-2.0" ]
permissive
# shadow-relay 没有什么阻碍是一个搭载 shadowsocks 的 vps 翻不过去的;如果有,那就再来一个! 此命令可以将连接到本台电脑的指定端口的流量转发至目标机器的目标端口, 并接收返回的报文转发至源Ip, 用来转接Shadowsocks再合适不过了。 值得注意的是,此命令重启后需要重新设置。 命令: ``` relay local_ip local_port dest_ip dest_port ``` 其中, + local_ip 表示本机想要用来处理流量转发的网上的ip + local_port 表示本机接收流量的端口号 + dest_ip 表示目标机器的ip + dest_port 表示目...
Java
UTF-8
1,989
2.453125
2
[]
no_license
package ohopro.com.ohopro.adapter; import android.content.Context; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.FrameLayout; import android.widget.TextView; import java.util.ArrayList; import ohopro.c...
PHP
UTF-8
1,226
2.609375
3
[]
no_license
<?php function match_get_raw($conn, $userid = null) { $stmt=mysqli_stmt_init($conn); $stmt->prepare("SELECT id, username, firstname, lastname, prefs FROM users"); $stmt->execute(); $result = mysqli_stmt_get_result($stmt); $rowCount = mysqli_num_rows($result); $data = array(); for($i = 0; $i < $rowCount; $...
Markdown
UTF-8
2,299
3.046875
3
[]
no_license
![](https://github.com/JoannePeel/A-deadly-mexican-story/blob/master/A%20Deadly%20Mexican%20History.jpg) # A-deadly-mexican-story ## Project background In Mexico, there have been important changes in the **epidemiological occurrence of diseases**, related to: Environmental, demographic, economic, social, and cultur...
Python
UTF-8
1,095
2.90625
3
[]
no_license
import pyarex as pa import datetime def unix_time_ms(dt): epoch = datetime.datetime.utcfromtimestamp(0) return int((dt - epoch).total_seconds() * 1000.0) # Initalize the needed datasources. Right now this is hardcoded into the initializer, so for config you need to manage this yourself. data_provider = pa.ini...
Markdown
UTF-8
5,690
3.171875
3
[]
no_license
# DataFrame 向量化运算 ### Pandas shift() Pandas shift() 函数的文档可以在[这里](http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.shift.html)找到。如果你仍不确定函数的运行机制,请一边尝试一边了解! ### pandas.DataFrame.shift `DataFrame.``shift`(*periods=1*, *freq=None*, *axis=0*)[[source\]](http://github.com/pandas-dev/panda...
PHP
UTF-8
2,414
2.671875
3
[]
no_license
<?php namespace App\Telegram\Classes; use Telegram\Bot\Keyboard\Keyboard; use Telegram\Bot\Laravel\Facades\Telegram; class Characters extends TelegramBase { private $inlineKeyboard; private $requestPage; public function __construct($chatId, $requestPage = 1) { parent::__construct($chatId);...
JavaScript
UTF-8
1,072
2.53125
3
[]
no_license
import React, { Component} from 'react'; import { connect } from 'react-redux'; import moment from 'moment' import { submitForm } from '../actions'; class Greeting extends Component { render() { const { user } = this.props; if (!user) { return <div className='greeting-box'></div> ...
Go
UTF-8
447
2.5625
3
[]
no_license
package main import ( "Gin/src/controllerUse/routers" "github.com/gin-gonic/gin" ) func main() { router := gin.Default() //方法一 把匿名函数写到一个文件里变成实名的抽离出去,缺点是无法实现controller的继承 routers.AdminRouters(router) //方法二 把路由中处理业务的个个方法绑定到结构体,这样可以继承,推荐使用! routers.ApiRouters(router) router.Run(":8888") }
Java
UTF-8
1,272
2.203125
2
[]
no_license
/** * Proyecto: IMSS - SSDC * * Archivo: MenuDaoImpl.java * * Creado: Nov 7, 2011 * * Derechos Reservados de copia (c) - INAP / * * Instituto Mexicano del Seguro Social - 2011 */ package mx.gob.imss.cia.ssdc.cdv.integracion.dao.impl; import java.util.ArrayList; import java.util.List; impor...
PHP
UTF-8
2,253
3.1875
3
[ "MIT" ]
permissive
<?php /** * CouchRequest * * @author Alexander Thiemann */ class CouchRequest { const COUCH_GET = 'GET'; const COUCH_DELETE = 'DELETE'; const COUCH_POST = 'POST'; const COUCH_PUT = 'PUT'; private $url = ""; private $method = CouchRequest::COUCH_GET; private $data = null; private $...
C++
UTF-8
3,030
2.9375
3
[ "MIT" ]
permissive
// Given an undirected graph, find all bridges and articulation points // Idea: perform a DFS to form a DFS spanning tree, an edge u-v is a bridge if and only if there is a back edge connecting a descendant of v and an ancestor of u // This is an important to concept in Tarjan's algorithm to find strongly connected com...
Python
UTF-8
794
3.84375
4
[]
no_license
class FancyPrint: # declare needed ANSI escape sequences for colorful output to console __BLUE = '\033[94m' __RED = '\033[91m' __YELLOW = '\033[93m' __END = '\033[0m' # string "message" will be displayed in the corresponding color # when highlighting a single character, "line_end" can be mo...
Python
UTF-8
657
3.9375
4
[]
no_license
# https://www.hackerrank.com/challenges/two-strings/problem?h_l=interview&playlist_slugs%5B%5D%5B%5D=interview-preparation-kit&playlist_slugs%5B%5D%5B%5D=dictionaries-hashmaps def twoStrings(s1, s2): """ Determines whether two strings share a common substring. Parameters: s1 (string): s2 (string):...
Java
UTF-8
480
1.789063
2
[]
no_license
package com.twowaits.password.kuncika.ui.main; import java.util.ArrayList; import androidx.recyclerview.widget.LinearLayoutManager; import dagger.Module; import dagger.Provides; @Module public class MainViewModule { @Provides AppsAdapter provideAppsAdapter() { return new AppsAdapter(new ArrayList<>(...
Python
UTF-8
136
3.359375
3
[]
no_license
n = int(input()) count = 0 for i in range(0,n): inp = input() inps = inp.split(" ") if inps.count("1") >= 2: count+=1 print(count)
Java
UTF-8
1,091
2.0625
2
[]
no_license
package com.xiguo.www.group.entity; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import lombok.*; import org.hibernate.annotations.Table; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import ja...
Python
UTF-8
11,467
2.78125
3
[]
no_license
import pygame #from pygame import mixer from enum import Enum from player import Player from switch import Switch from collections import OrderedDict import world import graphics from pygame.locals import * pygame.font.init() myfont = pygame.font.SysFont('Times New Roman', 30) pygame.init() pygam...
Java
UTF-8
4,120
2.328125
2
[]
no_license
package com.yelp.android.g; public class j<E> implements Cloneable { private static final Object a = new Object(); private boolean b = false; private int[] c; private Object[] d; private int e; public j() { this(10); } public j(int paramInt) { if (paramInt == 0) { c = b.a; ...
Python
UTF-8
7,784
2.84375
3
[]
no_license
# bigraph class # last edit: 7/28 ################CHANGES############ # ##########TODO############## # change variable and method names to be more clear ######################BUGS####################### # ##############CURRENTLY WORKING ON########## # from operator import itemgetter import string from decimal impor...
Python
UTF-8
2,272
2.546875
3
[]
no_license
"""Socket client implementation.""" import selectors import socket from rcr.exception import CloseConnectionError, ConnectionError from rcr.type import ConnectionEvent from .base_client import BaseClient class SocketClient(BaseClient): """Socket client implementation class.""" def __init__(self, *args, **k...
Python
UTF-8
1,630
2.546875
3
[ "Apache-2.0" ]
permissive
# coding=utf-8 # Copyright 2022 Google LLC. # # 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 ...
Shell
UTF-8
209
2.921875
3
[]
no_license
#!/bin/env bash cd `dirname $0` cat ../network.txt | while read line; do cfg=`bash config_filter.sh $line` sudo bash ../quagga/create_config.sh $cfg \ && echo "create config file ($cfg)" done
JavaScript
UTF-8
4,952
2.578125
3
[]
no_license
import React, { useState } from 'react' import '../../styles/components/ContactForm.scss' function ContactForm(props){ let btnTimeout = null const btnStates = { WAIT: { text: 'Sending message...', class: 'wait' }, DEFAULT: { text: 'Send message', ...
Go
UTF-8
1,151
2.59375
3
[ "MIT" ]
permissive
package imports import ( "bytes" "encoding/csv" "fmt" "io" "testing" ) const csvData = ` "Mon, 02 Jan 1993 00:00:00 +0300";+25482;"start";start "Sat, 05 Nov 2016 19:39:58 +0300";-2010;"flat";flat "Sun, 06 Nov 2016 05:39:58 +0300";-19000;"flat";flat "Sun, 06 Nov 2016 05:39:58 +0300";-190;"fee";fee "Mon, 07 Nov 20...
Markdown
UTF-8
21,738
2.96875
3
[ "MIT" ]
permissive
# GridWorlds A package for creating grid world environments for reinforcement learning in Julia. This package is designed to be lightweight and fast. This package is inspired by [gym-minigrid](https://github.com/maximecb/gym-minigrid). In order to cite this package, please refer to the file `CITATION.bib`. Starring t...
PHP
UTF-8
2,016
2.828125
3
[]
no_license
<?php namespace Ionut\Crud\Form; use Ionut\Crud\Crud; use Ionut\Crud\Utils\OptionsGroup; class Style { protected $defaults = [ 'before' => null, 'after' => null, 'wrap' => null ]; /** * @var Crud */ private $crud; public function __construct(Crud $crud) {...
Java
UTF-8
900
2.328125
2
[]
no_license
import java.awt.*; public class ShapeO extends Tetromino { public static final int rotationStep = 0; public static final int rotationStepMax = 0; public static final int[][][] grid2 = {{{1,1,0,0}, {1,1,0,0}, ...
Shell
UTF-8
665
2.515625
3
[ "MIT" ]
permissive
#!/bin/sh alias c=clear if type hx >/dev/null 2>&1; then alias vim=hx fi if type exa >/dev/null 2>&1; then alias ls="exa --classify --icons --grid" alias ll='exa --classify --icons --long' alias tree="exa --tree --icons" else alias ls='ls -FG' alias ll='ls -lh' fi alias l="ls" alias la="l -a" alias lla="...
Python
UTF-8
3,433
2.890625
3
[]
no_license
import cv2 import numpy as np from matplotlib import pyplot as plt import scipy.misc import sys import os from sklearn.cross_validation import train_test_split from sklearn.neighbors import KNeighborsClassifier from sklearn import svm import itertools import operator #user defined import binarizeModule import textDete...
Java
UTF-8
1,523
2.15625
2
[]
no_license
package com.cg.ddms.entity; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.Table; import javax.validation.constraints.Pattern; import org.springframework.format.annotation.NumberFormat; @Entity @Table(name="user_datab") publ...
Java
UTF-8
4,895
3.125
3
[]
no_license
import java.util.ArrayList; //import util.Util; public class SupplierManager { // 거래처 관리 클래스 // 거래처 관리 기능 모음 SupplierManager(){ si.add(new SupplierBasicInfo("이천쌀전문","01099342242","서울시 종로구 어디어디","쌀",100)); si.add(new SupplierBasicInfo("단무지공장","01023456789","인천시 남동구 어디","단무지",50)); si.add(new Supp...
Python
UTF-8
2,645
3.453125
3
[]
no_license
Waldo = 'W' Other = '.' def all_row_exists_waldo(collection): """For all rows in the matrix, Waldo is in some column""" for row in collection: if Waldo not in row: return False return True def all_col_exists_waldo(collection): """For all columns in the matrix, Waldo is in some row"...
Markdown
UTF-8
12,929
2.609375
3
[]
no_license
--- layout: default title: "More alternatives to Google Analytics" permalink: /writings/more-google-analytics-alternatives/ description: "Some heavier replacements for Google Analytics, and a brief look at log-based analytics tools" canonical_url: https://lwn.net/Articles/824294/ --- <h1><a href="{{ page.permalink }}">...
C
UTF-8
1,372
3.140625
3
[ "MIT" ]
permissive
#pragma once #include <gsl/gsl_sf_zeta.h> #include <cmath> double real_trigamma_cmplxarg(double x, double y, int m, int l){ //compute the real part of the trigamma function at z = x + iy using //my accelerated series formula //argument should have positive real part (x > 0) //m gives the number of zet...
Markdown
UTF-8
2,546
2.546875
3
[]
no_license
{{Station Infobox | Station Name = 行政中心站 | Engname = Xingzhengzhongxin station | Linecolor1 = red | Linecolor2 =#{{西安地铁线路标志色|4}} | Image = XINGZHENGZHONGXIN sta.JPG | Caption = | Location = [[西安市|西安市]][[未央区|未央区]] | Coord = | Type = 地下车站 | Line = 2号线<br>4號線 | Hall ...
Java
UTF-8
1,984
3.125
3
[]
no_license
package LuckyTickets; import java.io.*; /** * Created by chris on 1/13/2016. */ public class Main { public static void main(String[] args) throws IOException { // File file = new File(args[0]); // BufferedReader br = new BufferedReader(new FileReader(file)); BufferedReade...
Markdown
UTF-8
1,032
2.953125
3
[ "MIT" ]
permissive
# Twittbot [![Gem Version](https://badge.fury.io/rb/twittbot.svg)](http://badge.fury.io/rb/twittbot) [![Inline docs](http://inch-ci.org/github/nilsding/twittbot.svg?branch=master)](http://inch-ci.org/github/nilsding/twittbot) Twittbot is the next generation of my old Twitter bot, `twittbot-nd`. ## Installation Insta...
Swift
UTF-8
5,196
2.796875
3
[]
no_license
// // CardCollectionViewDataSource.swift // CardCollectionView // // Created by Kristofer Kline on 7/4/18. // Copyright © 2018 Kristofer Kline. All rights reserved. // import UIKit typealias Object = NSObject // TODO: Add addition state handling of images to retry for failed images. enum CellState: Hashable { ...
Java
UTF-8
288
1.835938
2
[]
no_license
package com.iacsd.project.UserDao; import org.springframework.data.jpa.repository.JpaRepository; import com.iacsd.project.entity.Claim; public interface ClaimInterface extends JpaRepository<Claim, Integer> { Claim getByClaimId(int claimId); Claim getByPolicyNum(int policyNum); }
C#
UTF-8
2,234
2.734375
3
[ "MIT" ]
permissive
using System; namespace log4net.Util.TypeConverters { /// <summary> /// Supports conversion from string to <see cref="T:System.Type" /> type. /// </summary> /// <remarks> /// <para> /// Supports conversion from string to <see cref="T:System.Type" /> type. /// </para> /// </remarks> /// <seealso cref="T:log4ne...
C++
UTF-8
1,256
2.515625
3
[ "MIT" ]
permissive
#pragma once #include <cstdint> #include <stdexcept> #include <string> namespace lw { namespace error { class Exception : public std::runtime_error { public: Exception(const std::int64_t code, const std::string& message): std::runtime_error(message), m_error_code(code) {} // ------------...
Python
UTF-8
150
3.21875
3
[]
no_license
acres = float(input("informe o valor de area em acres : " ) ) metros = acres*4048.58 print("o valor de area em metros quadrados (m2) é : ", metros)
Java
UTF-8
500
2.171875
2
[]
no_license
package demo2; /** * @author : jiang * @time : 2018/3/20 18:06 */ public class PersonServiceImpl implements PersonService { @AopTest(desc = "xxxx") @Override public void save(String name) { System.out.println("do save"); } @Override public void update(String name, Integer id) { ...
C
UTF-8
631
2.984375
3
[ "Apache-2.0" ]
permissive
#include <stdio.h> #include <stdlib.h> #include <sys/file.h> #include <sys/stat.h> #include <unistd.h> #include <fcntl.h> #include <sys/types.h> int main(){ int flag=1; char op1; char op2; char space; int o1,o2,o3; printf("start \n"); while(1){ //prima la fase di read read(0,&op1,1); read(0,&space,1); read(0,&op2,1); f...
PHP
UTF-8
2,728
3
3
[ "MIT" ]
permissive
<?php namespace luya\traits; use Yii; /** * Cacheable trait to specific cache for yii components. * * Concret implementation example: * * ``` * $cacheKey = 'foobar'; * * $cache = $this->getHasCache($cacheKey); * * if ($cache === false) { * * // execute code and save cache data into variable * ...
Java
UTF-8
1,021
2.96875
3
[]
no_license
package batter; import member.member; public class batter extends member{ private int bat; //타수 private int hit; //안타수 private double batAvg; //타율 public batter() { } public batter(int number, String name, int age, double height, int bat, int hit, double batAvg) { super(number, name, a...
C++
UTF-8
791
3.15625
3
[]
no_license
#include <iostream> #include <string> #include <cstring> using namespace std; int main(){ int a[6]; memset(a,0,sizeof(a)); string str; cin>>str; for(int i = 0; i < str.length(); i++){ if(str[i] == 'P'){ a[0]++; }else if(str[i] == 'A'){ a[1]++; }else if(str[i] == 'T'){ a[2]++; }else if(str[i] == '...
Python
UTF-8
1,137
2.984375
3
[]
no_license
#!/usr/bin/python3 import requests import sys import time def make_request(URL): r = requests.get(url = URL) data = r.json() if int(r.headers.get("X-Discogs-Ratelimit-Remaining")) <=0: time.sleep(60) r = requests.get(url = URL) data = r.json() return data if len(sys.argv) != 2: ...
Go
UTF-8
1,532
3.046875
3
[ "MIT" ]
permissive
package treemux import ( "context" "net/http" "strconv" ) type Request struct { ctx context.Context *http.Request route string Params Params } func NewRequest(req *http.Request) Request { return Request{ ctx: req.Context(), Request: req, } } func (req Request) Context() context.Context { return r...
Java
UTF-8
2,224
2.859375
3
[]
no_license
public class Kronometre { private int seconds,minutes,hours; private int days, months, years; public int getSeconds() { return seconds; } public int getMinutes() { return minutes; } public int getHours() { return hours; } public void setSeconds(int seconds) { this.seconds =...
C#
UTF-8
2,699
3.671875
4
[]
no_license
using System; using System.Collections; using System.Collections.Generic; namespace hw_2 { class Program { //Builder HW class QuotesBuilder { private string quote; public QuotesBuilder() { this.quote = ""; } ...
Java
UTF-8
1,057
2.03125
2
[]
no_license
package com.zhaw.fit4jobs.payload.request.user; import com.zhaw.fit4jobs.models.user.ECivilStatus; import com.zhaw.fit4jobs.models.user.EGender; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; import javax.validation.constraints.NotBlank; import javax.validation.constraints.Size; impo...
Java
UTF-8
801
3.28125
3
[]
no_license
public class Solution_기지국설치 { public static int solution(int n, int[] stations, int w) { int scount = stations.length; int range = 2 * w + 1, half_range = w + 1; int answer = 0; int diff = stations[0] - half_range; if (diff > 0) answer += (diff - 1) / range + 1; for (int i = 1; i < scount; ++i) { ...
C
UTF-8
605
2.8125
3
[]
no_license
/************************************************************************* > File Name: main.c > Author: chenhui > Mail: ********* > Created Time: 2016年02月22日 14:56:12 ************************************************************************/ #include <stdio.h> #include "stack/stack.h" //extern void pu...