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
2,928
2.90625
3
[]
no_license
package visualization; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.util.LinkedList; import org.graphstream.graph.*; import org.graphstream.graph.implementations.*; import org.graphstream.ui.view.Viewer; import simulation.Main; public class Plotter { static Gr...
Java
UTF-8
1,086
2.796875
3
[]
no_license
package com.softserve.BookLibrary.validator; import com.softserve.BookLibrary.entity.Book; import com.softserve.BookLibrary.manager.BookManager; import javax.ejb.EJB; import javax.validation.ConstraintValidator; import javax.validation.ConstraintValidatorContext; public class UniqueIsbnValidator implements Constrain...
C++
UTF-8
502
3.28125
3
[]
no_license
//1108. Defanging an IP Address class Solution { public: string defangIPaddr(string address) { string add; int n=address.size(); for(int i=0;i<n;i++) { if(!(address[i]=='.')) { add.push_back(address[i]); } el...
Shell
UTF-8
2,560
3.40625
3
[]
no_license
# If not running interactively, don't do anything [ -z "$PS1" ] && return UNAME=`uname -s` # Source all files in the ~/.bash/ directory source ~/.bash/* # -------------------------------------- # ALIASES # -------------------------------------- alias ll='ls -alF' alias la='ls -A' alias l='ls -CF' alias fn='find . -...
C++
UTF-8
467
3.015625
3
[ "MIT" ]
permissive
#ifndef SNAKEBLOCK_H #define SNAKEBLOCK_H // Snake body RGB values: const int red = 240; const int green = 150; const int blue = 50; class SnakeBody { public: SnakeBody(float sbX, float sbY, float sbZ); void draw(); // getters and setters (RGB & XYZ) void setColour(float sbR, float sbG, float sbB); void setX(f...
Java
UTF-8
261
1.96875
2
[]
no_license
package stepDefinitions; import cucumber.api.java.en.And; import pages.SignUpPage; public class SignUpSteps { private SignUpPage page = new SignUpPage(); @And("I intrude my email") public void iIntrudeMyEmail() { page.setEmail(); } }
PHP
UTF-8
184
2.5625
3
[]
no_license
<?php declare(strict_types = 1); namespace App\Errors; class FloatError extends Error { public function getTypeName(): string { return 'Float'; } }
TypeScript
UTF-8
4,988
3.09375
3
[]
no_license
import { MGPMap } from '../MGPMap'; import { MGPOptional } from '../MGPOptional'; describe('MGPMap', () => { it('Set should bug if key value was already present', () => { const map: MGPMap<string, string> = new MGPMap(); map.set('oui', 'yes'); expect(() => map.set('oui', 'si')).toThrow(); ...
Python
UTF-8
412
2.734375
3
[ "Apache-2.0" ]
permissive
import unittest import encoder.xml class XmlTests(unittest.TestCase): @classmethod def setUpClass(cls): cls.encode = encoder.xml.Encoder().encode def test_sample_doc(self): class SampleDoc: def __xml__(self, tag): with tag.body(): yield 'Hel...
Java
UTF-8
365
1.757813
2
[]
no_license
package com.adnanali.foodish.Interface; import com.adnanali.foodish.Model.CustomDictionary; public interface ConnectorInterface { void changeFragment(boolean isAddToBackStack, android.support.v4.app.Fragment fragment, CustomDictionary... dictionary); void removeFragment(android.support.v4.app.Fragment frag...
Markdown
UTF-8
728
3.5
4
[]
no_license
# 题目分析 ## 三次遍历思想 ### 将输入的字符串转成数组<br>将输入的第二个和第三个值push到一个数组里面<br>遍历第一个数组,如果这个数组的第i项和第二个数组的第0项相等,并且这个数组的第i+1项和第二个数组的第1项相等,则判断一下第i+2有没有值,如果有就push到一个新数组中。<br>最后,返回这个数组 ``` var findOcurrences = function(text, first, second) { let arr=text.split(' ') let input=[] let output=[] input.push(first,second) for(let i=...
Rust
UTF-8
1,969
3.046875
3
[ "MIT" ]
permissive
use ndarray::{Array1, Array2, ArrayView1}; #[derive(Debug, Clone)] pub struct Iris { iris_vec: Vec<f64>, pub iris: Array2<f64>, class_vec: Vec<f64>, pub class: Array2<f64>, } impl Iris { pub fn new( sepal_length: f64, sepal_width: f64, petal_length: f64, petal_width...
Java
UTF-8
6,099
2.015625
2
[]
no_license
package com.leckan.popularmoviestwo.UI; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.os.Parcelable; import android.preference.PreferenceManager; import android.support.v7.a...
C#
UTF-8
594
2.796875
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CommonCode { public class ProgramDescription { public string Name { get; set; } public System.Type Type { get; set; } public ProgramDescription() { ...
PHP
UTF-8
588
2.671875
3
[]
no_license
<?php declare(strict_types=1); namespace BS\SchoolBoard\FactoryMethod\Strategy\Response; use BS\SchoolBoard\Entity\SchoolBoard\SchoolBoardInterface; /** * Interface GeneratorInterface * * @package BS\SchoolBoard\FactoryMethod\Strategy\Response */ interface GeneratorInterface { /** * @param \BS\SchoolBoa...
Java
UTF-8
1,105
1.835938
2
[]
no_license
package ir.sharif.math.ap99_2.tinsta_shared.profile.event; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import ir.sharif.math.ap99_2.tinsta_shared.event.Event; @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, property = "type") @JsonSubTypes({ ...
Java
UTF-8
16,753
1.734375
2
[]
no_license
package org.xtext.urdf.generator; import java.io.File; import java.lang.reflect.Field; import java.util.Arrays; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.stream.Stream; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import ...
Java
UTF-8
1,257
2.03125
2
[]
no_license
package org.comroid.auth.repo; import org.comroid.auth.entity.UserAccount; import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.CrudRepository; import org.springframework.transaction.annotation.Transactional; import ...
C++
UTF-8
246
2.734375
3
[]
no_license
#ifndef DOG_HPP #define DOG_HPP #include "Animal.hpp" class Dog: public Animal { public: virtual void makeSound(void) const; Dog &operator=(Dog const &rhs); Dog(Dog const &rhs); Dog(std::string type); Dog(); virtual ~Dog(); }; #endif
PHP
UTF-8
174
2.78125
3
[]
no_license
<?php $a = 'abc'; var_dump($a); // null var_dump($b); // null unset($a); var_dump($a); // check if variable exist $d = ''; var_dump(isset($d)); var_dump(isset($zzzzzz));
C++
UTF-8
5,481
3.40625
3
[]
no_license
Multithreading До многоядерных процессоров ускорение выполнения программ out-of-order execution SIMD Многопоточность была и раньше и реализовалась с помощью прерываний Можно также несколько компьютеров использовать с одной расшареной памятью, или без шареной памяти (concurrent и distributed соответственно) Программа ...
Markdown
UTF-8
3,254
2.6875
3
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
--- id: jwt-blacklisting title: JWT Blacklisting sidebar_label: JWT Blacklisting --- [JWT](https://jwt.io/) Blacklisting is one of the RIG's core features. Imagine a use case where someone does a malicious action using specific JWT. By blacklisting this JWT, you can prevent any other malicious actions. Once it's black...
Markdown
UTF-8
1,694
3.9375
4
[ "MIT" ]
permissive
# Programming Assignment 2: Deques and Randomized Queues > Please navigate to the official [assignment URL](http://coursera.cs.princeton.edu/algs4/assignments/queues.html) for complete details. Write a generic data type for a deque and a randomized queue. The goal of this assignment is to implement elementary data st...
Java
UTF-8
554
2.1875
2
[]
no_license
package com.zugara.atproj.lampsplus.utils; import android.app.Activity; import android.content.Context; import android.content.Intent; import java.lang.reflect.Method; import java.util.HashMap; /** * Created by andre on 15-Dec-18. */ public class ApplicationUtil { public static void startActivity(Activity sr...
Markdown
UTF-8
3,009
2.671875
3
[ "LicenseRef-scancode-unknown-license-reference", "MIT" ]
permissive
+++ # Experience widget. widget = "experience" # See https://sourcethemes.com/academic/docs/page-builder/ headless = true # This file represents a page section. active = true # Activate this widget? true/false weight = 40 # Order that this section will appear. title = "Experience" subtitle = "" # Date format for ...
Python
UTF-8
2,135
2.5625
3
[]
no_license
import collections import datetime import gzip import io import json import logging import operator import os import sys START = int(sys.argv[1]); DELTA = int(sys.argv[2]) * 60 SUFFIX = '.json.gz' def xy(a, b): return {'x': a - b, 'y': b - a} os.chdir('stations2') paths = sorted(p for p in os.listd...
Java
UTF-8
809
2.09375
2
[]
no_license
package com.example.demo.entity; import java.io.Serializable; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.AllArgsConstructor; i...
JavaScript
UTF-8
1,935
2.75
3
[]
no_license
const express = require('express'); const expressAsyncHandler = require('express-async-handler'); const Employee = require('../models/Employee'); const authMiddleware = require('../middlewares/authMiddleware'); const employeeRouter = express.Router(); //Create Employee employeeRouter.post('/', authMiddleware, expr...
Java
UTF-8
318
1.914063
2
[]
no_license
package com.lms.service; import org.springframework.web.multipart.MultipartFile; import com.lms.model.dict.FileType; import com.lms.model.entity.File; public interface FileService { public Long saveFile(MultipartFile file, FileType type); public void deleteFile(Long id); public File get(Long id); }
Ruby
UTF-8
126
3.109375
3
[]
no_license
def f1 x, a x == 0 ? a : f1(x - 1, x * a) end def f x f1 x, 1 end p f 0 p f 1 p f 2 p f 3 p f 100 p f 1000 # p f 100000
Python
UTF-8
288
2.9375
3
[]
no_license
from tkinter import * root = Tk() widget = Label(root, text="Eat at Joe's") # setting label text # setting the background, foreqround, cursor, and font widget.config(bg='black', fg='red', cursor='cross', font=('Times', 24, 'italic')) widget.pack(expand=YES, fill=BOTH) root.mainloop()
C
UTF-8
1,566
2.875
3
[]
no_license
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* main_pushswap.c :+: :+: :+: ...
Python
UTF-8
3,116
2.75
3
[]
no_license
# -*- coding: utf-8 -*- import sys import cv2 import numpy as np from .utils.transformer import imageTransformer from .polygones import translate_poly, transform_M_poly from .utils.util import getBbox def rotate_layer(layers, dictRotation): """Rotate Layers. Args: layers (list[ndar...
Markdown
UTF-8
1,196
2.75
3
[ "MIT" ]
permissive
--- layout: post title: Terraform Basics date: 2017-09-19 summary: Defines all your infrastructure as code. I learned this through a lot of trial and error over the course of a week. categories: terraform iac --- #### Files and Folders * `.tfstate` Stores the current configuration of your infrastruct...
C++
UTF-8
1,167
3.046875
3
[ "MIT" ]
permissive
#include "thread_pool.h" thread_pool::~thread_pool() { stop(); } void thread_pool::init_thread_size(int size) { for (int i = 0; i < size; ++i) { auto t = std::make_shared<std::thread>(std::bind(&thread_pool::run_task, this)); threads_.emplace_back(t); } } void thread_pool::stop() { ...
Java
UTF-8
386
2.234375
2
[]
no_license
package come.wry.dragger; import come.wry.dragger.MVP.MainActivity; import dagger.Component; /** * 作者:wry * 时间:2017/3/20:11:43 * 说明: */ @Component(modules = MainModule.class) // 作为桥梁,沟通调用者 和 依赖对象库 public interface MainComponent { //定义注入的方法 (指定注入到哪个类中) void inject(MainActivity activity); }
C#
UTF-8
1,566
2.53125
3
[]
no_license
using System.Collections; using System.Collections.Generic; using UnityEngine; public class SeeThroughSprite : MonoBehaviour { public SpriteRenderer sprite; public Color transpartentColour; public float speed = 1; bool fadeInBool; bool fadeOutBool; void Start() { if(!sprite)...
C++
UTF-8
3,975
2.578125
3
[ "MIT" ]
permissive
/* * PipelineReg.cpp * * Created on: 3 Jul 2012 * Author: db434 */ #include "PipelineReg.h" #include "../../Exceptions/InvalidOptionException.h" // Toggle whether pipeline registers are heavily clock gated. // 0 = either whole register is read/written, or none of it is. // 1 = sections of each register can...
C++
UTF-8
1,065
2.84375
3
[]
no_license
/*-------------------------------------------------------------- Copyright (C) 2021 DigiPen Institute of Technology. Reproduction or disclosure of this file or its contents without the prior written consent of DigiPen Institute of Technology is prohibited. File Name: Input.h Project: CS230 Author: Kevin Wright Creation...
Java
UTF-8
469
2.15625
2
[ "IJG" ]
permissive
package org.apache.http.conn.scheme; import java.io.IOException; import java.net.InetAddress; @Deprecated public abstract interface HostNameResolver { public abstract InetAddress resolve(String paramString) throws IOException; } /* Location: C:\Games\SteamLibrary\steamapps\common\Wurm Unlimited D...
C
UTF-8
766
3.703125
4
[]
no_license
#include <stdio.h> #include <ctype.h> #include <stdbool.h> void read_word(int counts[26]); bool equal_array(int counts1[26],int counts2[26]); int main() { int a[26] = {0}, b[26] = {0}; printf("Enter first word: "); read_word(a); printf("Enter second word: "); read_word(b); bool flag = equal_array(a,b); pri...
Python
UTF-8
12,428
2.546875
3
[]
no_license
import pandas as pd # read the csv file raw_csv_data = pd.read_csv('Absenteeism_data.csv') #expand the columns and rows display pd.set_option('display.max_rows', 700) pd.set_option('display.max_columns', 12) pd.set_option('display.width', 1000) #print(raw_csv_data) #hena howa 3ayz y3ml copy ll csv file ...
SQL
UTF-8
641
3.28125
3
[]
no_license
-- This script Will only run if you are using Oracle Database 10g -- or higher -- This script does the following: -- Connects as the store user and creates items for the -- Oracle Database 10g examples featured in Chapter 1 CONNECT store/store_password; -- BINARY_FLOAT and BINARY_DOUBLE example CREATE ...
C++
UTF-8
1,470
2.671875
3
[ "MIT" ]
permissive
#define mp make_pair #define pb push_back typedef pair <int, int> pairs; typedef set<pairs> spll; typedef list<pair <int, int> > lpii; class Solution { public: vector<vector<int>> reconstructQueue(vector<vector<int>>& people) { vector<vector<int>> ans; if(people.size() == 0) ret...
C#
UTF-8
18,111
2.546875
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Collections; using System.Data; using System.Data.Common; using System.Data.SqlClient; using System.Data.SqlTypes; using System.Net.Mail; using Entidades; using MySql.Data.MySqlClient; namespace Persistencia { public...
JavaScript
UTF-8
1,396
2.65625
3
[]
no_license
// eslint-disable-next-line import/no-extraneous-dependencies const sharp = require('sharp'); const fs = require('fs'); const path = require('path'); const target = path.resolve(__dirname, '../../src/public/images'); const destination = path.resolve(__dirname, '../../dist/images'); if (!fs.existsSync(destination)) { ...
PHP
UTF-8
3,956
2.578125
3
[]
no_license
<?php class EntryDB { public $conn = ""; public $query = ""; function OpenConnection() { $this->conn =mysql_connect("localhost", "bietthuleh_dba", "zxcVBN123") or die("can't connect server"); mysql_query("set names 'utf8'"); mysql_select_db("bietthuleh_db",$this->conn) or...
Shell
UTF-8
1,015
3.171875
3
[ "Apache-2.0" ]
permissive
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" WD=/tmp/mkdeb USR_SHARE_DOCS=$WD"/usr/share/doc/qtcreator-plugin-wizard-opaque-class" CHANGE_LOG_FILE=$WD"/usr/share/doc/qtcreator-plugin-wizard-opaque-class/changelog.Debian.gz" rm -rf $WD mkdir -p $WD/usr/share/qtcreator/templates/wizards/opaque-class mkdir -p ...
Swift
UTF-8
2,579
3.203125
3
[]
no_license
// // StringUtils.swift // CardRequisition // // Created by Raphael Carletti on 9/18/18. // Copyright © 2018 Raphael Carletti. All rights reserved. // import Foundation class StringUtils { static func formatCreditCardNumber(text: String) -> String { let textReplaced = text.replacingOccurrences(of: " "...
Python
UTF-8
1,302
4.21875
4
[]
no_license
""" You are given the lengths AB and BC. Your task is to find (angle , as shown in the figure) in degrees. Input Format The first line contains the length of side . The second line contains the length of side . Constraints Lengths and are natural numbers. Output Format Output in degrees. ...
PHP
UTF-8
890
3.203125
3
[]
no_license
<?php namespace Models\Output; /** * @author Mike Pearce <mike@mikepearce.net> * @package cardReader * @since 20/09/10 */ class Text extends AbstractOutput { /** * Output the data as a sting * @todo Make this a bit cleverer **/ public function out() { print "This is yo...
Java
UTF-8
763
2.421875
2
[]
no_license
package test.lky.zkclient; import org.I0Itec.zkclient.IZkChildListener; import org.I0Itec.zkclient.ZkClient; import java.util.List; /** * Created by kylong on 2016/9/3. */ public class Get_Children_Sample { public static void main(String[] args) throws InterruptedException { String path = "/test"; ...
JavaScript
UTF-8
1,584
2.53125
3
[]
no_license
import { createSlice } from '@reduxjs/toolkit' const initialState = { todoList: [], isEditing: false, selectedTodo: {} } const todoSlice = createSlice({ name: 'todos', initialState, reducers: { fetchTodo: (state, action) => { state.todoList = action.payload }, ...
Go
UTF-8
515
3.015625
3
[]
no_license
package request import ( "bytes" "encoding/json" "io" "io/ioutil" ) // Simple is the most simple request structure type Simple struct { DriverID int } // NewSimple is constructor of request.Simple which converts request body to equest.Simple func NewSimple(requestBody io.Reader) *Simple { s, _ := ioutil.ReadAl...
C++
UTF-8
2,027
3.1875
3
[ "MIT" ]
permissive
#include "cppgomoku/game_server.h" namespace gomoku { GameServer::GameServer(Board *b, Player *p1, Player *p2, bool silent) { board = b; player1 = p1; player2 = p2; this->silent = silent; } void GameServer::showGameInfo() { if (player1) { printf("[--Pla...
PHP
UTF-8
7,430
2.609375
3
[]
no_license
<?php class Test extends Activity { private $testId; public function setTestId($value) { $this->testId = $value; } public function getTestId() { return $this->testId; } private $question; public function setQuestion($value) { $this->Util()->ValidateString($value, 5000, 1, 'Pregunta');...
Ruby
UTF-8
294
2.6875
3
[]
no_license
module IssuesHelper def printTags(issue) tags = Tag.where("issue_id = ?", issue.id) allTags = "" tags.each do |tag| allTags = allTags + ", #" +tag.label end if allTags.length == 0 allTags = "None" else allTags = allTags[2..allTags.length] end return allTags end end
Markdown
UTF-8
2,155
2.9375
3
[]
no_license
## AWS Certificate Manager ![DNS and Certificates](../images/route-53-and-certificate-manager.png) #### Managed certificate renewal ACM creates free HTTPS certificates that are continuously renewed by Amazon. These managed renewals are more reliable than the common alternative certificates from "Let's Encrypt" which ...
Markdown
UTF-8
502
2.703125
3
[]
no_license
# SparseArray & ArrayMap ## SparseArray 内部通过两个数组来进行数据存储的 一个存储key (Key 只能是 int ) ,另外一个存储value 存取都通过二分搜索来查找 对 HashMap 优化了装箱拆箱的步骤 ## ArrayMap 内部通过两个数组来进行数据存储的 一个存储key的hashcode ,另外一个存储key,value [数据结构HashMap(Android SparseArray 和ArrayMap)](https://juejin.im/post/5b2a24dd5188257...
TypeScript
UTF-8
3,667
3.03125
3
[]
no_license
import { Component, Input} from '@angular/core'; @Component({ selector: 'calendar', templateUrl: 'calendar.html' }) export class CalendarComponent { month: Array<number>; @Input() today: Date; @Input() displaytype: string = 'week'; wHead: string[] = ['日', '一', '二', '三', '四', '五', '六'...
Markdown
UTF-8
2,659
3.078125
3
[]
no_license
--- date: 2023-01-15 tags: - java - clean code - gradle title: Spotless - an alternative to Checkstyle that applies the formatting type: Essay pinned: true --- [Checkstyle][4] is a wonderful tool when we want to enforce the style guidelines in the project. But it has 2 major problems: 1. It can't apply the form...
C++
UTF-8
2,105
2.703125
3
[]
no_license
#include "player.h" Player::Player( ScenePrimitive * obj) :obj(obj), cam(NULL), spotlight(NULL), coins(0) { zoffset = 0; homeSlice = 0; vel = Vector3(0,0,0); accl = Vector3(0,0,-1); levelPos = -1; maxSpeed = 40; } void Player::Load(Scene* scene) { cam = scene->getDefaultCamera(); cam -> setPosition(Vector3(1...
Swift
UTF-8
2,971
3
3
[ "MIT" ]
permissive
// // NewsDetailView.swift // News // // Created by Ravi Theja on 20/03/20. // Copyright © 2020 Idlebrains. All rights reserved. // import SwiftUI import URLImage let exampleArticle = ListItem(articleUrl: "https://www.theverge.com/2020/3/19/21187161/microsoft-directx-12-ultimate-api-release-xbox-series-x-pc-gamin...
TypeScript
UTF-8
2,515
3.078125
3
[ "MIT" ]
permissive
import { Post, Command } from "../types" import { MessageEmbed } from "discord.js"; import getErrString from '../getErrString' const paginationEmbed = require("discord.js-pagination"); import axios from 'axios'; //Formats an Array of Posts into a String that can be sent as an embedded message const postsToString = (pA...
Python
UTF-8
5,731
2.953125
3
[]
no_license
import streamlit as st import pydeck as pdk from requests import get from json import loads from agente import Buscador from lista_cidades import lista_cidades class RotasCidades: def __init__(self): self.limite = False self.cidades = lista_cidades self.cidade_final = "" self.metod...
C++
UTF-8
788
2.6875
3
[]
no_license
#pragma once #include "Piloto.h" #include "Consola.h" #include <vector> #include <iostream> using namespace std; class Pista { int maxCar; int metros; vector <Piloto*> pilotosPista; public: Pista(int maxCar, int metros); ~Pista(); int returnTamPista() const { return metros; } int returnMaxCarros() cons...
Python
UTF-8
1,767
2.9375
3
[ "CC-BY-3.0" ]
permissive
import unicodedata import codecs import sys import scipy as sp import hmm tbl = dict.fromkeys(i for i in xrange(sys.maxunicode) if unicodedata.category(unichr(i)).startswith('P')) def uniq(listinput): """ This finds the unique elements of the list listinput. """ """ This will be provided for t...
C++
UTF-8
421
2.625
3
[ "Unlicense" ]
permissive
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> using namespace std; // https://www.hackerrank.com/contests/30-days-of-code/challenges/day-0-print-hello-world/submissions/code/4670326 int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT ...
Java
UTF-8
7,079
2.15625
2
[]
no_license
package com.deals.sine90.dealsinstreet; import android.content.Intent; import android.content.res.Resources; import android.graphics.PorterDuff; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.MenuItem; import android.view.View; import android.widget.ImageView; import and...
PHP
UTF-8
837
3.15625
3
[]
no_license
<?php class Pedido{ private $cliente = NULL; private $productos = NULL; public function __construct(Cliente $cliente=NULL,Productos $productos=NULL){ if($cliente!==NULL){ $this->setCliente($cliente); } } public function ...
TypeScript
UTF-8
543
3.921875
4
[]
no_license
abstract class Animal { private name: string; constructor(theName: string){ this.name = theName; } walk(distance: number){ console.log(`Hi, my name is ${this.name} and I'm walking ${distance} meters`); } } // abstract can not instancete let aAnimal = new Animal("Test"); // aAnimal....
C
UTF-8
5,752
3.28125
3
[]
no_license
/*********************************************************************** * * OBJECT.C * Object File Routines for 68000 Assembler * * Function: initObj() * Opens the specified object code file for writing. If the file cannot * be opened, then the routine prints a message and exits. ...
Java
UTF-8
163
1.84375
2
[]
no_license
package com.exalto.UI.grid; import javax.swing.JButton; public class Corner extends JButton { public Corner() { super(""); setBorderPainted(false); } }
Java
UTF-8
2,240
1.9375
2
[]
no_license
package cn.appsys.service; import java.util.List; import java.util.Map; import org.apache.ibatis.annotations.Param; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import cn.appsys.dao.AppInfoMapper; import cn.appsys.pojo.AppCategory; import cn.appsys.poj...
C++
UTF-8
2,349
3.40625
3
[ "BSD-3-Clause", "LicenseRef-scancode-unknown-license-reference", "ISC" ]
permissive
#include "nb/NBMatrixMath.h" using namespace NBMath; /** Invert a two by two matrix easily given: [a b c d] return: (1/(ad - bc)) [ d -b -c a] @param m the 2 by 2 matrix to invert. @return the inversion of m */ const boost::numeric::ublas::matrix<double> NBMath::invert2by2(boost::numeric::...
C++
UTF-8
999
2.515625
3
[]
no_license
const uint16_t timer_start = 0; const uint16_t timer_threshold = 8000; const int LED = 4; const int ledPin = 13; ISR (PCINT0_vect) // handle pin change interrupt for D8 to D13 here { digitalWrite(LED, !digitalRead(BlueLED)); Serial.println("Pin D8-D13 Triggerd"); } void setup() { pinMode(ledPin, OUTPUT); pin...
Python
UTF-8
1,379
3.5625
4
[]
no_license
# --STAR-- --Link-- # https://evelynn.gitbooks.io/google-interview/strobogrammatic_number_iii.html class Solution: """ @param n: the length of strobogrammatic number @return: All strobogrammatic numbers """ def findStrobogrammatic(self, lo, hi): # write your code here self.nums = ['...
Markdown
UTF-8
1,032
2.828125
3
[]
no_license
# [MediaShout Script to Text](http://DouglasMeyer.github.com/MediaShoutScriptToText) This is a helper HTML page to convert a MediaShout script (.ssc) to a format that is ready to print. ## How to use it Go to [this](http://DouglasMeyer.github.com/MediaShoutScriptToText) page and drag your .scc file into the dashed ...
C++
UTF-8
439
3.171875
3
[]
no_license
#include "copy_constructor.hpp" Pencil::Pencil() : color(""), cost(0) {} Pencil::Pencil(std::string c, int initial_cost) : color(c), cost(initial_cost) {} Pencil::Pencil(const Pencil &old) : color(old.color), ...
JavaScript
UTF-8
1,526
2.59375
3
[]
no_license
import React, { Component } from "react"; import PlayListTrack from "../../components/PlayListTrack"; export default class PlayList extends Component { state = { loading: true, error: null, playList: null }; constructor() { super(); } componentDidMount() { this.loadPlayList(); } loadPl...
Markdown
UTF-8
1,933
4.03125
4
[]
no_license
Comparison and logical operators You may be familiar with comparison operators from math class. Let’s make sure there aren’t any gaps in your knowledge. Comparison Operators Less than (<) — returns true if the value on the left is less than the value on the right, otherwise it returns false. Greater than (>) — returns...
C#
UTF-8
9,147
2.875
3
[ "MIT" ]
permissive
using System.Collections.Generic; using System.Linq; using System; using System.Text.RegularExpressions; using Plivo.Exception; namespace Plivo.Utilities { public class MpcUtils { public static void ValidSubAccount(string accountId) { if (accountId.Length != 20) { ...
Shell
UTF-8
455
2.828125
3
[]
no_license
echo Site Name: read SITE_HUMAN_NAME echo "Site Macince Name (dash sepereated words):" read SITE export PANTHEON_SITE_NAME=$SITE PATH_TO_TERMINUS/terminus site:create --org ORG_ID $PANTHEON_SITE_NAME "$SITE_HUMAN_NAME" empty export PANTHEON_SITE_GIT_URL="$(PATH_TO_TERMINUS/terminus connection:info $PANTHEON_SITE_NAME.d...
Rust
UTF-8
2,739
3.40625
3
[ "MIT" ]
permissive
use Error; use Year; use CourseId; use Degree; use Studygroup; use reqwest; const BASE_URL: &'static str = "https://www2.htw-dresden.de/~app/API/GetExams.php"; /// An exam, something to study for! #[derive(Deserialize, Debug)] pub struct Exam { #[serde(rename = "Title")] pub title: String, #[serde(rename...
Go
UTF-8
703
4.34375
4
[]
no_license
package main import "fmt" //输入一个字符串,判断是否是回文 //思路:从中间截断,第一个字符和最后一个比较,依次类推。符合条件,返回true func Process(str string ) bool { //Rune 是int32 的别名。用UTF-8 进行编码.rune表示的是字符,byte表示的是字节。(中文字符就3字节) result := []rune(str) length := len(result) for i,_ := range result { if i == length/2 { break } last := length -i -1 if r...
Python
UTF-8
5,425
3.328125
3
[]
no_license
import pygame import itertools import random import tracer class Board: def __init__(self, cols, rows, size): self._cols = cols self._rows = rows self._size = size self._surface = pygame.Surface([self.get_width(), self.get_height()]) self._board = [[(0, 0, 0) for i in rang...
C++
UTF-8
844
2.78125
3
[]
no_license
#pragma once #include <string.h> #include "fooking.h" NS_BEGIN #define BUFF_SIZE 1024 class Buffer { public: Buffer(); Buffer(size_t n); Buffer(const char *buffer, size_t size); Buffer(Buffer &buf); ~Buffer(); public: size_t append(const char *buf, size_t len); size_t append(const char *buf){ return append(bu...
Python
UTF-8
1,917
3.109375
3
[ "MIT" ]
permissive
import time from threading import Timer from logzero import logger class RemainingTimer(Timer): _time_until_call = None _started_at = None def __init__(self, time_until_call, func_to_be_called): self._time_until_call = time_until_call super().__init__(time_until_call, func_to_be_called) ...
Java
UTF-8
1,753
3.359375
3
[]
no_license
import java.util.*; public class Main { public static String bfs (HashMap<String, ArrayList<String>> list, String s, String d) { Queue<String> queue = new ArrayDeque<>(); HashMap<String,String> prev = new HashMap<>(); queue.offer(s); prev.put(s, null); //for tracing back while (!queue.isEmpty()) { ...
Ruby
UTF-8
1,598
2.921875
3
[]
no_license
require 'yaml' require_relative '../classes/book.rb' module OopLibrary def self.generateBooksData books = [ Book.new("Don Quixote", "Miguel de Cervantes"), Book.new("In Search of Lost Time", "Marcel Proust"), Book.new("Ulysses", "James Joyce"), Book.new("The Odyssey", "Homer"), Book.new("War and Peac...
C#
UTF-8
1,977
3.34375
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Weboo.Prueba { public class Anagramas { public static int CantidadEnCadena (string cadena) { if (cadena.Length <= 1) return 0; i...
Rust
UTF-8
779
3.109375
3
[ "Apache-2.0" ]
permissive
use std::time::Instant; use std::net::SocketAddr; /// `Agent` objects represent registered clients connecting to this server instance. Each registered /// `Agent` must have a unique `agent_id` (generated by the server) and an `app` type associated with it. pub struct Agent { /// The unique id of this agent ...
Python
UTF-8
889
3.078125
3
[]
no_license
import sys TC = int(sys.stdin.readline()) dx = [0, 1, 0, -1] dy = [1, 0, -1, 0] for _ in range(TC): dist = list(map(str, sys.stdin.readline().rstrip())) go = 0 # 0북1동2남3서 start_x, start_y = 0, 0 trace = [(start_x, start_y)] for i in dist: if i == 'F': start_x += dx[go] ...
C
UTF-8
566
2.546875
3
[]
no_license
// The main loop #include "datastructure.h" #include <stdlib.h> #include <stdio.h> #include <string.h> #include "readinput.h" #include "writeoutput.h" #include "freeKeys.h" int main() { printf("chatbot:Hi! (type \"exit\" to exit)\n>>"); char input[100]; char output[100][20]; Key *header = malloc(sizeof(Key)); loa...
Python
UTF-8
9,016
3.03125
3
[]
no_license
import random import pytest import inspect import re import closures import os from closures import * README_CONTENT_CHECK_FOR = [ 'doc_string_validator', 'gen_next_fib_num', 'fn_run_counter', 'add', 'mul', 'div', 'fn_run_counter_1', 'fn_run_counter_2' ] def function_name_has_cap_let...
Python
UTF-8
13,084
4.03125
4
[]
no_license
from time import time from random import randint # Сортування за зростанням(яке в кожній функції є першим) та спаданням знаходяться в 1 функції з поверненням змінних до початкових значень def bubbleSort(arr): new_arr = arr[:] compare_count = 0 exchange_сount = 0 n = len(arr) for i in range(n): ...
Python
UTF-8
2,976
3.71875
4
[]
no_license
''' --- Day 5: Hydrothermal Venture --- You come across a field of hydrothermal vents on the ocean floor! These vents constantly produce large, opaque clouds, so it would be best to avoid them if possible. They tend to form in lines; the submarine helpfully produces a list of nearby lines of vents (your puzzle input)...
Python
UTF-8
1,572
3.0625
3
[]
no_license
import unittest from fibservice import fibs import test_const class FibTestCase(unittest.TestCase): """ Unit test cases for fibs function """ def setUp(self): """ Pass """ pass def tearDown(self): """ Pass """ pass def test_norm...
Java
UTF-8
457
2.296875
2
[]
no_license
package arc.ecs.injection; import arc.ecs.*; import java.lang.reflect.*; /** * API used by {@link FieldHandler} to resolve field values in classes eligible for injection. * @author Snorre E. Brekke */ public interface FieldResolver{ /** * Called after Wo */ void initialize(Base base); /** ...
Markdown
UTF-8
2,779
2.53125
3
[]
no_license
--- title: "Tipps und Tricks" --- # Das kreative schwarze Loch Kennst du das, wenn du einfach gar keine Ahnung hast was du machen sollst, aber irgendwie Lust hast etwas zu tun? Im kreativen schwarzen Loch verschwinden alle Ideen und nichts hat so wirklich die Möglichkeit dich zu begeistern um es auch in die Tat umzus...