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
C#
UTF-8
1,991
2.625
3
[]
no_license
using GigHub.Core.Models; using GigHub.Core.Repositories; using GigHub.Persistence; using System; using System.Collections.Generic; using System.Data.Entity; using System.Linq; using System.Web; namespace GigHub.Persistence.Repositories { public class GigRepository : IGigRepository { private readonly ...
Java
UTF-8
900
3.453125
3
[]
no_license
package com.htc.ioss; // how to create directories import java.io.IOException; import java.io.File; public class CreateDirFiles { public static void main(String[] args) throws IOException { char fChar = File.separatorChar; System.out.println("Windows separator "+fChar); File f1 = n...
Java
UTF-8
866
2.109375
2
[]
no_license
package com.clean_architecture.tronnv.presentationlayer.presenter; import com.clean_architecture.tronnv.presentationlayer.presenters.impl.MainPresenterImpl; import org.junit.After; import org.junit.Before; import org.junit.Test; import static org.mockito.Mockito.doNothing; import static org.mockito.Mockito.mock; pu...
Java
UTF-8
2,818
2.328125
2
[]
no_license
package br.edu.ftlf.ads.revenda.model; import java.util.List; import org.hibernate.validator.constraints.NotEmpty; public class Veiculo extends Model { private static final long serialVersionUID = 1L; public static final String PROPERTY_MARCA = "marca"; public static final String PROPERTY_MODELO = "modelo"; pub...
C++
UTF-8
3,004
2.765625
3
[ "MIT" ]
permissive
/*=========================================================================================================== * * HUC - Hurna Core * * Copyright (c) Michael Jeulin-Lagarrigue * * Licensed under the MIT License, you may not use this file except in compliance with the License. * You may obtain a copy of the Lice...
Java
UTF-8
899
2.34375
2
[]
no_license
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package game.Fishes; import city.cs.engine.BodyImage; import city.cs.engine.PolygonShape; import city.cs.engine.SolidFixture; import c...
Markdown
UTF-8
843
2.640625
3
[]
no_license
# Race report: Peterson Ridge Rumble 40 Mile Date: April 12, 2015 Website: [petersonridgerumble.com](http://www.petersonridgerumble.com/) Official time: 7:39:38 Strava link: [strava.com](https://www.strava.com/activities/284443137) Rumble #8 in the books. Returned to the 40 after a couple years doing the 20. Go...
Swift
UTF-8
2,326
2.828125
3
[]
no_license
// // SecondViewController.swift // Appecules // // Created by admin on 27/08/19. // Copyright © 2019 admin. All rights reserved. // import UIKit class UserDataVC: UIViewController { @IBOutlet weak var dataTableView: UITableView! var names: [String] = [] //names is a mutable array holding string val...
JavaScript
UTF-8
850
2.53125
3
[]
no_license
import * as types from '../constants/types'; import update from 'immutability-helper'; export const initialState = { events : [] } export const reducer = (state = initialState, action) => { switch(action.type) { case types.ACTION_ADD_AVENT:{ return ({...state, events : [...state....
TypeScript
UTF-8
5,472
2.515625
3
[]
no_license
import { Request, Response } from 'express' import Image from '../models/image' import { APP_URL } from "../config/config" import path from 'path' import fs from 'fs' const getAllImage = (req: Request, res: Response) => { const perPage = 12 let page = parseInt(req.query.page as string) || 0 as any Ima...
Java
UTF-8
3,819
3.65625
4
[]
no_license
package leetcode; import java.util.Arrays; /** * @author: nj * @date: 2020-04-18 10:51 * @version: 0.0.1 */ public class Code_628 { /** * *Given an integer array, find three numbers whose product is maximum and output the maximum product. * * Example 1: * * Input: [1,2,3] ...
Python
UTF-8
3,952
2.703125
3
[]
no_license
from __future__ import print_function from inputs import get_gamepad import time keys_dict = {} def main(): cnt = 0 prev_x = None prev_y = None prev_z = None while cnt < 10000: #print("Hi") events = get_gamepad() for event in events: #if (event.ev_type == 'Key')...
C#
UTF-8
3,867
2.734375
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using StatusUpdatesModel; namespace Data { public static class PhaseKeywords { public static Dictionary<Phases, List<string>> ExactKeywords { get { ...
JavaScript
UTF-8
651
3.4375
3
[]
no_license
/* 2845 */ const getClearData = data => { return data.map(ele => ele.split(' ').map(item => parseInt(item))); } const solution = (data) => { const [[people, square], newsCount] = getClearData(data) const answer = newsCount.map((ele) => { return ele - (people * square) }) console.log(answer...
PHP
UTF-8
7,114
2.609375
3
[]
no_license
<?php /** * BP_Groups_Hierarchy_Activity_Aggregation * * @package CC Group Activity Aggregation * @author David Cavins * @license GPL-2.0+ * @copyright 2014 Community Commons */ /* -------------------------------------------------------------------------------- BP_Groups_Hierarchy_Activity_Aggregation Class...
Java
UTF-8
1,070
2.59375
3
[]
no_license
package cms.sre.httpclient_connection_helper.embedded; import fi.iki.elonen.NanoHTTPD; public class InsecureServer extends NanoHTTPD implements EmbeddedServer{ private String response; public InsecureServer(String response){ super(EmbeddedServer.randomPort()); this.response = response; } ...
C++
UTF-8
9,704
3.359375
3
[]
no_license
// insert delete // Avl Tree.h // AVL Tree // // Created by dali on 2/25/18. // Copyright © 2018 dali. All rights reserved. #include <iostream> #include <algorithm> #include <cassert> #include <fstream> #ifndef Avl_Tree_h #define Avl_Tree_h template <class T> class AVLTree{ public: //-----------------------------...
Java
UTF-8
1,096
3
3
[]
no_license
package externalworld; import network.Brain; import neuron.Neuron; public class AllNeuronsFireRandomlyExternalWorld extends ExternalWorld { private double chanceToFirePerNeuronPerTimestep; private double firingAmplitude; public AllNeuronsFireRandomlyExternalWorld(Brain brain, double chanceToFirePerNeuro...
Swift
UTF-8
1,615
3.25
3
[]
no_license
// // DogApi.swift // dog Api udacity task // // Created by Mostafa Diaa on 1/28/19. // Copyright © 2019 Mostafa Diaa. All rights reserved. // import Foundation import UIKit class dogApi { enum Endpoint: String { case random = "https://dog.ceo/api/breeds/image/random" var url: URL { ...
Java
UTF-8
1,938
2.984375
3
[]
no_license
package training.supportbank; //everything we need to import// import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.xml.sax.SAXException; import javax.xml.parsers.ParserConfigurationException; import java.io.IOException; import java.nio.file.Files; import java.nio.fil...
C
UTF-8
179
2.703125
3
[]
no_license
#include<stdio.h> int main(){ int j=0; int k=0; for(j=0;j<=5;j=j+1){ for(k=0;k<=4;k=k+1){ printf("+"); } printf("+\n"); } printf("Fin del programa"); }
C++
UTF-8
570
2.8125
3
[]
no_license
#pragma once #include<SFML/Graphics.hpp> #include<iostream> class Obstacle { private: sf::RenderWindow& m_window; float carposx = 450, carposy=0, truckposx=750, truckposy=0; int speed = 1; int score =0; sf::Texture carTexture,truckTexture; float xpos[4] = { 475,725,1025,1325 }; sf::Sprite car; sf::Sprite truc...
Java
UTF-8
2,353
3.859375
4
[]
no_license
package euler12_highlydivisibletriangularnumber; /** * * @author Ben Walker */ public class Euler12_highlyDivisibleTriangularNumber { public static void main(String[] args) { int numberOfFactors = 0; long currentNumber = 1L; long triangularNumber = 0L; while (numberOfFa...
Markdown
UTF-8
1,145
3.3125
3
[ "Apache-2.0" ]
permissive
## Dungeon Game [ [sourcecode](../src/dungeon-game.cpp) | [problem](https://leetcode.com/problems/dungeon-game/) ] ##解法分析 knight从左上角开始,每次向左或者向下走一次,走到右下角需要多少生命力。生命力为0时死亡。 解法1:假设knignt以0生命力一直走,health[i][j]表示knight走到map[i][j]之后可能保留的生命值的最大值,如果是负数-a就表示kngiht至少要a+1的生命值才能活着走到map[i][j]。 health[i][j]=max(health[i-1][j], hea...
Python
UTF-8
432
3.15625
3
[]
no_license
import sys from io import StringIO import contextlib @contextlib.contextmanager def stdoutIO(stdout=None): old = sys.stdout if stdout is None: stdout = StringIO() sys.stdout = stdout yield stdout sys.stdout = old code = """ i = [0,1,2] for j in i : print(j) """ with stdoutIO() as s: ...
Java
UTF-8
5,766
1.984375
2
[]
no_license
package activity.buy; import java.util.ArrayList; import java.util.HashMap; import util.BuyUtil; import util.PicUtil; import android.annotation.SuppressLint; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.os.Handler; import android....
PHP
UTF-8
1,556
2.53125
3
[]
no_license
<?php /* Plugin Name: Include Me Plugin URI: http://www.satollo.net/plugins/include-me Description: Include external HTML or PHP in any post or page. Version: 1.1.1 Author: Stefano Lissa Author URI: http://www.satollo.net */ if (is_admin()) { include dirname(__FILE__) . '/admin.php'; } e...
Java
UTF-8
1,401
2.90625
3
[]
no_license
package edu.mum.cs.projects.attendance.service; import java.util.List; import edu.mum.cs.projects.attendance.domain.entity.CourseOffering; public class AttendanceServiceImpl implements AttendanceService { CourseService courseService = ServiceFactory.getCourseService(); @Override public void createStud...
PHP
UTF-8
1,502
2.796875
3
[]
no_license
<?php namespace App\Models; use Illuminate\Database\Eloquent\Model; use Carbon\Carbon; class TempUser extends Model { public $timestamps = false; protected $table = 'temp_users'; protected $fillable = [ 'name','email','password','lang','referral','code','try','time' ]; public function __...
C++
UTF-8
1,289
2.8125
3
[ "MIT" ]
permissive
#ifndef __TARGET_FIELD_CPP__ #define __TARGET_FIELD_CPP__ 1 #include "target_field.hpp" #include <list> #include <exception> #include <Eigen/Dense> TargetField::TargetField( const double p_x_size, const double p_y_size, const int p_num_cells ) : x_size_(p_x_size), y_size_(p_y_size), num_cells_(p_num_cells) {...
Markdown
UTF-8
867
2.609375
3
[ "MIT" ]
permissive
--- title: Brady Moon subtitle: Ph.D. Student job_title: Ph.D. Student category: phd_student layout: team_member_personal_page image: /img/team/brady.jpg hide_footer: true --- Brady Moon is a PhD student in the [Robotics Institute](https://www.ri.cmu.edu "Robotics Institute Homepage") at Carnegie Mellon University. He...
Java
UTF-8
1,465
2.625
3
[]
no_license
package sg.edu.np.twq2.e53listview; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.ListView; import java.util.ArrayList; import ...
Java
UTF-8
4,439
2.546875
3
[ "MIT" ]
permissive
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package render; import jinngine.math.*; import javax.media.opengl.GL2; import javax.media.opengl.GL; import javax.media.opengl.glu.GL...
Java
UTF-8
3,345
1.953125
2
[]
no_license
package com.jule.robot.config; import com.jule.core.configuration.ConfigurableProcessor; import com.jule.core.configuration.Property; import com.jule.core.database.DatabaseConfig; import com.jule.core.jedis.JedisConfig; import com.jule.core.utils.PropertiesUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory...
Python
UTF-8
660
3.234375
3
[]
no_license
from typing import List class Solution: def trap(self, height: List[int]) -> int: stack = [] ans = 0 for i in range(len(height)): while stack and height[stack[-1]] <= height[i]: last = stack.pop() # 取出当前栈顶高度 if not stack: bre...
PHP
UTF-8
617
2.90625
3
[ "MIT" ]
permissive
<?php namespace Ionut\Sylar\Receivers; use Ionut\Sylar\Alert; use Ionut\Sylar\Guardian; abstract class Receiver { /** * @var Guardian */ public $listener; abstract public function __construct(Guardian $listener); abstract public function call(Alert $alert); public function allowed() { return (bool)$th...
JavaScript
UTF-8
2,552
2.625
3
[]
no_license
const jwt = require('jsonwebtoken'); const crypto = require('crypto'); const User = require('../models/user'); const config = require('../config/main'); const generateToken = user => { return jwt.sign(user, config.secret, { expiresIn: 10080 // in seconds }); }; const setUserInfo = request => { return { ...
JavaScript
UTF-8
691
2.90625
3
[]
no_license
window.onload = function () { // var active = $('li.active'); // var activePill = active.find('a').attr('id'); // var content = $('.details .' + activePill); // console.log(content); // //content.css('display', 'block'); $('li').on("click", function(){ // remove all active classes $('.about-list li').remov...
Python
UTF-8
545
3.875
4
[]
no_license
# -*- coding: utf-8 -*- """ Created on Thu Mar 2 14:33:48 2017 @author: Nick Lai """ ''' for the_char in 'hi mom': print(the_char) print() s = 'chapman' print( for x in s: print(x) for letter in s: print(letter) for watermelon in s: print(watermelon) ) ''' s...
Java
UTF-8
1,203
2.4375
2
[]
no_license
package com.example.administrator.text1.ui.testCanvas.testChart; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.DashPathEffect; import android.graphics.Paint; import android.graphics.Path; import android.graphics.PathEffect; import android.util.At...
Markdown
UTF-8
1,979
3.1875
3
[ "MIT" ]
permissive
# vue-doctitle > Simple plugin for switching document title on transitions between routes (for VueRouter) ## Installation You can install this plugin globally or included in `dependencies` (in package.json) ```bash $ npm install vue-doctitle ``` ## Functionality and features - Switching page(document) title on tra...
Go
UTF-8
2,354
4.34375
4
[]
no_license
package main import ( "fmt" "math" ) /* * Let us assume the following formula for displacement s as a function of * time t, acceleration a, initial velocity vo, and initial displacement so. * * s = 1/2 * a * t^2 + v_0 * t + s_0 * * Write a program which first prompts the user to enter values for * accelerat...
Python
UTF-8
733
2.84375
3
[]
no_license
# TIME - O(e + q * |V|!) v is number of variables # SPACE - O(e) def evaluateDivision(equations, values, queries): def dfs(n,d,visited): if n in lookup and d in lookup[n]: return (True, lookup[n][d]) for i,v in lookup[n].iteritems(): if i not in visited: visited.add(i) tmp...
C#
WINDOWS-1250
6,246
2.890625
3
[]
no_license
using System; using System.Collections.Generic; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using Miner.Enums; using Miner.GameInterface.MenuEntries; namespace Miner.GameInterface.GameScreens { /// <summary> /// Klasa bazowa dla wszystkich ekranw w menu...
Java
UTF-8
301
2.734375
3
[]
no_license
/** * Created by abran on 17.11.2016. */ public class IdGenerator { private static long id = 111111111; public static long getId() { id++; if (id==999999999) { System.out.println("WARNING: ID LIMIT REACHED!!!!"); } return id; } }
Markdown
UTF-8
1,547
3.65625
4
[ "MIT" ]
permissive
# Insertion Sort This project contains a skeleton for you to implement Insertion Sort. In the file **lib/insertion_sort.js**, you should implement the Insertion Sort. The algorithm can be summarized as the following: 1. If it is the first element, it is already sorted. return 1; 2. Pick next element 3. Compare with ...
C#
UTF-8
4,934
2.5625
3
[ "Apache-2.0" ]
permissive
using System; using System.Collections.Generic; using System.Text; using System.Linq; using System.Runtime.Serialization; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using HuaweiCloud.SDK.Core; namespace HuaweiCloud.SDK.GaussDB.V3.Model { /// <summary> /// /// </summary> public class Res...
Rust
UTF-8
1,883
2.84375
3
[]
no_license
use uuid::Uuid; use comm::mpmc::bounded::Channel; use queue::{Queue, Queues}; use std::sync::{Arc, RwLock}; use std::collections::HashMap; #[derive(Clone)] pub struct ConcurrentQueues(usize, Arc<RwLock<HashMap<String, ConcurrentQueue>>>); impl ConcurrentQueues { /// Create a new collection of queueus. /// ...
JavaScript
UTF-8
1,451
2.890625
3
[]
no_license
var Post = require('../models/post.js') // Displays all posts in the api function index (req, res) { Post.find({}, function (err, posts) { if (err) console.log(err); res.json(posts); }); } // Adds a new post to the api function newPost (req, res) { var post = new Post(); post.title = req.body.title; po...
Java
UTF-8
5,101
3.09375
3
[]
no_license
import java.util.ArrayList; import java.util.HashMap; import java.util.Scanner; import java.io.File; import java.io.BufferedReader;; // Class that reads & populates two different Collections. // ArrayList<Product> is populated by Stock.txt // HashMap<String,User> is populated by UserAccounts.txt public class Reader...
Ruby
UTF-8
793
2.5625
3
[ "MIT" ]
permissive
require "mongoid/spec_helper" describe Mongoid::Fields do let(:address) do Address.new end describe "Special geo Array setter" do it "should split a String into parts and convert to floats" do address.locations = "23.5, -47" address.locations.should == [23.5, -47] end it "should co...
Java
UTF-8
2,581
3.359375
3
[]
no_license
package com.john.funix.utils; import com.sun.istack.internal.NotNull; import java.util.Scanner; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * @author Trung Nguyen * This class helps validate inputs from console */ public class InputHelper { public static String inputForName(String mes...
JavaScript
UTF-8
5,993
2.703125
3
[]
no_license
/** * Created by akucherenko on 22.10.13. */ define([ 'lib/BaseScript', 'three', 'underscore', 'keyboard' ], function (BaseScript, THREE, _, Keyboard) { /** * Helpers class * * @class WireHelpers */ return BaseScript.extend({ /** * Here we save current d...
Python
UTF-8
218
3.8125
4
[]
no_license
#### LECTURE 2 PROBLEM 11 if type(varA)==type('str') or type(varB)==type('str'): print 'string involved' elif varA > varB: print 'bigger' elif varA == varB: print 'equal' else: print 'smaller'
Java
UTF-8
1,143
2.3125
2
[]
no_license
package cn.edu.ujn.EqnoSms; import android.content.Intent; import android.os.Bundle; import android.os.CountDownTimer; import android.view.View; import android.widget.Button; import androidx.appcompat.app.AppCompatActivity; public class MainActivity extends AppCompatActivity { void switchActivity() { st...
Markdown
UTF-8
1,504
2.78125
3
[]
no_license
<h1 align="center">Hi 👋, I'm Kevin Alejandro Mera Castillo</h1> <h3 align="center">A passionate frontend developer and student from Colombia</h3> - 🔭 I’m currently working on a laser game, consists on a matrix generated by the user (size) with hidden mirrors (/ or \) You can fire the laser by sides of matrix and try...
Markdown
UTF-8
4,458
2.671875
3
[ "LicenseRef-scancode-other-permissive" ]
permissive
<div align="center"> <!-- <img src="Resources/Logo.png atl="SeasonShift" height=75 align="bottom> --> <font size="15">Season Shift</font> <br> <font size="5">A japanese bullethell game made by a bunch of students</font> <hr /> </div> [![Travis (.com) branch](https://img.shields.io/travis/com/barrag...
Python
UTF-8
1,163
2.609375
3
[]
no_license
from __future__ import print_function import argparse, json, sys from os.path import realpath, join from util import printplus def printLayer(l): print("layer - ",l['type']) print(" param: ") printplus(l['param'], " ") print(" config: ") printplus(l['config']," ") print(" ...
TypeScript
UTF-8
1,233
2.640625
3
[ "Unlicense" ]
permissive
// This is bascially https://github.com/helmetjs/helmet // for `web`. import { compose, Middleware } from "../mod.ts"; import { frameguard, FrameguardOptions } from "./frameguard.ts"; import { DnsPrefetchControlOptions, dnsPreftechControl, } from "./dns_prefetch_control.ts"; import { noSniff } from "./no_sniff.ts"...
JavaScript
UTF-8
652
2.625
3
[]
no_license
/** * Created by tujiaw on 2017/1/15. */ function hasParameter(name){ var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); if (r != null) return decodeURI(r[2]); return null; } $('.pagination.menu a').click(function() { var newPage = parseInt($(this)...
Ruby
UTF-8
375
2.609375
3
[]
no_license
require 'query/grammar' module Query class CompactParens def self.apply(args) open = Regexp.quote(Query::Grammar::OPEN_PAREN) close = Regexp.quote(Query::Grammar::CLOSE_PAREN) argstr = args.join(' ') while argstr =~ /#{open}\s*#{close}/ argstr = argstr.gsub(/#{open}\s*#{close}/, '...
Python
UTF-8
1,334
2.8125
3
[]
no_license
#!/usr/bin/python3 ################################################ # Can be used to create a HTML5 galery of photos # Step 1 : # ./hovercraft_gallery.py > gallery.rst # Step 2 : # hovercraft gallery.rst gallery ################################################ import jinja2 import os import glob def get_list_o...
PHP
UTF-8
712
3.859375
4
[]
no_license
<?php class Endereco { private $Logradouro; private $Numero; private $Cidade; public function __construct($Logradouro, $Numero, $Cidade) { $this -> Logradouro = $Logradouro; $this -> Numero = $Numero; $this -> Cidade = $Cidade; } ...
Java
UTF-8
3,008
2.203125
2
[]
no_license
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.migration; /** * * @author Bolaji */ /* * To change this license header, choose License Headers in Project Properties....
Python
UTF-8
3,672
2.546875
3
[ "BSD-3-Clause" ]
permissive
# -*- coding: utf-8 -*- # Author: yongyuan.name from vgg16_1 import VGGNet from vgg16_2 import VGGNet2 import numpy as np import h5py import matplotlib.pyplot as plt import matplotlib.image as mpimg import argparse import os import glob os.environ["CUDA_VISIBLE_DEVICES"] = "0" class Query: def __init__(self): ...
Java
UTF-8
1,786
2.265625
2
[]
no_license
package services; import exceptions.UsernameTakenException; import models.User; import play.libs.concurrent.HttpExecutionContext; import repository.IUserRepository; import repository.UserRepository; import javax.inject.Inject; import java.util.Optional; import java.util.concurrent.CompletionException; import java.uti...
Python
UTF-8
2,789
3.0625
3
[]
no_license
from configparser import ConfigParser from wrapt import ObjectProxy import re def nested_set(dic, keys, value): for key in keys[:-1]: dic = dic.setdefault(key, {}) dic[keys[-1]] = value class CustomParser(ConfigParser): """Custom ConfigParser to hold our own rules Extends: ConfigParse...
TypeScript
UTF-8
573
2.53125
3
[ "MIT" ]
permissive
import { Facilities } from './facilities.entity'; import { OneToOne, CreateDateColumn, UpdateDateColumn, PrimaryGeneratedColumn, Column, Entity, JoinColumn } from 'typeorm'; @Entity() export class Addresses { @PrimaryGeneratedColumn() id: number; @Column() physical_address: string; @Column() ...
Python
UTF-8
2,719
2.5625
3
[]
no_license
import PyClient import Agent class Env: map_name = '' __map_width = 11 __map_height = 8 __map = ['TTWWWTTPDDT', '00000000000', '00000000000', '00001230000', '00000000000', '00000000000', '00000000000', 'TTTTBTC...
JavaScript
UTF-8
135
2.703125
3
[]
no_license
const flatten = a => a.reduce((r, e) => r.concat(Array.isArray(e) ? flatten(e) : e), []); console.log(flatten([1, [[2], 3, 4], 5]));
C#
UTF-8
3,381
3.015625
3
[]
no_license
using System; using System.Text; using System.Collections.Concurrent; using System.Net; using System.Net.Sockets; using System.IO; using System.Threading.Tasks; using System.Runtime.Serialization.Json; namespace AnyLogicDataServerLib { public class Server { ConcurrentQueue<String> persons; ...
Java
UTF-8
427
1.78125
2
[]
no_license
package com.travel.repositories; import java.util.List; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; import com.travel.model.PricePlan; @Repository public interface PricePlanRepository extends JpaRepository<PricePlan, Long> { PricePlan findB...
Markdown
UTF-8
9,651
2.96875
3
[]
no_license
# squeal ![squeal-icon](http://www.emoticonswallpapers.com/emotion/cute-big-pig/cute-pig-smiley-046.gif) [![CircleCI](https://circleci.com/gh/echatav/squeal.svg?style=svg&circle-token=a699a654ef50db2c3744fb039cf2087c484d1226)](https://circleci.com/gh/morphismtech/squeal) [Github](https://github.com/morphismtech/sque...
JavaScript
UTF-8
2,818
2.515625
3
[]
no_license
var React = require("react"); var PropTypes = require("prop-types"); import ClueButton from "./clue-button"; import {Group, Rect, Text} from "react-konva"; import gf from "./general_functions"; export default class CategoryGroup extends React.Component { render = () => { const fontFamily = "Oswald Bold"; const fo...
Markdown
UTF-8
1,591
2.796875
3
[ "CC-BY-4.0", "MIT" ]
permissive
--- description: Why use People Near Me? ms.assetid: 94e37cb0-1832-46ae-81ec-b92a5b4dcd51 title: Why use People Near Me? ms.topic: article ms.date: 05/31/2018 --- # Why use People Near Me? Some examples of scenarios that [People Near Me](about-people-near-me.md) (PNM) enables are the following: - Initiate chat wit...
C++
UTF-8
816
2.578125
3
[]
no_license
//incorrect solution... #include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> #include <bits/stdc++.h> using namespace std; long long int arr[100005]; long long int dp[100005]; long long int foo(long long int n){ if(dp[n] != 0) return dp[n]; if(...
Java
UTF-8
1,544
3.15625
3
[]
no_license
package GameObject; import com.googlecode.lanterna.terminal.Terminal; public class GameObject { private int x; private int y; private int xOld; private int yOld; private Graphic graphic; private boolean needsDraw = true; private boolean traversable; public GameObject(int x, int y, cha...
Java
UTF-8
5,436
2.40625
2
[ "Apache-2.0" ]
permissive
/* Copyright 2019 https://github.com/OughtToPrevail Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in...
Go
UTF-8
826
2.84375
3
[]
no_license
package notify import ( "log" "net/http" "net/url" "os" "strings" ) type Notify struct { accessToken string notifyApi string } // Initialize notify func NewNotify() *Notify { n := new(Notify) n.accessToken = os.Getenv("TOKEN") n.notifyApi = "https://notify-api.line.me/api/notify" return n } func (n *N...
JavaScript
UTF-8
654
3.03125
3
[]
no_license
function prueba(){ let info = document.getElementById('art').value; let li = document.createElement("li"); let contenido = document.createTextNode(info); let ordenada = document.getElementById('order'); li.appendChild(contenido); document.body.appendChild(li); ordenada.appendChild(li); ...
C++
UTF-8
781
2.78125
3
[]
no_license
// -*- mode: c++; flycheck-clang-language-standard: "c++11"; -*- #include <cmath> #include <iostream> #include "approx_sum.h" int main() { size_t n = 1000; double delta = 0.001; std::cout << "epsilon = %" << 100*delta << std::endl; approx_sum_t p(delta); long double sum = 0; for (exponent_t i = 0; ...
Python
UTF-8
1,533
2.65625
3
[]
no_license
# coding:utf-8 import cv2 # Sobel边缘检测算子 # img = cv2.imread('/home/z840/dataset/UCF_Crimes/crop_out_30/residuals/Arson016_x264/1069.jpg', 0) # x = cv2.Sobel(img, cv2.CV_16S, 1, 0) # y = cv2.Sobel(img, cv2.CV_16S, 0, 1) # # cv2.convertScaleAbs(src[, dst[, alpha[, beta]]]) # # 可选参数alpha是伸缩系数,beta是加到结果上的一个值,结果返回uint类型的图像 #...
Java
UTF-8
5,280
3.796875
4
[]
no_license
/* Platinum 5 백준 6549 : 히스토그램에서 가장 큰 직사각형 기준 : 1s, 256MB Time : 648ms - 스택 문제 - 입력 순서대로 연산 후 스택에 넣으면서 최대 높이를 계산한다 - 스택에 존재하는 값보다 큰 값이 들어온 경우 : top에 새로 추가하며 count를 1로 초기화한다. - 작은 값이 들어오는 경우 : 스택의 값이 작거나 같은 수가 나올때 까지 pop한다 --> 이 때 스택에는 무조건 오름차순으로 저장되기 때문에 역순으로 count를 세고 현재 위치한 높이에서 (count + 그 위치에서의 count) 를 곱하여 넓이를 계산한다...
Java
ISO-8859-1
1,058
2.90625
3
[]
no_license
package heranca_classes_abstratas; public class Teste { public static void main(String[] args) { // TODO Auto-generated method stub Papagaio papagaio = new Papagaio(); papagaio.alimentar(); papagaio.andar(); papagaio.emitirSom(); papagaio.voar(); papagaio.setNome("Veludo"); System.out.pri...
Java
UTF-8
7,231
2.546875
3
[]
no_license
package com.androidso.app.utils; import android.content.Context; import android.media.MediaPlayer; import android.os.Handler; import android.os.Message; import android.util.Log; import java.io.IOException; public class MediaPlayers extends MediaPlayer implements MediaPlayer.OnCompletionListener { private static...
Shell
UTF-8
670
3.71875
4
[]
no_license
#!/bin/bash ############################################################## ## This script lets you copy/paste things on multiple OSes. ## ############################################################## OS=$(uname) if [ "$1" = "paste" ]; then if [ "$OS" = "Darwin" ]; then pbpaste else xsel -ob fi elif [ "$1" =...
Shell
UTF-8
149
2.859375
3
[]
no_license
# menambahkan angka ((sum=25+35)) # print echo $sum :'The following script calculates the square value of the number, 5. ' ((area=5*5)) echo $area
JavaScript
UTF-8
5,554
2.6875
3
[ "MIT" ]
permissive
/* eslint-disable */ import React, { Component } from 'react'; import ReactDOM from 'react-dom'; import Barcode from 'react-barcode'; class App extends Component { constructor(props) { super(props); this.state = { payDate: '', payType: '', bizUnitCode: '', phoneNumber: '', bill...
PHP
UTF-8
2,443
2.625
3
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
<?php final class PhabricatorAuthFactorProviderStatus extends Phobject { private $key; private $spec = array(); const STATUS_ACTIVE = 'active'; const STATUS_DEPRECATED = 'deprecated'; const STATUS_DISABLED = 'disabled'; public static function newForStatus($status) { $result = new self(); $res...
PHP
UTF-8
2,978
2.921875
3
[ "MIT" ]
permissive
<?php /* * This file is part of php-object-mapper. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace KrzysztofMazur\ObjectMapper\Mapping\Field; use KrzysztofMazur\ObjectMapper\Util\PropertyNameConverterInterface; use Krzysz...
Python
UTF-8
208
2.921875
3
[]
no_license
#!/usr/bin/python3 """ Module doc """ class Square: """ Class square defines a square """ def __init__(self, size=0): """ initialization of an instance Square """ self.__size = size
C++
UTF-8
967
3.578125
4
[]
no_license
#include <iostream> #include <vector> class A { public: A() { std::cout << "A constructor" << std::endl; } A(const A &a) { std::cout << "A copy constructor" << std::endl; } }; int main(void) { std::vector<A> va; A a; for (int i = 0; i < 8; i++) { std::cout << i << " : "; std::...
Java
UTF-8
3,693
2.1875
2
[]
no_license
package com.luckyhua.springboot.global.config; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.stereotype.Component; import org.springframework.web.cors.CorsConfiguration; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; /** * Prope...
TypeScript
UTF-8
583
2.59375
3
[]
no_license
import mongoose from 'mongoose'; const logger = require('./logger'); export interface TInput { db: string; } export default ({db}: TInput) => { const connectDb = () => { mongoose .connect( db, { useNewUrlParser: true } ) .then(() => { return logger.info...
TypeScript
UTF-8
12,915
2.515625
3
[ "MIT" ]
permissive
import * as path from "path"; import { SinonStub } from "sinon"; import { MaquetteComponent, Projector, createProjector, h } from "../src/index"; import { expect, sinon } from "./test-utilities"; describe("Projector", () => { let requestAnimationFrame: SinonStub; let cancelAnimationFrame: SinonStub; beforeEac...
Python
UTF-8
944
2.6875
3
[ "Unlicense" ]
permissive
import os import string import shutil def exRoot(root): names = os.listdir(root) for name in names: process(root, name) def process(root, name): path = os.path.join(root, name) if(not os.path.isdir(path)): return singers = string.split(name, ',', 1) if(len(singers)<=1): ...
Markdown
UTF-8
613
2.6875
3
[]
no_license
# First Chapter GitBook allows you to organize your book into chapters, each chapter is stored in a separate file like this one.![](/assets/KOC_scree_plot %282%29.png) {% youtube %} src="https://www.youtube.com/watch?v=9bZkp7q19f0" {% endyoutube %} ok how about it? {% youtube %} src="https://www.youtube.com/watch...
Java
UTF-8
931
2.4375
2
[]
no_license
package com.example.telemedical.tabs; import androidx.annotation.NonNull; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentStatePagerAdapter; public class WelcomePagerAdapter extends FragmentStatePagerAdapter { int noOfTabs; public Welc...
Markdown
UTF-8
1,182
3.625
4
[]
no_license
# 349. Intersection of Two Arrays Given two arrays, write a function to compute their intersection. **Example:** Given nums1 = `[1, 2, 2, 1]`, nums2 = `[2, 2]`, return `[2]`. **Note:** - Each element in the result must be unique. - The result can be in any order. # Solution ## 我的思路: 双层循环,时间复杂度O(m*n)。(5%) ##优化方法...
C++
UTF-8
892
3.40625
3
[]
no_license
#include <iostream> #include <iomanip> #include <string> #include <vector> #include <fstream> #include "RetailItem.h" using namespace std; void loadItems(vector<RetailItem> &); int main() { vector<RetailItem> item(20); loadItems(item); cout << "description" << setw(10) << "price" << setw(10) << "available" << set...