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
Java
UTF-8
520
3.671875
4
[]
no_license
package danil.chapter11; import java.util.Collection; import java.util.Iterator; public class InterfaceVsIterator { public static void display(Iterator<Pet> iterator){ while (iterator.hasNext()){ Pet p = iterator.next(); System.out.print(p.id() + ":" + p + " "); } S...
Shell
UTF-8
172
3.078125
3
[]
no_license
#!/usr/bin/env bash PWD=`security find-generic-password -a $1 -s $2 -w` # for mount_smbfs, spaces in passwords need to be escaped as %20 printf "%s" `echo ${PWD// /%20}`
C++
UTF-8
1,688
2.546875
3
[]
no_license
/* Copyright 2017 Rafael Rendón Pablo <rafaelrendonpablo@gmail.com> */ // region Template #include <iostream> #include <iomanip> #include <fstream> #include <sstream> #include <string> #include <bitset> #include <vector> #include <queue> #include <map> #include <set> #include <cmath> #include <cctype> #include <cassert...
Markdown
UTF-8
670
2.78125
3
[]
no_license
# Quota & Limits Resources in OpenShift namespace can be limited using quota: ![quota](img/quota.png) Each OpenShift object (Pod, BuildConfig, DeploymentConfig, ...) can use resource limits for CPU and memory. If the application exceed the limits it is killed and redeployed automatically. ```yaml - apiVersion: v1 ...
Python
UTF-8
494
3.125
3
[ "CC0-1.0" ]
permissive
print("\n") print("SoY uN dIaMaNtE") print("y SoY dE cOlOr AzUl CoMo El {}.".format('CiElOoOoOoOo')) print("." * 10) end1 = "E" end2 = "l" end3 = "B" end4 = "u" end5 = "r" end6 = "d" end7 = "i" end8 = "g" end9 = "a" end10 = "t" end11 = "o" end12 = "S" end13 = "u" end14 = "p" end15 = "r" end16 = "e" end17 = "m" end18 =...
C
UTF-8
887
3.109375
3
[]
no_license
// // main.c // Uncle Johny // // Created by Vishal Jha on 25/10/20. // #include <stdio.h> #include <stdlib.h> int main() { int T=0; scanf("%d", &T); while(T != 0){ int n,pos; scanf("%d", &n); int A[n],k,i=0; for(i=0;i<n;i++){ scanf("%d", &A[i]); } ...
Java
UTF-8
414
2.296875
2
[]
no_license
package projet.messages.response; import java.io.Serializable; public class LobbyCreationResponse implements Serializable { private String lobbyName; public String getLobbyName() { return lobbyName; } public void setLobbyName(String lobbyName) { this.lobbyName = lobbyName; } ...
Markdown
UTF-8
1,399
2.53125
3
[]
no_license
# :vertical\_traffic\_light: Reducing Network Bandwidth Usage {% hint style="info" %} Hosting your own execution client can consume hundreds of gigabytes of data per day. Because data plans can be limited or costly, you might desire to slow down data usage but still maintain good connectivity to the network. {% endhin...
C++
UTF-8
197
3.015625
3
[]
no_license
#include <iostream> using namespace std; void print(int argc, char **args) { cout << args[0] <<endl; } int main(int argc, char **args) { print(1, 2, 3, 4); return 0; }
Python
UTF-8
1,076
2.921875
3
[ "MIT" ]
permissive
import numpy as np from selenium import webdriver from selenium.webdriver.support.color import Color # define the customer probability of clicks prob_list = [0.3, 0.8] # instantiate the web brower driver = webdriver.Chrome( executable_path='/Users/meigarom/chromedriver' ) driver.get( 'http://127.0.0.1:5000/home' ) #...
Java
UTF-8
4,242
2.96875
3
[ "Apache-2.0" ]
permissive
/* RetroRPGCS: An RPG */ package com.puttysoftware.retrorpgcs.maze.utilities; public class DirectionResolver { public static final String resolveDirectionConstantToName(final int dir) { String res = null; res = switch (dir) { case DirectionConstants.DIRECTION_NORTH -> DirectionConstants.DIR...
Go
UTF-8
985
2.953125
3
[]
no_license
package auth import ( "github.com/dgrijalva/jwt-go" "net/http" "strconv" "time" ) const jwtKey = "secret" func CreateNewToken(id int) (string, error) { claims := &Claims{ ID: strconv.Itoa(id), StandardClaims: jwt.StandardClaims{ // In JWT, the expiry time is expressed as unix milliseconds ExpiresAt: t...
SQL
UTF-8
2,882
2.625
3
[]
no_license
PROMPT ===================================================================================== PROMPT *** Run *** ========== Scripts /Sql/BARSAQ/Table/TMP_REFSYNC_XML_DOCPAYED.sql ======= PROMPT ===================================================================================== PROMPT *** Create table TMP...
C
UTF-8
1,846
2.859375
3
[]
no_license
/* ** remove_player.c for zappy in /home/launoi_a/tmp/PSU_2013_zappy/server/modules/World ** ** Made by allyriane.launois ** Login <launoi_a@epitech.net> ** ** Started on Sun Jul 13 19:15:59 2014 allyriane.launois ** Last update Sun Jul 13 19:16:19 2014 allyriane.launois */ #include "print_log.h" #include "server...
C#
UTF-8
433
2.6875
3
[]
no_license
namespace ProductsManagementApp { public class InverseCriteria<T> : IItemSearchCriteria<T> { private readonly IItemSearchCriteria<T> _searchCriteria; public InverseCriteria(IItemSearchCriteria<T> searchCriteria) { _searchCriteria = searchCriteria; } public ...
Shell
UTF-8
1,041
3.203125
3
[ "Apache-2.0" ]
permissive
#!/bin/bash # This script is to be called from ./build.sh before building the image. # It backs up the install yaml files and updates the VERSION as defined in # ./build.sh. # backup the kappnav install yaml files rm -rf backup mkdir backup cp kappnav.yaml backup/kappnav.yaml cp kappnav-delete.yaml backup/kappnav-dele...
JavaScript
UTF-8
6,675
2.578125
3
[]
no_license
// /property routes controller import dbConnection from '../db/database'; import '../config/db_tables_config'; import ResponseHelper from '../helpers/response_helper'; import { getCreatePropertyError, getFullPropertyDetails, filterPropertiesByType, getUpdatePropertyError, hasForbiddenField, dbInsertNewPrope...
Java
UTF-8
632
2.640625
3
[]
no_license
//Implementation of object (RemoteObjectImplemetation.java) package rmi.oop.dk; import java.rmi.RemoteException; import java.rmi.server.UnicastRemoteObject; /** * * @author andc */ public class RemoteObjectImplemetation extends UnicastRemoteObject implements RemoteHelloInterface { public RemoteObject...
C#
UTF-8
969
3.09375
3
[]
no_license
using System; using System.Runtime.Serialization.Formatters.Soap; using System.IO; using System.Xml.Serialization; class Program { static void Main(string[] args) { Person p = new Person(); p.Age = 42; p.Name = "Mr Smith"; FormatSoap(p); FormatXm...
C#
UTF-8
834
2.671875
3
[]
no_license
using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CustomTraceListener { public class ProcessingService { #region Constructor public ProcessingService() { #if !DEBUG ...
C#
UTF-8
1,631
3.046875
3
[]
no_license
using System; using System.Linq; using Microsoft.AspNetCore.Builder; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using PlatformService.Models; namespace PlatformService.Data { public static class PrepDb { public static void PrepPopulation(IApplicationBuilder app...
Java
UTF-8
6,954
3.5
4
[]
no_license
package com.t3h.mystring; import java.util.ArrayList; import java.util.Comparator; public class MyString { private String strb = new String(); public MyString(String strb) { this.strb = strb; } public String getStrb() { return strb; } public void sumAscii() { int sA ...
SQL
UTF-8
556
3.3125
3
[]
no_license
SELECT PARTITION_ID, TO_CHAR(USER_ID_A) USER_ID_A, SERIAL_NUMBER_A, TO_CHAR(USER_ID_B) USER_ID_B, SERIAL_NUMBER_B, RELATION_TYPE_CODE, ROLE_CODE_A, ROLE_CODE_B, ORDERNO, SHORT_CODE, TO_CHAR(START_DATE, 'yyyy-mm-dd hh24:mi:ss') START_DATE, TO_C...
Markdown
UTF-8
806
3.140625
3
[]
no_license
## Machine-Learning-Studies This section is to list out the Machine Learning techniques I have learned: ``` 01: Data Processing 02: Linear Regression 03: Multiple Linear Regression 04: Logistic Regression 05: KNN Classification 06: Decision trees 07: Random Forest 08: CatBoosting, Gradient Boosting, XGBoosti...
C#
UTF-8
1,016
2.53125
3
[]
no_license
using System.Collections; using System.Collections.Generic; using UnityEngine; public class Nail : MonoBehaviour { private void Start() { Collider[] colliders = Physics.OverlapBox(this.transform.position, this.transform.localScale * 0.5f, transform.rotation); NailObjects(colliders); ...
Markdown
UTF-8
761
3
3
[ "MIT" ]
permissive
# track-sequence-ids if you are doing work related to sequence ids this tracks what you should store in your .sequence file. ```js var tracker = require('track-sequence-ids') var write = require('write-file-atomic') var startSequence = tracker(function saveSequence(sequence){ write('.sequence',sequence,function(...
C++
UTF-8
242
2.765625
3
[]
no_license
#include "carta.h" int compare(carta_t a,carta_t b) { return a.punti - b.punti; } void copy(carta_t &a,carta_t b) { a = b; } void print(carta_t a) { std::cout << a.nome << " " << &a.nome[strlen(a.nome)+1] << ": " << a.punti; }
C#
UTF-8
1,176
2.921875
3
[]
no_license
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; namespace RestServer.Utility { public static class Utility { public static string FlattenException(this Exception ex) { if (null == ex.InnerException...
C#
UTF-8
2,019
2.734375
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.ComponentModel.DataAnnotations; namespace GaskMan.Models { public class CMaterialSize { public int materialSizeId // Primary key { get; set; } [Display(Name = "Material")] [Requir...
C++
UTF-8
2,019
3.6875
4
[]
no_license
#include "ValidPalindrome.h" /* 题目描述: 给定一个非空字符串 s,最多删除一个字符。判断是否能成为回文字符串。 示例: 输入: "aba" 输出: True 输入: "abca" 输出: True 解释: 你可以删除c字符。 输入: "cuppucu" 输出: True   请注意,字符串只包含从 a-z 的小写字母。字符串的最大长度是50000。 */ /* 解法1:一头一尾双指针 缺点:某些情况下(如:"cupp...
Java
UTF-8
709
1.742188
2
[ "Apache-2.0" ]
permissive
package com.SzTouYun.advertisingsystem; import com.sztouyun.advertisingsystem.AdvertisingSystemApplication; import com.sztouyun.advertisingsystem.service.customer.CustomerService; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springfra...
JavaScript
UTF-8
4,779
2.53125
3
[ "BSD-3-Clause", "GPL-2.0-only", "MIT" ]
permissive
/** * Draw the table for the first time, adding all required features * @param {object} oSettings dataTables settings object * @memberof DataTable#oApi */ function _fnInitialise(oSettings) { var i, iLen, iAjaxStart = oSettings.iInitDisplayStart; /* Ensure that the table data is fully initialised */ i...
JavaScript
UTF-8
580
3.453125
3
[]
no_license
// 测试原生的 async 函数是否使用了 promise // 鸭子模型,不要判断是不是鸭子,只要判断像不像鸭子,这里就是判断像不像 promise const p = { then (resolve, reject) { console.log('into') setTimeout(() => resolve('tao'), 1000) // reject 会被 async 的 try catch 捕获 // reject('err') } }; (async function () { try { const v = await p console.log(v)...
C#
UTF-8
2,165
2.8125
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using PSC.Models; using PSC.ViewModels; using Microsoft.EntityFrameworkCore; //Creaiamo un metodo asincrono per fornire un meccanismo per scrivere il codice...
C++
UTF-8
750
3.4375
3
[]
no_license
//this class holds information about a file in a directory #ifndef DIRECTORY_FILE_H #define DIRECTORY_FILE_H #include <string> #include <iostream> class DirectoryFile { private: std::string dir; //the name of the directory std::string file; //the name of the file in the directory public: DirectoryFil...
Java
UTF-8
556
1.90625
2
[]
no_license
package com.cybersoft.oop.quanlinhansu.model; public class GiamDoc extends NhanSu { private float coPhan; public GiamDoc() { super(); this.luongMotNgay = 300; } public GiamDoc(String hoTen, String soDienThoai, int soNgayLam) { super(hoTen, soDienThoai, soNgayLam); this.luongMotNgay = 300; } public G...
Markdown
UTF-8
323,808
2.890625
3
[]
no_license
- [1. Configuration de base : Composer, Git, XDebug, Visual Studio](#1-configuration-de-base--composer-git-xdebug-visual-studio) - [2. Installation des outils de base de Symfony](#2-installation-des-outils-de-base-de-symfony) - [3. Création d'un projet de base (squelette)](#3-création-dun-projet-de-base-squelette) - [4...
Python
UTF-8
966
3.984375
4
[]
no_license
""" Input parameters: - pandas.DataFrame object - sequence Task: Your function must return a new pandas.DataFrame object with same data than the original input but now its column names are the elements of the sequence. You must not modify the original input. The number of columns of the input will ...
Java
UTF-8
2,711
2.203125
2
[ "LicenseRef-scancode-warranty-disclaimer", "ECL-2.0" ]
permissive
/* * Copyright (c) 2017, University of Dayton * * Licensed under the Educational Community 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://opensource.org/licenses/ecl2 * * Unless requ...
Java
UTF-8
825
4.4375
4
[]
no_license
// Java0529.java // This program uses "short circuiting" and uses the isEven // method to demonstrate short circuiting with logical and. import java.util.Scanner; public class Java0529 { public static void main (String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter nu...
Python
UTF-8
9,939
3.46875
3
[]
no_license
""" Tamanos Win condition Dificulad y niveles Cambio de imagenes menu """ from turtle import up, goto, down, color, begin_fill, forward, onscreenclick from turtle import left, end_fill, clear, shape, stamp, write, done from turtle import update, ontimer, setup, addshape, hideturtle, tracer from random import shuffle f...
Java
UTF-8
7,492
2.421875
2
[]
no_license
/* * @(#)GenericBaseCache.java 2014-3-27 下午2:37:33 * Copyright 2014 吕海斌, Inc. All rights reserved. 8637.com * PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */ package com.zttx.web.core; import java.util.HashSet; import java.util.Iterator; import org.apache.commons.lang3.builder.ToStringBuil...
Java
UTF-8
1,326
2.28125
2
[]
no_license
package com.nourhan.backend.controller; import java.util.Optional; import java.util.UUID; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotatio...
C#
UTF-8
3,356
3.3125
3
[]
no_license
/* * @lc app=leetcode id=211 lang=csharp * * [211] Add and Search Word - Data structure design * * https://leetcode.com/problems/add-and-search-word-data-structure-design/description/ * * algorithms * Medium (29.78%) * Total Accepted: 110.7K * Total Submissions: 370.6K * Testcase Example: '["WordDictiona...
Python
UTF-8
109
3
3
[]
no_license
class Solution: def numbersByRecursion(self, n): pass inst = Solution() print(inst.numbersByRecursion(3))
Python
UTF-8
1,073
4.21875
4
[]
no_license
''' Given an array of integers, return a new array such that each element at index i of the new array is the product of all the numbers in the original array except the one at i. For example, if our input was [1, 2, 3, 4, 5], the expected output would be [120, 60, 40, 30, 24]. If our input was [3, 2, 1], the ...
JavaScript
UTF-8
2,730
2.59375
3
[]
no_license
const { logger } = require('./utils/logger'); const models = require('./specifications/models'); const countries = require('./specifications/countries.json'); const currencies = require('./specifications/currencies.json'); const mcc_codes = require('./specifications/mcc_codes.json'); function decode(emvString, spec =...
C++
UTF-8
2,985
3.71875
4
[]
no_license
/*Title: Lab – threepoints.cpp Purpose: read three points and determine if they form a line or triangle Author: Pardeep Sharma */ #include <iostream> #include <cmath> #include <iomanip> #define PI 3.14159265 using std::cout; using std::endl; using std::cin; using std::fixed; using std::setprecision; using std::isin...
C++
UTF-8
1,109
2.59375
3
[]
no_license
#include <cstdio> #include <algorithm> using namespace std; int n, high=-1, numcyc=0, numround=0, cycsize[10005], adj[10005], visited[10005], ord[10005], cyc[10005], rnd[10005]; void dfs(int u) { int v = u, cycle=0; ++numround; while (1) { if (visited[v] && rnd[v]==numround) { cycle=1; break; } else if (vi...
Java
UTF-8
2,052
2.328125
2
[]
no_license
package com.testngparallel.TestNGParallelGrid; import java.net.MalformedURLException; import java.net.URL; import java.util.concurrent.TimeUnit; import org.testng.annotations.Parameters; import org.openqa.selenium.By; import org.openqa.selenium.Platform; import org.openqa.selenium.WebDriver; import org.openqa.seleniu...
Java
UTF-8
898
2.875
3
[]
no_license
package comandoPrimitivo; import semantico.TipoDado; public class PrimitivoSaida extends ComandoPrimitivo{ private TipoDado tipo; private String expDestinoAssembler; public PrimitivoSaida(TipoDado tipo, String expDestinoAssembler) { this.tipo = tipo; this.expDestinoAssembler = expDestinoAssembl...
TypeScript
UTF-8
468
2.609375
3
[]
no_license
import { getStore } from '../store/store'; import SmimeInstallationStatus from '../store/schema/SmimeInstallationStatus'; /** * Returns status of S/MIME adapter */ export default function isSmimeAdapterUsable(): boolean { const smimeAdapterStore = getStore(); return ( smimeAdapterStore.installationSt...
TypeScript
UTF-8
6,091
2.625
3
[]
no_license
import Knex from 'knex' import Tweet from '../entities/Tweet' import { selectCountsForTweet } from '../utils/utils' import BaseRepository from './BaseRepository' export enum Filters { TWEETS_RETWEETS, WITH_COMMENTS, ONLY_MEDIA, ONLY_LIKES, } class TweetRepository extends BaseRepository { // get the tweets f...
Java
UTF-8
766
2.03125
2
[ "Apache-2.0" ]
permissive
package net.minecraft.gametest.framework; import net.minecraft.SystemUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; public class GameTestHarnessLogger implements GameTestHarnessITestReporter { private static final Logger LOGGER = LogManager.getLogger(); public Gam...
Markdown
UTF-8
659
2.734375
3
[]
no_license
#### FontList ###### 类 FontList ##### 方法 ###### FontList.AddFont(*fontfile*) 将指定的字体添加到全局字体列表。 - <b>参数</b>: `fontfile` (***字符串***) – fontfile - <b>返回</b>:success 成功 - <b>返回类型</b>:布尔 ###### FontList.Clear() 清空全局字体列表。 ###### FontList.GetFontList() 返回全局字体列表中的所有字体文件。 - <b>返回</b>:fo...
Java
UTF-8
2,896
2.09375
2
[]
no_license
package com.example.safra.ui.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.ProgressBar; import android.widget.TextView; import android.widget.Toast; import androidx.appcompat.app.AppCompa...
Java
UTF-8
3,149
3.03125
3
[]
no_license
package Section; import com.trungtamjava.vonglap.Break; import java.util.Scanner; public class Section2a { public static void main(String[] args) { //Hiển thị câu hỏi trắc nghiệp với 4 lựa chọn. // dung cầu dkien để nhận trả lời qua nhập vào từ scanner. và in câu trả lời đó ra màn hình. S...
Java
WINDOWS-1250
4,734
2.96875
3
[]
no_license
package pakiet_Slownik.menu_Slownika.Manu_Admin; import pakiet_Slownik.ConnectToDatabase.Get_Database_Parameters; import javax.swing.*; import java.awt.*; import java.io.*; import java.sql.SQLException; import java.sql.Statement; import java.text.SimpleDateFormat; import java.util.Date; public class Panel_Menu_Copy_D...
Shell
UTF-8
219
3.140625
3
[]
no_license
#A simple script to change usernames in cygwin #Create a password file mkpasswd > /etc/passwd #Where the initial name is $1 cd /home mv $1 $2 ln -s $2 $1 sed -e 's/^$1/$2/' -e 's/\/home\/$1/\/home\/$2/' -i /etc/passwd
Shell
UTF-8
564
2.90625
3
[ "MIT" ]
permissive
#!/bin/sh echo 'Downloading Drupal' bin/php bin/drush dl drupal --drupal-project-rename=web echo 'Download complete' echo 'Modifying Classy base theme to work with Node.js' cp "assets/html.html.twig" "web/core/themes/classy/templates/layout/html.html.twig" echo 'Installing Drupal in the web directory' cd web || exit .....
Java
UTF-8
260
1.570313
2
[]
no_license
package com.github.haseoo.courier.testutlis.constants; import lombok.NoArgsConstructor; import static lombok.AccessLevel.PRIVATE; @NoArgsConstructor(access = PRIVATE) public class ParcelConstants { public static final char[] TEST_PIN = {0, 1, 2, 3}; }
Python
UTF-8
1,315
2.8125
3
[]
no_license
class DSU: def __init__(self, n): self.parent = [0] * n self.set_sizes = [1] * n for i in range(n): self.parent[i] = i def find(self, i): if self.parent[i] == i: return i self.parent[i] = self.find(self.parent[i]) return self.parent[i] ...
Java
UTF-8
1,765
1.929688
2
[ "Apache-2.0" ]
permissive
package com.walmartlabs.concord.runtime.v2.runner.remote; /*- * ***** * Concord * ----- * Copyright (C) 2017 - 2019 Walmart Inc. * ----- * 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...
Java
UTF-8
707
2.03125
2
[]
no_license
package com.xzc.mapper; import com.xzc.pojo.Comments; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; import java.util.Map; @Mapper public interface CommentsMapper { public Comments getCommentsById(@Param(value = "id") Long id)throws Exception; publi...
C#
UTF-8
3,323
2.53125
3
[ "Apache-2.0" ]
permissive
// <copyright file="LoggingPreferencesJsonConverter.cs" company="WebDriver Committers"> // Copyright 2007-2011 WebDriver committers // Copyright 2007-2011 Google Inc. // Portions copyright 2011 Software Freedom Conservancy // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this fi...
Python
UTF-8
2,306
3.453125
3
[]
no_license
# Authors: Lana Abdelmohsen, Corbin Grosso, Michael Giordano, Ali Gueye # Filename: project4.py #Description: Main file for execution of all required tasks (includes a shuffle method for task 4 to shuffle the dataset) from model import Model import random def shuffle_data(output_directory): """ Shuff...
PHP
UTF-8
241
2.625
3
[]
no_license
<?php namespace MF\Model; use src\Connection; class Container { public static function getModel($model) { $class = "\\src\\Models\\".ucfirst($model); $connection = Connection::getDb(); return new $class($connection); } }
Markdown
UTF-8
6,116
3.03125
3
[]
no_license
# The-HACK-General-Purpose-Computer > **What I hear, I forget; What I see, I remember; What I do, I understand. —Confucius, 551–479 BC** The Nand to Tetris project is about going into fascinating voyage of discovery in which I go all the way from Boolean algebra and elementary logic gates to building a <ins>**Central...
Java
UTF-8
4,478
2.46875
2
[]
no_license
package com.converter.services.calculator; import com.converter.model.ConversionResponse; import com.converter.util.TestUtil; import org.junit.Test; import java.math.BigDecimal; import java.util.List; import static com.converter.util.CatCurrency.*; import static org.hamcrest.CoreMatchers.is; import static org.hamcre...
Python
UTF-8
633
2.6875
3
[]
no_license
num=int(input()) alist=[] blist=[] for i in range(num): alist.append(input()) blist.append(input()) for i in range(num): size=int(alist[i]) test=blist[i].split() change=[["0" for i in range(size)]for j in range(size)] final = [["0" for i in range(size)] for j in range(size)] ans=[] for i...
Java
UTF-8
5,097
2.5
2
[]
no_license
package com.destranix.glslang; public enum MemorySemanticsShift { MemorySemanticsAcquireShift(Main.MEMORY_SEMANTICS_ACQUIRE_SHIFT), MemorySemanticsReleaseShift(Main.MEMORY_SEMANTICS_RELEASE_SHIFT), MemorySemanticsAcquireReleaseShift(Main.MEMORY_SEMANTICS_ACQUIRE_RELEASE_SHIFT), MemorySemanticsSequentiallyConsisten...
C
UTF-8
524
3.359375
3
[]
no_license
void ft_putchar(char c); void colle(int row, int col) { int ccol; int crow; ccol = 0; crow = 0; while (ccol < col) { crow = 0; while (crow < row) { if (ccol == 0 && (crow == 0 || crow == row - 1)) ft_putchar('o'); else if(ccol == col - 1 && (crow == 0 || crow == row - 1)) ft_putchar('o'); ...
Markdown
UTF-8
11,788
2.90625
3
[ "MIT" ]
permissive
--- title: Meta Tags, Link Tags And Web Manifests slug: author: Carl Cassar description: A comprehensive guide to meta, link and other `<head>` tags I use to improve SEO and ensure my sites look great on all platforms. tags: - html image: link: https://www.carlcassar.com/articles/meta-tags-link-tags-and-web-manifes...
Java
UTF-8
321
2.40625
2
[]
no_license
package classcode.p01IntroJava; import javax.swing.*; /** * Message dialog window */ public class G01MessageDialogWindow { /** * main method */ public static void main(String[] args) { // message dialog with information message type and no title JOptionPane.showMessageDialog(null, "Hello World!"); } }...
Python
UTF-8
1,688
2.984375
3
[ "MIT" ]
permissive
import json import socket from typing import List class OpenFacsInterface(object): def __init__(self, udp_ip_address: str, udp_port: int) -> None: self._udp_address: str = udp_ip_address self._udp_port: int = udp_port def send_aus(self, au_list: List[float], speed: float) -> None: ...
Python
UTF-8
1,794
2.640625
3
[ "BSD-3-Clause" ]
permissive
import requests import logging import configparser import shelve from RFC2136 import * logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) ch = logging.StreamHandler() ch.setLevel(logging.INFO) formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') # add formatter to ch...
Java
UHC
765
3.03125
3
[]
no_license
package com.naver; public class Monster { private int hp; private String name; private int exp; public Monster(int hp, String name, int exp) { super(); this.hp = hp; this.name = name; this.exp = exp; } public Monster() { this.name=""; } public String getName() { return name; } public v...
Java
UTF-8
4,581
2.375
2
[ "MIT" ]
permissive
package com.dylan.uiparts.gridview; import android.content.Context; import android.content.res.TypedArray; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.util.AttributeSet; import android.view.View; import android.widget.GridView; import com.dyl...
Markdown
UTF-8
3,691
3.375
3
[]
no_license
**GSOC Raspberry Pi Photobooth** Created as a STEM table display activity to illustrate cool STEM projects that Girl Scouts can do! Designed to run on a Raspberry Pi with a USB camera. This can be easily converted to the Raspberry Pi camera; I just didn't have access to one. There are three "buttons" which are real...
Python
UTF-8
884
3.5625
4
[]
no_license
class Solution: # @param {string} num # @return {boolean} # 回文数 def isStrobogrammatic(self, num): dic = {'9': '6', '6': '9', '1': '1', '8': '8', '0': '0'} l, r = 0, len(num) - 1 while l <= r: if num[l] not in dic or dic[num[l]] != num[r]: return False...
Markdown
UTF-8
4,260
3.515625
4
[]
no_license
# ECE4960 - Full & Compressed Matrices and Jacobi Solver Written in junction with Ariana Bruno (amb633) as part of a programming assignment in for ECE4960. Repos have been forked individually. - *report.txt* contains our analysis of the implementation and algorithms - *output_log.txt* contains the log of all checks, ...
JavaScript
UTF-8
1,190
2.84375
3
[]
no_license
import React from "react"; import ReactDOM from "react-dom"; class Toggle extends React.Component { constructor(props) { super(props); this.state = {isToggleOn: true, id: 0} this.handleClick = this.handleClick.bind(this); } /** * 此语法确保 handleClick 内的 this 已被绑定 * 注意这...
C#
UTF-8
1,081
3.078125
3
[]
no_license
using namespace System.Diagnostics; ... public static bool WaitForInputIdle(IntPtr hWnd, int timeout = 0) { int pid; int tid = GetWindowThreadProcessId(hWnd, out pid); if (tid == 0) throw new ArgumentException("Window not found"); var tick = Environment.Ti...
JavaScript
UTF-8
1,098
2.796875
3
[]
no_license
import { REST_COUNTRIES_API, endpointEnum } from '../config/constants'; const apiUrlReducer = (api, endpoint, options = '') => { switch (endpoint) { case 'ALL': return `${api}${endpointEnum[endpoint]}`; case 'NAME': return `${api}${endpointEnum[endpoint]}/${options}`; ...
Java
UTF-8
4,872
2.015625
2
[]
no_license
package com.vsofo.authentication.config.security; import com.vsofo.authentication.filter.AuthenticationTokenFilter; import com.vsofo.authentication.filter.LoginAuthenticationProvider; import com.vsofo.authentication.filter.handler.*; import com.vsofo.common.constants.UrlConstant; import org.slf4j.Logger; import org.sl...
C++
UTF-8
1,306
3.625
4
[ "MIT" ]
permissive
#include <iostream> #include <functional> #include <unordered_set> #include <string_view> enum class Type { Odd, Even, All }; bool check_equiv(std::string_view s1, std::string_view s2, Type t) { std::unordered_set<char> chars1; std::unordered_set<char> chars2; auto checker = [&t](std::string_view s, std::unord...
Python
UTF-8
826
3.875
4
[]
no_license
""" Given a sorted array, remove the duplicates in-place such that each element appear only once and return the new length. Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory. Example: Given nums = [1,1,2], Your function should return length = 2...
Java
UTF-8
323
3.421875
3
[]
no_license
public class SumDigits { public static void main(String[] args) { int number1 = 2368; System.out.println(sumDig(number1)); } public static int sumDig(int n) { int right = n % 10; int left = n / 10; if (left == 0) { return right; } else { return right + sumDig (left); } }...
Shell
UTF-8
333
2.5625
3
[ "Apache-2.0" ]
permissive
#!/usr/bin/env bash # Create index patterns in Elasticsearch echo "Creating index patterns if not present" curl -XPUT $ELASTICSEARCH_URL/.kibana/index-pattern/logstash-* -d '{"title" : "logstash-*", "timeFieldName": "@timestamp"}' curl -XPUT $ELASTICSEARCH_URL/.kibana/config/${ELASTIC_VERSION} -d '{"defaultIndex" : "l...
Markdown
UTF-8
2,999
3.53125
4
[ "MIT" ]
permissive
--- title: Button Groups Samples description: Demonstration of Button Groups --- <!-- Button Groups ================================================== --> <section id="buttonGroups"> <h2>Examples</h2> <p>Two basic options, along with two more specific variations.</p> <h3>Single button group</h3> <p>Wrap a se...
Markdown
UTF-8
653
2.71875
3
[]
no_license
# Alexa AVR Control A self hosted Alexa skill to control a network-enabled Pioneer AVR through telnet commands. ### Options ``` $ alexa-avr-control --help Alexa AVR Control 0.1.0 Cory F. <cforsstrom18@gmail.com> A self hosted Alexa skill to control a network-enabled Pioneer AVR through telnet commands. USAGE: ...
Python
UTF-8
4,099
3.125
3
[]
no_license
import numpy as np from library.NeuralNetwork import * from library.Neuron import * import random class MLP(NeuralNetwork): # Initial setup def __init__(self, name , learn_rate, max_init_value, input_size, neurons_per_layer, init_random_weights=True): super().__init__(len(neurons_per_layer)) ...
C++
UTF-8
2,517
3.25
3
[]
no_license
#ifndef lacpp_benchmark_hpp #define lacpp_benchmark_hpp benchmark_hpp /* a small benchmarking framework by David Klaftenegger, 2015 * please report bugs or suggest improvements to david.klaftenegger@it.uu.se */ #include <atomic> #include <chrono> #include <random> #include <thread> #include <vector> enum class wor...
JavaScript
UTF-8
700
2.796875
3
[]
no_license
const fs = require('fs') const path = require('path') const fileName = path.resolve(__dirname, 'data.txt') // 读取文件 fs.readFile(fileName, (err, data) => { if (err) { console.log('err', err); return } // data 是二进制,需要转换成字符串 console.log('===================================='); console.log(data.toString(...
Java
UTF-8
445
1.539063
2
[]
no_license
package com.wecast.mobile.ui.screen.settings.buffer; import android.widget.SeekBar; /** * Created by ageech@live.com */ public class BufferChangeListener implements SeekBar.OnSeekBarChangeListener { @Override public void onProgressChanged(SeekBar seekBar, int i, boolean b) { } @Override publ...
Markdown
UTF-8
14,706
2.8125
3
[]
no_license
--- ID: 5890 post_title: 'Chololatey &#8211; Um gerenciador e instalador de programas para Windows' author: Valdecir Carvalho post_excerpt: "" layout: post permalink: http://bit.ly/2MDC4lI published: true post_date: 2019-10-23 07:00:29 --- Olá Homelabers! Como vocês fazem para instalar seus programas e softwares predi...
Go
UTF-8
4,626
3.078125
3
[ "MIT" ]
permissive
package main import ( "fmt" "os" "strings" "time" ) // GameFileLogger is implementation of GameLogger which stores logs in files type GameFileLogger struct { dir string errCallback func(err error) bufferChans map[string]chan string stopChans map[string]chan bool } // NewGameFileLogger constructor f...
Java
UTF-8
1,369
2.5
2
[ "MIT" ]
permissive
package mage.cards.x; import java.util.Map; import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ReplacementEffectImpl; import mage.abilities.effects.common.ReplaceTreasureWithAdditionalEffect; import mage.constants.D...
JavaScript
UTF-8
232
2.703125
3
[]
no_license
var calc = { add: function (a, b) { return a + b; }, sub: function (a, b) { return a - b; } }; Object.defineProperty(Object.prototype, 'calc', { get: function() { return calc; } });
C#
UTF-8
631
3.265625
3
[ "MIT" ]
permissive
<Query Kind="Statements" /> new Hyperlinq("http://www.problemotd.com/problem/parseint/", "Problem of the day: parseInt").Dump(); Func<string, double> parseInt = (value) => { double temp = 0; int indexLowDigit = value.Length; for (int i = indexLowDigit-1 ; i >= 0; i--) { if (value[i] < '0' || value[i] > '9') ...