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
Python
UTF-8
1,859
3.765625
4
[]
no_license
""" The fraction ^(49)/_(98) is a curious fraction, as an inexperienced mathematician in attempting to simplify it may incorrectly believe that ^(49)/_(98) = ^(4)/_(8), which is correct, is obtained by canceling the 9s. We shall consider fractions like, ^(30)/_(50) = ^(3)/_(5), to be trivial examples. There are exact...
Java
UTF-8
823
2.125
2
[]
no_license
package ba.unsa.etf.nwt.emailservice.emailservice.model; import lombok.Data; import lombok.NoArgsConstructor; import org.hibernate.annotations.GenericGenerator; import javax.persistence.*; import javax.validation.constraints.NotNull; import java.util.UUID; @Entity @Table(name = "email_subscriptions") @Data @NoArgsCon...
C++
UTF-8
831
2.640625
3
[ "MIT" ]
permissive
/* * demo-rtcout.cpp * * Version 1.1 Updated 21/04/2020 * * compile with "g++ demo-rtcout.cpp ../ABE_ExpanderPi.cpp -Wall -Wextra -Wpedantic -Woverflow -o demo-rtcout" * run with "./demo-rtcout" * * This demo shows how to enable the clock square wave output on the RTC Pi and set the frequency */ #...
Java
UTF-8
1,338
1.96875
2
[]
no_license
package script.theme_park.newbie_tutorial; import script.*; import script.base_class.*; import script.combat_engine.*; import java.util.Arrays; import java.util.Hashtable; import java.util.Vector; import script.base_script; import script.library.ai_lib; import script.library.chat; public class nervous_guy extends sc...
Swift
UTF-8
1,967
3.609375
4
[]
no_license
/* https://leetcode.com/problems/longest-palindromic-substring/description/ */ import UIKit class Solution { var array : Array<Character>! var table : Array<Bool>! var count : Int! func longestPalindrome(_ s: String) -> String { array = Array(s) count = array.count ...
Markdown
UTF-8
2,429
3.140625
3
[ "Apache-2.0" ]
permissive
# do-core1 The `do-core1` is a simple processor architecture, mostly for educational purposes. It aims at being a support for system programming and computer architecture fundamentals courses. ## Instruction Set Architecture The do-core1 [Instruction Set Architecture (ISA)](https://en.wikipedia.org/wiki/Instruction...
SQL
UTF-8
10,389
3.171875
3
[ "MIT" ]
permissive
# ************************************************************ # Sequel Pro SQL dump # Version 4541 # # http://www.sequelpro.com/ # https://github.com/sequelpro/sequelpro # # Host: 127.0.0.1 (MySQL 5.5.5-10.4.13-MariaDB) # Database: dss # Generation Time: 2021-02-02 04:55:34 +0000 # ************************************...
PHP
UTF-8
1,279
3.390625
3
[]
no_license
<?php declare(strict_types=1); namespace App\Service; use Exception; class PasteWordsService { private string $wordMark; public function __construct(string $wordMark) { $this->wordMark = $wordMark; } /** * @param string $content * @param string $word * @param int $wordsCo...
Java
UTF-8
399
1.703125
2
[]
no_license
package com.msg; import com.androidyuan.frame.base.protocal.http.RequestMsg; import com.utils.Urls; import java.util.Map; /** * Created by mac on 18/3/5. */ public class WXPayReqMsg extends RequestMsg { @Override public String getUrl() { return Urls.m_WxPayMes; } public WXPayReqMsg(Map<S...
Markdown
UTF-8
1,132
2.546875
3
[ "MIT" ]
permissive
--- layout: post title: Wikipedia Turns 18 share-img: "https://upload.wikimedia.org/wikipedia/commons/2/2d/Wikipedia_Day_New_York_January_2019_014.jpg" --- On Sunday, I attended the [Wikipedia Day](https://en.wikipedia.org/wiki/Wikipedia:Meetup/NYC/Wikipedia_Day_2019) meetup sponsored by Wikimedia NYC, in Manhattan. W...
Python
UTF-8
890
3
3
[]
no_license
import pandas df = pandas.read_csv('online_retail.csv', parse_dates=['InvoiceDate']) df = df.set_index('InvoiceDate') print(df) empties = df.isnull().sum() print(empties) df['Customer ID'].fillna(0, inplace=True) df['Customer ID'].replace({0:'Unknown'}, inplace=True) df['Description'].fillna(1, inplace=True) df['Desc...
PHP
UTF-8
3,405
2.625
3
[ "MIT" ]
permissive
<?php /** * Created by PhpStorm. * User: MR.Z < zsh2088@gmail.com > * Date: 2017/9/18 * Time: 21:07 */ namespace App\Http\Controllers\Api; use App\Http\Controllers\Api\Service\v1\ApiService; use Illuminate\Http\Request; class Index { public $api = NULL; public function __construct() { $this->...
Swift
UTF-8
842
2.671875
3
[]
no_license
// // DogResultTableViewCell.swift // RetrieverLeague // // Created by Uros Zivaljevic on 12/15/17. // Copyright © 2017 Uros Zivaljevic. All rights reserved. // import UIKit class DogResultTableViewCell: UITableViewCell { @IBOutlet weak var positionLabel: UILabel! @IBOutlet weak var nameLabel: UILabel! ...
Java
UTF-8
1,099
3.15625
3
[]
no_license
public class Solution { public List<Integer> grayCode(int n) { List<Integer> list = new ArrayList<>(); if(n<0) return list; list.add(0); for(int i = 0; i < n; i++){ int size = list.size(); for(int k = size - 1; k >= 0; k--){ int highBit = 1 << ...
Shell
UTF-8
202
3.0625
3
[]
no_license
#!/bin/bash script_path=$(cd `dirname $0` && pwd)/bin cat >> ~/.bashrc <<EOF # Dev Tools export PATH=\$PATH:$script_path EOF echo Now, you could run "source ~/.bashrc" to enable it in current shell.
Python
UTF-8
2,099
3.328125
3
[]
no_license
""" Utilities for dealing with timestamps, which are represented as strings in the format YYYYMMDDhhmmss. """ from itertools import accumulate def hhmmss(timestamp): """ Returns the substring of timestamp corresponding to the hour, minutes, and seconds. """ return timestamp[8:] def yyyymmdd(timestam...
C#
UTF-8
1,249
3.421875
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Questions.IK.Tree { class PostOrderWithoutRecursion { public static void postorderTraversal(TreeNode root) { if (root == null) return; ...
JavaScript
UTF-8
482
3.171875
3
[]
no_license
#! /usr/bin/node "use strict" function missingnumber(l) { let v = new Set(l); for (let i = 0; i <= l.length; i++) { if (!v.has(i)) { return i; } } return 0; } if (missingnumber([0, 1, 3]) == 2) { process.stdout.write("Pass"); } else { process.stdout.write("FAIL"); } pr...
C++
UTF-8
376
2.984375
3
[]
no_license
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { int n, a, b, c; int ar[3]; int max; cin >> n >> a >> b >> c; ar[0] = a; ar[1] = b; ar[2] = c; int idx = *min_element(ar, ar + 3); if ( idx == a || idx == b || n == 1) { max = min(a, b)*(n - 1); } else max = mi...
Markdown
UTF-8
16,865
3.171875
3
[]
no_license
# Vocabulaire informatique ## Composantes de l'ordinateur Selon Antidote et Larousse, l'ordinateur est « une **machine automatique de traitement numérique de l'information**, qui obéit à des programmes définissant la séquence des opérations logiques et arithmétiques à effectuer ». Sur [Wikipédia](https://fr.wikipedi...
C++
UTF-8
472
3.15625
3
[]
no_license
#include <iostream> using namespace std; int main(void) { double pound; double feet; double inch; const double FEET_TO_INCH = 12; const double INCH_TO_METRER = 0.0254; const double POUND_TO_KG = 2.2; cout << "feet: "; cin >> feet; cout << "inch: "; cin >> inch; cout << "Pound: "; cin >> pound; double h...
Markdown
UTF-8
895
2.703125
3
[]
no_license
## Speech Timers We'll use the browser's [SpeechSynthesis API](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis) to create a timer that speaks to us. [View Demo](https://4jfqj.csb.app/) - [Watch a Preview](https://learn.chrisoncode.io/courses/10-react-apps-series-a/348628-09-web-speech-and-timers/9920...
Markdown
UTF-8
5,001
3
3
[]
no_license
--- uuid: d7ff8720-2d76-11ea-baaa-d5a37c33ff66 title: 性能测试工具之wrk s: how-to-use-wrk date: 2020-01-02 23:45:04 tags: categories: coauthor: zhaopanhong --- **wrk简介** wrk 是一个开源的C语言编写的轻量级HTTP压测工具,支持lua脚本创建复杂测试场景,可以用很少的线程压出很大的并发量。需要注意的是wrk不支持 Windows。 **环境搭建** mac 下运行:brew install wrk **参数说明** 使用wrk --help 查看wrk的用法 ``...
C#
UTF-8
3,003
2.703125
3
[]
no_license
using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; namespace GCAL.Base.Scripting { public class GDTextStyleCollection: IEnumerable { public GDNode Parent { get; set; } private List<GDTextStyle> p_list = null; IEnumerator IE...
TypeScript
UTF-8
1,999
3.0625
3
[ "MIT", "CC-BY-4.0" ]
permissive
import * as Prompt from "prompt"; import * as commons from "@akashic/akashic-cli-commons"; /** * game.jsonの初期値として与えるパラメータ。 */ export interface BasicParameters { /** * ゲーム画面の幅。 */ width: number; /** * ゲーム画面の高さ。 */ height: number; /** * ゲームのFPS。 */ fps: number; } /** * ユーザ入力で `BasicParameters` を取得す...
C++
UTF-8
2,036
2.765625
3
[]
no_license
/* ID: joaogui1 LANG: C++ TASK: snail */ #include <fstream> #include <iostream> #include <algorithm> #define ff first #define ss second using namespace std; typedef pair <int, int> pii; int mark[1 << 7][1 << 7], ans = 0, n; pii dz[4] = {pii(1, 0), pii(0, -1), pii(-1, 0), pii(0, 1)}; pii operator+(const pii& x, const...
Markdown
UTF-8
4,794
2.5625
3
[ "MIT" ]
permissive
# generator-upendodnn [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] > Scaffolds DNN extensions, including Modules (Webforms, SPA, and MVC), Persona Bar, Skin Object, Library, Scheduler, and Hotcakes Commerce projects (based on [gen...
PHP
UTF-8
449
2.859375
3
[]
no_license
<?php namespace SecuredTodoList\tools; /** * Description of Functions * * @author scoupremanj */ class Functions { static function formatPostInput($input){ if(!isset($_POST[$input])){ throw new FunctionsException('Oops ! Input format is not valid.'); } return self::protect...
C#
UTF-8
2,357
2.546875
3
[]
no_license
using System.Collections; using UnityEngine; using UnityEngine.UI; using DG.Tweening; namespace Presentation { public class GameUiChanger : MonoBehaviour { public void SetPosition(RectTransform rectTransform, Vector2 x) { rectTransform.anchoredPosition = x; } publi...
Markdown
UTF-8
4,401
3.078125
3
[]
no_license
<div class="chapnav"> <span class="prev">Previous: [inference](./som-22.5.html)</span><span class="next">Next: [causes and clauses](./som-22.7.html)</span><span class="contents">[Contents](index.html)</span> <div class="titlebar"> Society of Mind =============== </div> </div> *22.6* expression ----------------- L...
PHP
UTF-8
273
3
3
[]
no_license
<?php header("Content-type:text/html; charset=utf-8"); require_once "Felidae.php"; class Cat extends Felidae{ private $race="猫"; function pet(){ echo "我是{$this->race}"."<hr/>"; } } $cat = new Cat(); $cat->pet(); $cat->tree(); $cat->predator();
Markdown
UTF-8
919
3.15625
3
[ "MIT" ]
permissive
# _My Portfolio_ #### _This website showcases who I am and what I can do, June 30, 2017_ #### By _**Paul Guevarra**_ ## Description _This is a website I created to showcase my self and my abilities in computer programming. It gives a description of my background, hobbies, and a sample list of projects I have create...
Java
UTF-8
10,682
2.0625
2
[]
no_license
package com.dinhduc_company.stockmarket; import android.app.AlertDialog; import android.app.Dialog; import android.content.DialogInterface; import android.content.Intent; import android.database.Cursor; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.ContextMenu; import android.v...
Markdown
UTF-8
5,631
3.8125
4
[]
no_license
--- ID: 748 post_title: '{Quickly} Fix Master Boot Record (MBR) on Windows 10!!' author: Eva post_excerpt: "" layout: post permalink: > https://windowscrazy.com/748-quickly-fix-master-boot-record-mbr-on-windows-10/ published: true post_date: 2020-05-29 08:54:22 --- <ul class="toc"> <li><a href="#1">How to fix MBR o...
Java
UTF-8
4,572
2.046875
2
[]
no_license
package stationservice.controler; import com.jfoenix.controls.JFXButton; import com.jfoenix.controls.JFXDatePicker; import com.jfoenix.controls.JFXListView; import com.jfoenix.controls.JFXTextField; import java.awt.Desktop; import java.io.File; import java.io.IOException; import java.net.URL; import java.time.LocalDat...
PHP
UTF-8
579
3.046875
3
[]
no_license
<?php function post_request ($url, $data) { /* POSTデータをquery用に整形 */ $data = http_build_query($data, "", "&"); /* headerを設定 */ $header = array( "Content-Type: application/x-www-form-urlencoded", "Content-Length: ".strlen($data) ); /* ぜんぶHTTPリクエスト用に組み合わせる */ $context = array("http" => array( "method" => "...
Markdown
UTF-8
6,631
2.96875
3
[]
no_license
--- layout: post title: Getting people to sign up from Joshua Porter at Web 2.0 Expo wordpress_id: 47 wordpress_url: http://www.varud.com/?p=52 date: 2008-09-17 12:04:46.000000000 -04:00 --- Joshua Porter (bokaro.com) gave a great presentation this morning at the Web 2.0 Expo in New York today. Getting people to sign ...
Java
UTF-8
1,747
2.078125
2
[ "Apache-2.0" ]
permissive
package net.n2oapp.framework.config.metadata.validation.standard.regions; import net.n2oapp.framework.api.metadata.Source; import net.n2oapp.framework.api.metadata.aware.SourceClassAware; import net.n2oapp.framework.api.metadata.compile.SourceProcessor; import net.n2oapp.framework.api.metadata.global.view.region.N2oSc...
C++
UTF-8
765
2.71875
3
[ "Zlib" ]
permissive
// Project: libv.math, File: src/libv/math/distance/intersect.hpp #pragma once // libv #include <libv/math/vec.hpp> namespace libv { // ------------------------------------------------------------------------------------------------- [[nodiscard]] constexpr inline libv::vec3f intersect_ray_plane(libv::vec3f ray_p...
C#
UTF-8
1,685
2.515625
3
[ "Apache-2.0" ]
permissive
// This file is part of the CycloneDX Tool for .NET // // 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 ...
Python
UTF-8
6,593
2.53125
3
[]
no_license
''' Simple tcp multi-threading server to play file to clients Copyright: All Rights Reserved. Created by Alex Petukhov. Jun, 2015 ''' import sys import traceback import socketserver, time, datetime import struct import logging import authentification_pb2 import task1_heterogeneous_poisson_pb2 import pymongo import ...
C#
UTF-8
394
3.1875
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace _03.AnimalsTest { class Dog : Animal, ISound { public Dog(string name, int age, string sex) : base(name, age, sex) { } public void MakeSo...
C#
UTF-8
316
2.84375
3
[]
no_license
using System; namespace Composite //Leaf { public class Manager : Employee { public Manager(string name) : base(name) { } public override void ShowEmployeeDetails() { Console.Write("Manager = "); base.ShowEmployeeDetails(); } } }
C
UTF-8
1,687
3
3
[]
no_license
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_reset.c :+: :+: :+: ...
TypeScript
UTF-8
6,808
3.15625
3
[ "BSD-3-Clause", "MIT" ]
permissive
class SubjectInfo { constructor(public subject: ISubject, public index: number, public count: number, public isAchievement: boolean, public isAbility: boolean) { if (subject) { subject.count = count; } } } class SubjectPerformanceScore { name: s...
JavaScript
UTF-8
1,551
2.546875
3
[]
no_license
const colors = [ {'rgb': '250,250,160', 'srm': 1}, {'rgb': '250,250,105', 'srm': 2}, {'rgb': '245,246,50', 'srm': 3}, {'rgb': '235,228,47', 'srm': 4}, {'rgb': '225,208,50', 'srm': 5}, {'rgb': '215,188,52', 'srm': 6}, {'rgb': '205,168,55', 'srm': 7}, {'rgb': '198,148,56', 'srm': 8}, {...
Java
UTF-8
3,927
2.171875
2
[ "BSD-3-Clause" ]
permissive
package com.applozic.mobicomkit.uiwidgets.attachmentview; import android.media.MediaRecorder; import android.support.v4.app.FragmentActivity; import android.widget.Toast; import com.applozic.mobicomkit.uiwidgets.R; import com.applozic.mobicomkit.uiwidgets.conversation.ConversationUIService; import com.applozic.mobico...
Java
UTF-8
7,893
1.742188
2
[]
no_license
package com.judian.goule.store.adapter; import android.app.Activity; import android.content.Intent; import android.util.Log; import android.view.View; import android.widget.ProgressBar; import android.widget.TextView; import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.BaseView...
SQL
UTF-8
599
3.25
3
[]
no_license
CREATE TABLE departments ( dept_no VARCHAR, dept_name VARCHAR(30) ); CREATE TABLE dept_emp ( emp_no INT, dept_no VARCHAR(10), from_date DATE, to_date DATE ); CREATE TABLE dept_manager ( dept_no VARCHAR(10), emp_no INT, from_date DATE, to_date DATE ); CREATE TABLE employees ( emp_no IN...
Java
UTF-8
493
3.25
3
[]
no_license
package com.company; public abstract class Animal { public String name; public int run; public int swim; private final int MaxRunLength = 0; private final int MaxSwimLength = 0; abstract void swim(int length); abstract void run(int length); public static void animalCount...
Java
UTF-8
862
3.46875
3
[]
no_license
package OptionalTaskOne; import java.util.Arrays; import java.util.Scanner; public class OptionalOneLength { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String numbers = scanner.nextLine(); String[] array = numbers.split(" "); System.out.prin...
Python
UTF-8
1,095
2.5625
3
[]
no_license
# -*- coding: utf-8 -*- # Define here the models for your scraped items # # See documentation in: # https://doc.scrapy.org/en/latest/topics/items.html # import scrapy # # # class MyspiderItem(scrapy.Item): # # define the fields for your item here like: # # name = scr # # user_agent 设置ua # coucurren...
Java
UTF-8
5,352
2.40625
2
[]
no_license
package com.stw.kanban.client.view; import java.util.ArrayList; import junit.framework.Assert; import org.junit.Test; import com.google.gwt.core.client.GWT; import com.google.gwt.user.client.ui.Widget; import com.stw.kanban.client.AbstractKanbanBoardGwtTestCase; import com.stw.kanban.client.entities.Boar...
Swift
UTF-8
1,996
2.875
3
[]
no_license
// // ViewController.swift // PickerView // // Created by Macbook Pro A1990 on 12/6/18. // Copyright © 2018 Macbook Pro A1990. All rights reserved. // import UIKit class ViewController: UIViewController { @IBOutlet weak var uiPickerView: UIPickerView! override func viewDidLoad() { super.view...
Java
UTF-8
6,020
1.84375
2
[]
no_license
package org.ootb.simulator; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ser.Serializers; import org.junit.After; import org.junit.Before; import org.junit.Test; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.H...
C++
UTF-8
1,386
2.65625
3
[ "MIT" ]
permissive
/** * @file image.h * @brief JPEG decoding library. */ #pragma once #include "types.h" namespace nn { namespace image { // there's probably more enum JpegStatus { OK = 0, INVALID_FORMAT = -32, UNSUPPORTED_FORMAT = -33, OUT_OF_MEMORY =...
Python
UTF-8
595
3.25
3
[ "BSD-3-Clause" ]
permissive
# original Eratosthenes prime sieve from http://www.macdevcenter.com/pub/a/python/excerpt/pythonckbk_chap1/index1.html?page=2 # with additions from https://stackoverflow.com/questions/2211990/how-to-implement-an-efficient-infinite-generator-of-prime-numbers-in-python import itertools def eratosthenes(): d = {} ...
Python
UTF-8
2,165
2.609375
3
[]
no_license
import pandas, cv2 import tensorflow as tf import numpy as np import math def convert_reference(reference): ref_str = str(reference) if reference < 10: index = '0000' elif reference < 100: index = '000' else: index = '00' return index + ref_str def read_images(index): ...
Java
UTF-8
91
1.679688
2
[]
no_license
package com.dms.web.beans; public enum Toast { success, info, warning, error; }
Java
UTF-8
4,986
1.890625
2
[ "Apache-2.0" ]
permissive
/* * Copyright 2012-2023 the original author or authors. * * 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by a...
C#
UTF-8
1,146
2.53125
3
[]
no_license
using System; using Server; using Server.Targeting; namespace Server.Engines.Jail { /// <summary> /// Generic target for use in the jailing system /// </summary> public class JailTarget : Target { /// <summary> /// The function that should be called if the targeting action is succesful /// </summary> Jail...
C
UTF-8
3,683
3.75
4
[]
no_license
// Question : Write a program to simulate online ticket reservations. Implement a write lock. Write a program to open a file, store a ticket number, and exit. Write a separate program, to open the file, implement write lock, read the ticket number, increment the number, and print the new ticket number then close the...
Go
UTF-8
6,298
2.609375
3
[ "MIT" ]
permissive
package appencryption_test import ( "fmt" "math/rand" "testing" "time" "github.com/stretchr/testify/assert" "github.com/godaddy/asherah/go/appencryption" "github.com/godaddy/asherah/go/appencryption/internal" "github.com/godaddy/asherah/go/appencryption/pkg/crypto/aead" "github.com/godaddy/asherah/go/appenc...
C++
UTF-8
237
3.0625
3
[]
no_license
#include <stdio.h> #include <math.h> #define PI 3.14159 int main() { double radius,area; printf("Enter radius (e.g. 10):"); scanf("%lf", & radius); area = PI*radius*radius; printf("\n Area = %lf\n", area ); return 0; }
Java
UTF-8
7,745
2.03125
2
[]
no_license
package com.app; import com.app.model.*; import com.app.model.dto.ProductDto; import com.app.model.modelMappers.ModelMapper; import com.app.payloads.requests.LoginPayload; import com.app.repository.ProductRepository; import com.app.repository.RoleRepository; import com.app.repository.UserRepository; import com.app.ser...
C
UTF-8
1,401
3.765625
4
[]
no_license
/* write a program which shows a menu card of a Burger house and give the customer the choice of veg and non veg and each of them consist of 4 different types of burger and print the order at least and ask them again for more using do while loop and nested switch Input: Welcome to Burger King please select from the ...
C++
UTF-8
1,200
3.484375
3
[]
no_license
#include<iostream> #include<stdio.h> #include<vector> #include<string> #include<stdlib.h> using namespace std; int maxArea(vector<int>& height) { int l = 0; int r = height.size() -1 ; int result = INT_MIN; while(l<r){ int curArea = (r-l) * min(height[r], height[l]); result = max(result,...
Java
UTF-8
532
3.296875
3
[]
no_license
package JavaPracticeGitHub.C26_HashTable; import java.util.*; public class LengthLongestSubstring { public int lengthOfLongestSubstring(String s) { Map<Character,Integer> myMap = new HashMap<>(); int max = 0; for(int j = 0, i = 0; j < s.length() ; j++){ if(myMap.containsKey(s.c...
Markdown
UTF-8
10,812
2.859375
3
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
permissive
<!-- PROJECT LOGO --> <br /> <p align="center"> <h1 align="center">JavaScript PubSub</h1> <p align="center"> Small and fast JavaScript PubSub library designed for writing maintainable and decoupled code in JavaScript. <br /> </p> </p> <!-- TABLE OF CONTENTS --> ## Table of Contents * [About the Proj...
JavaScript
UTF-8
2,041
3.28125
3
[]
no_license
let output = document.querySelector(".calculator__output") var btns = document.querySelectorAll(".btn") btns.forEach(btn => btn.addEventListener("click", operations)) let switchToggle = document.querySelector('.button-switch') switchToggle.addEventListener('click', toggleTheme) function operations (event){ event.p...
Python
UTF-8
1,207
2.8125
3
[]
no_license
from src.modules.kit.interface import AbstractKNN from src.modules.utilities.model.impl.equal import ModelEqualKNN from src.modules.utilities.learning.interface import AbstractLearningKNN class LearningKNNEqual(AbstractLearningKNN): def __init__(self, classifier: AbstractKNN, size: int, classes: int, max_k=20, ra...
JavaScript
UTF-8
245
2.90625
3
[]
no_license
let firtsName = 'Amir'; lastname = 'Ahad' fullName = firtsName + ' ' + lastname let score = 100, bonus= 30; totalscore = score+bonus // console.log(name); console.log(totalscore); console.log(fullName); console.log(firtsName + ' ' + lastname);
Markdown
UTF-8
2,175
2.75
3
[]
no_license
--- title: Universal Package Manager author: Amjad Masad date: 2018-07-19T07:00:00.000Z --- Open-source has revolutionized software development -- it wouldn't be an overstatement to say that it's been the most significant productivity win for developers in the last decade or so. At Repl.it, our goal is to make program...
Java
UTF-8
1,238
2.265625
2
[]
no_license
package agh.edu.pl.project.controllers; import agh.edu.pl.project.models.entities.User; import agh.edu.pl.project.models.views.UserView; import agh.edu.pl.project.repositories.UserRepository; import agh.edu.pl.project.services.UserService; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Co...
SQL
UTF-8
19,315
3.375
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.6.1 -- http://www.phpmyadmin.net -- -- Хост: localhost -- Время создания: Июн 12 2016 г., 19:20 -- Версия сервера: 5.5.43-37.2 -- Версия PHP: 5.6.21 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; ...
Java
UTF-8
2,753
2.40625
2
[ "Apache-2.0" ]
permissive
/* $Id$ */ /** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); y...
C#
UTF-8
2,071
3.125
3
[ "Apache-2.0" ]
permissive
using System; using System.Collections.Generic; using System.Linq; namespace Whitelog.Core.LogScopeSyncImplementation { public static class LogScopeSyncFactory { private static Queue<Type> _types; class A1 { } class A2 { } class A3 { } class A4 { } class A5 { } ...
JavaScript
UTF-8
1,801
2.9375
3
[]
no_license
window.addEventListener("DOMContentLoaded", function (e) { var height = parseInt(document.getElementById('maze_container').getAttribute('height')); var width = parseInt(document.getElementById('maze_container').getAttribute('width')); let Maze = new MazeBuilder(width, height); Maze.placeKey(); Maze....
Shell
UTF-8
3,907
3.96875
4
[]
no_license
#!/bin/bash cur_dir=$(pwd) script_name=$(basename $0) script_dir=$(dirname $0) root_dir=${script_dir}/.. log_dir=${script_dir}/log data_dir=${script_dir}/data mkdir -p $log_dir $data_dir result=${log_dir}/create_result log=${log_dir}/create.log tmp_log=${log_dir}/create_$$ server_ip_list=${data_dir}/server_ip_lis...
Python
UTF-8
156
2.71875
3
[]
no_license
# Jared Medeiros # Comp340 HW5 #Test commit import lexer srcCode = "((12+3*5)+5/4)" tokSeq = lexer.tokenize(srcCode) for i in tokSeq: print(i.type, i.value)
C++
UHC
1,374
3.140625
3
[]
no_license
#include <iostream> using namespace std; int main(void) { int C; cin >> C; for (int c = 0; c < C; c++) { int N; cin >> N; int before[100]; int cur[100]; int before_count[100]; int cur_count[100]; int max = 0; int max_count; before_count[0] = 1; cur_count[0] = 1; //ʱȭ for (int n = 1; n ...
Markdown
UTF-8
627
4.03125
4
[]
no_license
# $random Returns random numbers. ## Usages There are two usages of the `$random` function. ### Usage #1 ``` $random ``` Returns a random number between 0 and 9. ### Usage #2 ``` $random[minimum;maximum] ```` Returns a random number between 'minimum' and 'maximum'. ## Example ``` $nomention 🎲 You rolled `$random[1...
Markdown
UTF-8
3,151
2.71875
3
[ "MIT" ]
permissive
# Solution Generate the YAML for a Deployment plus Pod for further editing. ```shell $ kubectl create deployment deploy --image=nginx --dry-run=client -o yaml > deploy.yaml ``` Edit the labels. The selector should match the labels of the Pods. Change the replicas from 1 to 3. ```yaml apiVersion: apps/v1 ...
Markdown
UTF-8
1,055
2.765625
3
[ "MIT" ]
permissive
--- title: Richard Stobart shortlisted for UK Agile Awards 2014 date: "2014-10-24T11:55:00+01:00" published: true --- <p>Unboxed Consulting CEO, Richard Stobart, has been shortlisted for this year’s UK Agile Awards.<br/></p> <p>The UK Agile Awards were created to recognise and award top Agile talent and recognise th...
C
UTF-8
2,894
3.5
4
[]
no_license
// a_pipe.c #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <stdio.h> #include <stdlib.h> #include <wait.h> int main (int argc,char *argv[]) { int i; char* arguments1 [] = { "ls", "-la", 0 }; char* arguments2 [] = { "grep", "ejemplo", 0 }; char* arguments3 [...
C#
UTF-8
4,873
2.59375
3
[ "Unlicense" ]
permissive
using System; using System.Net; using System.Net.Sockets; using System.Collections.Generic; using System.Text; using UnityEngine; namespace RémiMod { public class TcpServer { private const int BUFFER_SIZE = 16000; private TcpListener tcpListener; private List<TcpClient> tcpClients = ne...
Markdown
UTF-8
812
2.625
3
[]
no_license
### MongoDB #### Download Docker for MongoDB `docker pull mongo` #### Run Docker for MongoDB (using port 27017, name mongo) `docker run -d -p 27017:27017 --name mongo mongo` #### Run MongoShell on Docker Instance `docker exec -it mongo bash` `mongo` #### Execute MongoShell Commands `show dbs` `use local` `db.st...
C++
UTF-8
3,842
3.140625
3
[]
no_license
#include "sceneHandler.h" #include <iostream> #include <string> #include <fstream> #include <vector> #include <sstream> #include "Background.h" #include "ScreenRoot.h" #include "Creature.h" #include "Thing.h" std::vector<std::string>& split(const std::string& str, char delim, std::vector<std::string>& elems ) { ...
Python
UTF-8
798
4
4
[]
no_license
import math def split_check(total, num_of_people): if num_of_people <= 1: # Make condition if there is not a single person to split the check raise ValueError('More than 1 person is required to split the check') cost_per_person = math.ceil(total / num_of_people) return cost_per_perso...
C++
UTF-8
987
2.9375
3
[]
no_license
#include<iostream> #include<vector> #include<math.h> using namespace std; int main(){ // Write your code here vector<bool> prime(101,true); prime[0]=false; prime[1]=false; for(int i=2;i<=sqrt(100);i++){ if(prime[i]){ for(int j=i*i;j<=100;j=j+i){ prime[j]=false; ...
Python
UTF-8
286
3.40625
3
[]
no_license
# # debug_2.py: # # L3-2: We'll run this in the PyCharm debugger to understand print()'s behavior... # result = '' starting = input ("Enter a string: ") for ch in starting: print (ch,end='') print() # needed to dump string accumulating in output print buffer before program ends
Java
UTF-8
482
3.25
3
[]
no_license
package com.liar.basic; import java.util.Arrays; import java.util.Scanner; /** * 数组排序 */ public class Sort { public static void main(String[] args) { Scanner sr = new Scanner(System.in); int n=sr.nextInt(); int[] arr=new int[n]; for (int i=0;i<n;i++) { arr[i]=sr.nextI...
JavaScript
UTF-8
916
3.375
3
[]
no_license
var NewCard = function(arg1, arg2){ var self = this; self.name = "thisCard" + arg1; console.log("new card object"); var maxSets = array.length; var hasElement = false; while (hasElement == false){ self.set = Math.round(Math.random() * maxSets); self.value = array[self.set]; if (self.value == null){ // ...
Java
UTF-8
1,295
2.0625
2
[]
no_license
package com.renrentui.renrenapi.dao.impl; import org.springframework.stereotype.Repository; import com.renrentui.renrenapi.common.DaoBase; import com.renrentui.renrenapi.dao.inter.IOrderLogDao; import com.renrentui.renrenentity.OrderLog; @Repository public class OrderLogDao extends DaoBase implements IOrderLogDao{ ...
Java
WINDOWS-1250
2,002
2.28125
2
[]
no_license
package br.com.planejamentoagro.controller; import br.com.planejamentoagro.R; import br.com.planejamentoagro.helper.DiretoriosHelper; import br.com.planejamentoagro.helper.FormularioClienteHelper; import br.com.planejamentoagro.model.Cliente; import br.com.planejamentoagro.model.dao.ClienteDAO; import android.a...
Python
UTF-8
239
2.8125
3
[ "Apache-2.0" ]
permissive
import random import string def random_port(): return random.randint(1024, 65536) def random_string(k=5): return ''.join(random.choices(string.ascii_lowercase, k=k)) def random_int(a=0, b=10): return random.randint(a, b)
Python
UTF-8
288
2.5625
3
[]
no_license
x=[-4,1,2,3,4,50,0] a = sum([v>0 for v in x if v!=0]) b = [i for i in range(len(x)) if x[i]!=0] c = [v for v in x if (v in range(-3,50))] d = max([v for v in x if v%3 == 0]) e = sum([v for v in x if v > 10])/len([v for v in x if v > 10]) f = [i for i in range(len(x)) if x[i] == min(x)]
Markdown
UTF-8
7,962
2.859375
3
[ "CC-BY-4.0", "MIT" ]
permissive
--- keywords: powershell,cmdlet ms.date: 10/04/2019 online version: https://learn.microsoft.com/previous-versions/powershell/module/microsoft.powershell.core/about/about_prompts?view=powershell-3.0&WT.mc_id=ps-gethelp schema: 2.0.0 title: about_Prompts --- # About Prompts ## Short description Describes the `Prompt` fu...
Java
UTF-8
1,052
2.953125
3
[]
no_license
//https://www.hackerrank.com/challenges/common-child/ public class CommonChild { public static void main(String[] args) { System.out.println(solve("ABCD", "ABDC")); System.out.println(solve("HARRY", "SALLY")); System.out.println(solve("SHINCHAN", "NOHARAAA")); System.out.println(sol...
PHP
UTF-8
486
3.453125
3
[]
no_license
<?php /*改行*/ $br = "<br />"; /*$x=3*/ $x = 3; /*$y=4*/ $y = 4; /*数値の大小を比較する*/ /*条件分岐1*/ if( $x>$y ){ echo "TRUE" . $br; } else { echo "FALSE" . $br; } /*条件分岐2*/ if( $x<$y ){ echo "TRUE" . $br; } else { echo "FALSE" . $br; } /*条件分岐3*/ if( $x>=$y ){ echo "TRUE" . $br; } else { echo...