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
UHC
857
3.375
3
[]
no_license
import java.util.Scanner; public class BJ1316 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); sc.nextLine(); int cnt = 0; for(int i=0; i<n; i++){ boolean arr[] = new boolean[26]; String str = sc.nextLine(); StringBuilder newStr = new StringBu...
C++
UTF-8
1,027
3.1875
3
[ "MIT" ]
permissive
#include "time_conversion.h" #include <iostream> #include <iomanip> #include <string> #include <regex> using namespace hackerrank::bmgandre::algorithms::warmup; /// Practice>Algorithms>Warmup>Time Conversion /// /// https://www.hackerrank.com/challenges/time-conversion void time_conversion::solve() { std::string pat...
Markdown
UTF-8
6,330
3.1875
3
[]
no_license
## Roadmapping #### In a nutshell Roadmapping is the process of establishing one or more concrete, achievable goals and laying out each of the tasks which must be completed in order to accomplish each goal. To have a useful roadmap, it is important that these goals and the tasks which need to be done to accomplish t...
Go
UTF-8
277
3.046875
3
[ "MIT" ]
permissive
package main // https://space.bilibili.com/206214 func minImpossibleOR(nums []int) int { mask := 0 for _, x := range nums { if x&(x-1) == 0 { // x 是 2 的幂次 mask |= x } } // 取反后,用 lowbit 找第一个 0 比特位 mask = ^mask return mask & -mask }
Python
UTF-8
1,970
3.5
4
[]
no_license
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2017/7/20 10:48 # @Author : Lyrichu # @Email : 919987476@qq.com # @File : improve_random_walk.py ''' @Description:改进的随机游走算法 这里求解:f = sin(r)/r + 1,r = sqrt((x-50)^2+(y-50)^2)+e,0<=x,y<=100 的最大值 求解f的最大值,可以转化为求-f的最小值问题 ''' from __future__ import print_function ...
Python
UTF-8
58,406
3.171875
3
[]
no_license
""" GSU main functions. """ import random import math import utils # ================================================================================================== def rounded_point(p, digits=10): """ Get rounded point for constructing bags of points. :param p: point :param digits: accuracy ...
Java
UTF-8
1,396
1.78125
2
[ "Apache-2.0" ]
permissive
// Copyright (C) 2015 The Android Open Source Project // // 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 ...
Java
UTF-8
3,024
2.203125
2
[]
no_license
/* SpagoBI, the Open Source Business Intelligence suite * Copyright (C) 2012 Engineering Ingegneria Informatica S.p.A. - SpagoBI Competency Center * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0, without the "Incompatible With Secondary Licenses" notice. * If a copy of the MPL...
Python
UTF-8
529
4.4375
4
[]
no_license
#Additional Program #Aug. 30, 2020 #Create a variable and assign a number to it in a range from 80 to 100 #For the given number, calculate the letter grade #-------------------------------------------------------------------------- import random x = random.randint(80, 100) print("Numerical Grade:\t\t", x) if (x >= ...
Java
UTF-8
4,410
2.46875
2
[]
no_license
package com.testmanage.oldtest.view; import android.content.Context; import android.content.res.TypedArray; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.RectF; import android.util.AttributeSet; import android.util.TypedValue; import android.view....
Python
UTF-8
1,268
2.5625
3
[]
no_license
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os from epa.utils import get_class_with_name, ClassNotFoundError class Handler(object): handler_id = None def close(self): raise NotImplementedError def read(self): """ Read one Parameters ---------- ...
Java
UTF-8
1,066
2.828125
3
[]
no_license
package com.hmdu.bigdata.rpc; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.ipc.RPC; import java.io.IOException; import java.net.InetSocketAddress; /** * @ Author :liuhao * @ Date :Created in 14:13 2018/6/26 * @ rpc客户端: * 首先使用RPC的getPRroxy方法获取RPC客户端的代理类,也就是客户端类实现的接口,用来向服务器发送消息 */ publi...
Python
UTF-8
413
3.65625
4
[]
no_license
# message = 'A: Valar Morgulis! B: Valar Dahaeris..' # print(message) # print(len(message)) # print(message[0:].lower()) # print(message.count('A')) # #string.find -> shows from where the searched str starts # x = message.replace('A:', 'S:') # print(x) greeting = 'Cyka' name = 'Michael' beleidigung = 'Gandon, eb tv...
C++
UTF-8
2,692
2.9375
3
[]
no_license
/* * Copyright (c) 2003 Duke University All rights reserved. * See COPYING for license statement. */ #include <boost/config.hpp> #include <iostream> #include <vector> #include <map> #include <utility> #include <algorithm> #include <string> #include <boost/graph/adjacency_list.hpp> using namespace boost; using nam...
JavaScript
UTF-8
934
2.5625
3
[]
no_license
/** 数据初始化 */ import { observe } from './observe/index' export function initState (vm) { const options = vm.$options // vue 的数据来源 属性 方法 数据 计算属性 watch if (options.props) { initProps(vm) } if (options.methods) { initMethod(vm) } if (options.data) { initData(vm) } if (options.computed) { ...
C
UTF-8
23,065
2.515625
3
[ "Apache-2.0", "LicenseRef-scancode-gary-s-brown", "Unlicense", "BSD-2-Clause" ]
permissive
/** * * @file: fb_smo_jerry_test1.c * * @copyright * Copyright 2016-2020 Fitbit, Inc * SPDX-License-Identifier: Apache-2.0 * * @author Gilles Boccon-Gibod * * @date 2016-11-05 * * @details * * Simple Multipurpose Objects - JerryScript Tests 1 * */ /*---------------------------------------------------------------------...
Go
UTF-8
1,214
3.375
3
[]
no_license
//给定一个整数数组 nums 和一个整数目标值 target,请你在该数组中找出 和为目标值 的那 两个 整数,并返回它们的数组下标。 // // 你可以假设每种输入只会对应一个答案。但是,数组中同一个元素在答案里不能重复出现。 // // 你可以按任意顺序返回答案。 // // // // 示例 1: // // //输入:nums = [2,7,11,15], target = 9 //输出:[0,1] //解释:因为 nums[0] + nums[1] == 9 ,返回 [0, 1] 。 // // // 示例 2: // // //输入:nums = [3,2,4], target = 6 //输出:[1...
C++
ISO-8859-1
10,074
2.796875
3
[]
no_license
#include "NoArvoreEsparsa.h" NoArvoreEsparsa::NoArvoreEsparsa() { this->esq = nullptr; this->dir = nullptr; this->info = nullptr; } NoArvoreEsparsa::~NoArvoreEsparsa() { if (this->info != nullptr) delete info; if (this->esq != nullptr) delete esq; if (this->dir != nullptr) delete dir; ...
Java
UTF-8
602
2.53125
3
[]
no_license
package java.nio.file.spi; import java.io.IOException; import java.nio.file.Path; public abstract class FileTypeDetector { private static Void checkPermission() { SecurityManager localSecurityManager = System.getSecurityManager(); if (localSecurityManager != null) { localSecurityManager.checkPermiss...
PHP
UTF-8
3,241
2.65625
3
[]
no_license
<?php namespace Controllers; use \Library\View, \Library\Composer, \Library\Sanitize; use Models\EmailModel; class ReviewController { const AD_INCOMPLETE = 0; const AD_PENDING = 1; const AD_APPROVED = 2; const AD_REJECTED = 3; const AD_AUTO_APPROVED = 4; /** * Print the needed form to interact ...
JavaScript
UTF-8
1,842
2.65625
3
[]
no_license
const pool = require("../database") async function getPharmacies() { const results = await pool.query(`SELECT * from pharmacies`) try { return results.map(result => { const { longitude, latitude, ...res } = result res.coords = { longitude, latitude } return res ...
TypeScript
UTF-8
2,552
2.875
3
[ "bzip2-1.0.6", "BSD-3-Clause", "LicenseRef-scancode-openssl", "APSL-1.0", "LicenseRef-scancode-unknown-license-reference", "APSL-1.2", "MPL-1.1", "JSON", "LicenseRef-scancode-free-unknown", "LGPL-2.0-or-later", "ICU", "BSD-4-Clause-UC", "LicenseRef-scancode-warranty-disclaimer", "NTP", "...
permissive
import { app, BrowserWindow } from "electron"; interface Logger { log: (...msgs: Array<string>) => void; info: (...msgs: Array<string>) => void; warn: (...msgs: Array<string>) => void; error: (...msgs: Array<string>) => void; } export function isDev(): boolean { return /(\/|\\)electron(.exe)?$/i.t...
SQL
UTF-8
748
3.4375
3
[]
no_license
create database Messenger_Data use Messenger_Data create table Account ( Id int primary key identity(1,1), Login varchar(max) not null, Password nvarchar(max) not null, Name nvarchar(max) not null, Email varchar(max) not null, Image image not null ) select * from Account create table Message ( Id int primary k...
Python
UTF-8
8,938
3.171875
3
[]
no_license
import numpy as np import chainer import chainer.functions as F import chainer.links as L import chainerrl import math """ NOTE: this is navigation agent for chaser -> target. ACTION: up,down,left,right = 0,1,2,3 STATE: [cy,cx,ry,rx,direc] = chaser y, chaser x, runner y, runner x, direction looking from chas...
C++
UTF-8
842
2.9375
3
[]
no_license
// // main.cpp // Distinct Subsequences // // Created by Renchu Song on 10/7/14. // Copyright (c) 2014 Renchu Song. All rights reserved. // #include <iostream> using namespace std; class Solution { public: int numDistinct(string S, string T) { int n = (int)S.length(), m = (int)T.length(); if (n < m...
Java
UTF-8
2,286
2.125
2
[]
no_license
package id.ac.ui.cs.mobileprogramming.muhammadauliaadil.jasapedia.fragments; import android.os.Bundle; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; import androidx.lifecycle.Observer; import androidx.lifecycle.ViewModelProviders; import androidx.recyc...
Shell
UTF-8
198
2.921875
3
[]
no_license
#!/bin/bash set -e . "$(dirname -- "$0")"/functions.sh # Mac only is_mac || exit 1 # install for app in tmux reattach-to-user-namespace; do type -p "$app" >/dev/null || brew install "$app" done
JavaScript
UTF-8
2,914
2.765625
3
[]
no_license
import asyncHandler from 'express-async-handler'; import Property from '../models/propertyModel.js'; import Reservation from '../models/reservationModel.js'; import { isEqual } from 'lodash-es'; // @desc Fetch all propertyies // @route GET /api/properties?offset=&limit=&search_term=&sortby=&sortdirection= // @acc...
PHP
UTF-8
1,603
2.546875
3
[ "MIT" ]
permissive
<?php namespace App\Services; use App\Repositories\Abstracts\Repository; use App\Repositories\OptionRepository; use Illuminate\Contracts\Pagination\LengthAwarePaginator; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Collection; class OptionService { /*...
Java
UTF-8
10,295
1.898438
2
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
/*! ****************************************************************************** * * Pentaho Data Integration * * Copyright (C) 2002-2022 by Hitachi Vantara : http://www.pentaho.com * ******************************************************************************* * * Licensed under the Apache License, Version...
Python
UTF-8
2,408
3.3125
3
[]
no_license
""" idea: """ import time import itertools def main(): max_consecutive = 0 max_config = tuple() a = 1 b = 2 c = 3 d = 4 while True: if a == b: a = 1 b += 1 if b == c: b = 2 c += 1 if c == d: c = 3 ...
C#
UTF-8
422
3.25
3
[]
no_license
namespace System.IO { using System.Text; using System.Threading.Tasks; internal static class StreamExtensions { public async static Task<string> ReadStringAsync(this Stream @this) { @this.Position = 0; using (var reader = new StreamReader(@this, Encoding.UTF8))...
PHP
UTF-8
3,669
3.078125
3
[]
no_license
<?php require_once 'Conexion.php'; // class Empleado{ private $nif; public $nombre; public $telefono; public $email; public $departamento; public $categoria; public $salario; const tabla = 'empleados'; public function __construct($nif='', $nombre='', $telefono='', $email='', $departamento='', $categoria='', ...
JavaScript
UTF-8
362
2.90625
3
[ "Unlicense" ]
permissive
'use strict'; const inputRef = document.querySelector('#validation-input'); inputRef.addEventListener('focus', e => { inputRef.classList.remove('invalid', 'valid'); }); inputRef.addEventListener('blur', e => { e.target.value.length >= e.target.getAttribute('data-length') ? inputRef.classList.add('valid') ...
Markdown
UTF-8
1,038
2.859375
3
[ "MIT" ]
permissive
linter-crystal ========================= This linter plugin for [Linter](https://github.com/AtomLinter/Linter) provides an interface to Crystal's builtin syntax analysis. It will be used with files that have the `Crystal` syntax. As well, you must have the Crystal compiler installed on this system for this to work, t...
Python
UTF-8
833
3.6875
4
[]
no_license
# Definition for a binary tree node class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: # @param root, a tree node # @return a tree node def recoverTree(self, root): self.node1 = None self.node2 = None s...
C#
UTF-8
1,187
3.140625
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace la01_2_oroklodes_konstruktor { class Ember { public int Eletkor { get; set; } public string Nev { get; set; } public void Bemutatkozas() ...
Python
UTF-8
1,149
2.8125
3
[]
no_license
from pathlib import Path import os import getpass import PyPDF2 DIR_PATH = Path.home()/"---"/"~~~" def main(): for folder_name, sub_folders, file_names in os.walk(DIR_PATH): for file_name in file_names: if not file_name.endswith(".pdf"): continue full_file_name = os.pa...
Java
UTF-8
7,920
2.390625
2
[]
no_license
package com.liuhuan.widget; import android.content.Context; import android.os.SystemClock; import android.support.annotation.Nullable; import android.text.SpannableStringBuilder; import android.text.Spanned; import android.text.TextUtils; import android.text.style.ForegroundColorSpan; import android.util.AttributeSet;...
Markdown
UTF-8
1,115
2.609375
3
[]
no_license
# 一键锁屏.js ``` importClass(android.app.admin.DevicePolicyManager); importClass(android.content.ComponentName); var mDPM = context.getSystemService(context.DEVICE_POLICY_SERVICE); // 获取设备策略服务 var mDeviceAdminSample = new ComponentName(context, "org.autojs.autojs.ui.edit.EditActivity_"); activeAdmin(); lockScreen(); ...
Markdown
UTF-8
1,436
2.75
3
[ "Apache-2.0", "LicenseRef-scancode-warranty-disclaimer", "LicenseRef-scancode-unknown-license-reference" ]
permissive
# Administration and security of Code Insights ## Code Insights enforce user permissions Users can only create code insights that include repositories they have access to. Moreover, when creating code insights, the repository field will *not* validate nor show users repositories they would not have access to otherwi...
C#
UTF-8
2,845
2.75
3
[]
no_license
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace server_test_KLIENT { public class OdseparowaneIP { public byte ip3, ip2, ip1, ip0;...
Java
UTF-8
1,447
2.03125
2
[]
no_license
package ru.webotix.app; import com.google.inject.Binder; import com.google.inject.Inject; import com.google.inject.Module; import com.google.inject.servlet.ServletModule; import io.dropwizard.Configuration; import io.dropwizard.assets.AssetsBundle; import io.dropwizard.setup.Bootstrap; import io.dropwizard.setup.Envir...
PHP
UTF-8
6,229
2.671875
3
[ "Apache-2.0" ]
permissive
<?php namespace Kolay; use Http\Client\Common\Plugin\ErrorPlugin; use Http\Discovery\HttpClientDiscovery; use Http\Client\Common\PluginClient; use Http\Client\Common\Exception\ClientErrorException; use Http\Client\HttpClient; use Http\Discovery\MessageFactoryDiscovery; use Http\Discovery\UriFactoryDiscovery; use Http...
Java
UTF-8
917
2.515625
3
[]
no_license
package com.maksimovamaris.chess.game.pieces; import org.junit.Before; public class TestBishopBehavour extends TestHelper { private Bishop testBishop; private DiagonalCells diagonalCells; @Before public void prepareBoardDirector() { initialPrepare(); testBishop = new Bishop(Colors....
Rust
UTF-8
19,450
2.765625
3
[]
no_license
use rand::{random}; use std::mem; use fake_wesnoth; use rust_lua_shared::*; #[derive (Clone, Serialize, Deserialize, Debug)] pub struct Player { pub unit_moves: Vec<Option <Vec<(Move, f64)>>>, } use fake_wesnoth::{State, Unit, Move}; impl fake_wesnoth::Player for Player { fn move_completed (&mut self, state: &...
C++
UTF-8
2,237
2.6875
3
[ "Apache-2.0" ]
permissive
// // Created by Erez on 15/05/20. // #include "PointLight.h" #include <glm/glm.hpp> #include <glm/vec3.hpp> #include <glm/mat4x4.hpp> #include <glm/gtc/type_ptr.hpp> #include <glm/gtc/matrix_transform.hpp> #include <android/log.h> PointLight::PointLight() :t(){ mSize = 5.0f; mat =nullptr; } PointLight::~Poi...
Swift
UTF-8
71
2.65625
3
[]
no_license
func doubleArray3 (xs : [Int]) -> [Int] { return xs.map{x in 2 * x} }
C++
UTF-8
457
2.8125
3
[]
no_license
#ifndef COUNTY_H #define COUNTY_H #include <string> using namespace std; class County { private: string countyName; string stateName; int rVote; int dVote; int oVote; public: County( string countyName, string stateName, int rVote, int dVote, int oVote ); County( string line, string stateName ); v...
Java
UTF-8
92
1.6875
2
[]
no_license
package tictactoe.exceptions; public class TicTakToeException extends RuntimeException { }
JavaScript
UTF-8
876
2.953125
3
[]
no_license
import { Component } from 'react'; export default class CardDeckStorage extends Component { static cards = []; static grabCards(cardRequestAmount) { const requestCardList = []; let cardsLeft = this.cards.length; if (cardsLeft > 0 && cardsLeft > cardRequestAmount) { for (let...
Markdown
UTF-8
711
2.890625
3
[]
no_license
# Variable & Funtion Name BUILDER A Group project for Shark Hack Hackathon ## Team Members: Alexandra Kollarova Shraddha Kharche Sonali Ganatra Brian Vannah ## Link: [Variable & Funtion Name BUILDER](https://alexandrakollarova.github.io/Variable-Name-Builder/) ## Description: This app allows you to generate desc...
C#
UTF-8
1,978
2.6875
3
[ "MIT" ]
permissive
using System.Linq; using System.Net.Mail; using System.Threading; using System.Threading.Tasks; namespace DddDotNet.Infrastructure.Notification.Email.SmtpClient { public class SmtpClientEmailNotification : IEmailNotification { private readonly SmtpClientOptions _options; public SmtpClientEmai...
Java
UTF-8
7,754
2.09375
2
[ "MIT" ]
permissive
package cms; import http.FormPart; import http.HttpRequest; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.util.ArrayList; impor...
Markdown
UTF-8
9,981
2.734375
3
[ "MIT" ]
permissive
--- title: VSCode 快捷键 date: 2020-01-30 21:00:00 tags: 'VSCode' categories: - ['使用说明', '软件'] permalink: vscode-hot-keys photo: --- ## 简介 > VSCode 快捷键偏向 Emacs 类型 其中比较常用的快捷键, 都是批量替换偏多的操作 - `Ctrl + D`: 快速选择单词 - `Ctrl + G`: 跳转行 - `Shift + Alt + I`: 快速选择所有选中行 <!-- more --> ## 通用快捷键 | 快捷键 ...
Swift
UTF-8
2,075
2.6875
3
[]
no_license
// // ViewController.swift // Prework // // Created by Daniel Astudillo on 1/14/21. // import UIKit class ViewController: UIViewController { @IBOutlet weak var billAmountTextField: UITextField! @IBOutlet weak var tipControl: UISegmentedControl! @IBOutlet weak var tipAmountLabel: UILabel! @IBO...
Python
UTF-8
1,475
3.8125
4
[]
no_license
class Solution: def nextPermutation(self, nums: List[int]) -> None: """ Do not return anything, modify nums in-place instead. """ l = len(nums) index = 0 reverse = True if l > 1: for i in range(l-2,-1,-1): if nums[i] < nums[i+1]: ...
Java
UTF-8
1,803
2.296875
2
[]
no_license
package web.client; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import service.impl.BusinessServiceImpl; import domain...
C
UTF-8
3,304
2.734375
3
[ "MIT" ]
permissive
#include "vector3d.h" #include "fmgr.h" ///////////////////////////VECTOR GENERATION METHODS//////////////////////////// // PG_FUNCTION_INFO_V1(vector3d_constant); Datum vector3d_constant(PG_FUNCTION_ARGS) { double value = PG_GETARG_FLOAT8(0); PG_RETURN_ARRAYTYPE_P(Vector3dConstant(value)); } // PG...
Markdown
UTF-8
2,983
2.515625
3
[]
no_license
# Projeto 2 - Criando segmentos de clientes Segundo projeto do NanoDegree de Engenheiro Machine Learning da Udacity. Consiste em aplicar técnicas de aprendizagem supervisionada sobre os dados coletados pelo censo dos Estados Unidos para ajudar a CharityML (uma instituição de caridade fictícia) a identificar as pessoas ...
Python
UTF-8
14,508
2.671875
3
[ "Apache-2.0" ]
permissive
""" Gaitmate.py Code by Sammy Haq https://github.com/sammyhaq Class for pulling all of the libraries defined in this folder together. Contains everything, from the primary assignment of pins to creating a save buffer to save the data collected. Basically, this .py acts as the front end for all of the other code. This ...
Java
UTF-8
1,276
2.078125
2
[]
no_license
package com.bootdo.biz.domain; import java.io.Serializable; import java.util.Date; /** * 产品与品牌的关系; InnoDB free: 10240 kB * * @author tzy * @email tangzhiyu@vld-tech.com * @date 2019-04-05 14:14:36 */ public class BrandProductDO implements Serializable { private static final long serialVersionUID = 1L; //...
Java
UTF-8
1,356
3.015625
3
[]
no_license
package crl.action; import crl.actor.Actor; import crl.item.Item; import crl.player.Player; public class SwitchWeapons extends Action{ public int getCost() { return 25; } public String getID(){ return "SwitchWeapons"; } public void execute(){ Player aPlayer = (Player) performer; Item ...
C#
UTF-8
1,009
3.46875
3
[]
no_license
using System; namespace Task2 { class Program { static void Main(string[] args) { Console.WriteLine("Return minimum value, please type two numbers"); Console.Write("type number 1/2: "); int numberA; string userInput = Console.ReadLine(); ...
Java
UTF-8
487
3.203125
3
[]
no_license
public class Circle3 extends Shape3 { public Circle3(double x, double y, double radius) { super(x, y); this.radius = radius; } public double get_radius() { return radius; } public double get_area() { return Math.PI * radius * radius; } public double get_perimeter() { return 2 * Math.PI ...
C++
UTF-8
783
3.34375
3
[]
no_license
// Time complexity o(nlogn) #include<iostream> #include<algorithm> void majority(int arr[], int n){ std::sort(arr, arr+n); if(n%2 == 0){ for(int i=0; i< n/2; i++){ if(arr[i] == arr[n/2+i]){ std::cout << arr[i] << '\n'; return; } } } ...
Ruby
EUC-JP
951
3.4375
3
[]
no_license
#!/usr/local/bin/ruby -Ke # kconv饤֥KconvƤΤɤ߹ࡣ require 'kconv' # Ruby 1.8Kconv.guess֤Τǥܥ֤᥽åɤ򼫺롣 class String def guess_encoding case Kconv.guess(self) when Kconv::ASCII then :ASCII when Kconv::BINARY then :BINARY when Kconv::EUC then :EUC when Kconv::JIS then :JIS when Kconv::SJIS ...
Markdown
UTF-8
857
3.234375
3
[]
no_license
## New York City Taxi Trip Duration Prediction The purpose of this analysis is to accurately predict the duration of taxi trips in New York City. This work is for a [Kaggle competition](https://www.kaggle.com/c/nyc-taxi-trip-duration). ## How the problem is solved: * Developed a Machine Learning model to predict th...
Java
UTF-8
658
2.140625
2
[]
no_license
package com.mis.persistence; import java.util.List; import com.mis.domain.BookstoreVO; import com.mis.domain.SearchCriteria; public interface BookstoreDAO { public void create(BookstoreVO vo) throws Exception; public BookstoreVO read(int bookstoreNum) throws Exception; public void update(Bookstor...
JavaScript
UTF-8
3,982
3.0625
3
[ "MIT" ]
permissive
const { threadedClass, ThreadedClassManager } = require('../dist') const testData = require('./testData.js') const { TestClass } = require('./testClass.js') const CLASS_PATH = './testClass.js' // This is the path to the js-file (not a ts-file!) that contains the class async function runTests () { var t = {} let t...
Markdown
UTF-8
83
2.546875
3
[]
no_license
# Ecommerce-purchase-days-difference avg days differences between purchases - Ecom
Markdown
UTF-8
1,414
2.78125
3
[]
no_license
The project MscP3_Product_image_and_text_classificationn is a data scientist MSc student project. The objective is to make a classification of products from a market place with their images and text descriptions. - The input files are NOT present into the Git. It consists into 1050 images. They can be dowloaded at ...
C#
UTF-8
2,383
3.078125
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace OS3981 { class LRU { public string Name { get; set; } public int Value { get; set; } static int s = 3; public static List<LRU> Pages = new...
PHP
UTF-8
1,297
2.90625
3
[ "MIT" ]
permissive
<?php /** * Class Iso88591. * * @author Raphael Horber * @version 01.08.2019 */ namespace Rhorber\ID3rw\Encoding; /** * Implementation of EncodingInterface for 'ISO-8859-1'. * * @author Raphael Horber * @version 01.08.2019 */ class Iso88591 implements EncodingInterface { /** * Returns the encodi...
JavaScript
UTF-8
3,573
2.53125
3
[]
no_license
import React from 'react'; import PropTypes from 'prop-types'; class MyAccountForm extends React.Component { constructor(props) { super(props); this.emptyState = { username: '', oldPassword: '', newPassword: '', oldRecoveryQuestion: '', oldRecoveryAnswer: '', newRecoveryQu...
Java
UTF-8
1,740
2.71875
3
[]
no_license
package com.chinaedustar.publish.label; import com.chinaedustar.publish.PublishContext; import com.chinaedustar.publish.itfc.LabelHandler; import com.chinaedustar.template.TemplateConstant; import com.chinaedustar.template.core.AbstractLabelElement; import com.chinaedustar.template.core.InternalProcessEnvironmen...
C++
UTF-8
1,464
2.734375
3
[]
no_license
//UVa Problem-10089(Repackaging) //Accepted //Running time: 0.060 sec #include<iostream> using namespace std; const long long maxn=1001; bool repackage(long long pkgs[][3],long long npkgs){ for(long long i=0;i<npkgs;++i){ pkgs[i][0]-=pkgs[i][2]; pkgs[i][1]-=pkgs[i][2]; } long long x1=...
Java
UTF-8
768
3.453125
3
[]
no_license
package com.tcwgq.singletonpattern; /** * 单例模式: * 饿汉式:类一加载就创建对象 * 懒汉式:用的时候,才去创建对象 * * 面试题:单例模式的思想是什么?请写一个代码体现。 * * 开发:饿汉式(是不会出问题的单例模式) * 面试:懒汉式(可能会出问题的单例模式) * A:懒加载(延迟加载) * B:线程安全问题 * a:是否多线程环境 是 * b:是否有共享数据 是 * c:是否有多条语句操作共享数据 是 */ public class Singleton1 { private static ...
C#
UTF-8
1,630
2.546875
3
[ "MIT" ]
permissive
using CoreAnimation; using CoreGraphics; using UIKit; using Xamarin.Forms; using Xamarin.Forms.Platform.iOS; namespace Skor.Controls.iOS.Extensions { public static class BackgroundExtension { public static CAGradientLayer CreateBackgroundGradientLayer(float height, float width, float corner, UIColor s...
Shell
UTF-8
382
3.359375
3
[]
no_license
#!/bin/bash START="/etc/init.d/tomcat7 start" STOP="/etc/init.d/tomcat7 stop" LOGFILE="/var/lib/tomcat7/logs/catalina.out" SEARCHTERM="Server startup in" $STOP rm -rf /var/lib/tomcat7/work/* $START while read LINE; do if [[ $LINE =~ $SEARCHTERM ]]; then echo "Tomcat7 started OK!" break ...
JavaScript
UTF-8
369
2.5625
3
[ "MIT" ]
permissive
let http = require('http') // Para criar um servidor http.createServer(function(req, res){ res.end('Hello world') }).listen(8081) console.log('servidor rodando'); // http://localhost:8081/ // servidor aberto na porta 8081 // a cada alteração e nescessário fechar o servidor // e rodar novamente // ctrl + c -> pa...
JavaScript
UTF-8
644
2.875
3
[]
no_license
const fs = require('fs') const dir = process.argv[2] console.log(dir) console.log(process.argv[3]) fs.readdir(dir, (err, files) => { if (err) console.log(err); else { files.filter(file => { (file.includes('.md')) && console.log(file) }) } }) // const fs = require('...
PHP
UTF-8
1,648
2.71875
3
[ "MIT" ]
permissive
<?php namespace App\Http\Requests; use Illuminate\Foundation\Http\FormRequest; class UpdateInstitutionPost extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return true; } /** *...
C++
UTF-8
291
2.765625
3
[]
no_license
void setup() { // put your setup code here, to run once: Serial.begin(115200); } void loop() { // put your main code here, to run repeatedly: char *words[] = {"dash", "dot"}; Serial.println(words[0]); if (words[0]=="dash"){ Serial.println("OMG"); } Serial.println(sizeof(words)); }
PHP
UTF-8
4,482
2.6875
3
[]
no_license
<?php /** * Uploader Online Tests * * @version $Id: Uploader.php 537 2008-12-09 23:32:59Z edwardotis $ * @copyright 2005 */ require_once 'PHPUnit/Framework/TestCase.php'; require_once 'Phlickr/Tests/constants.inc'; require_once 'Phlickr/Uploader.php'; require_once 'Phlickr/AuthedUser.php'; // to verify that phot...
Java
UTF-8
1,235
2.546875
3
[]
no_license
package con.juancarlos.dao.Equipo; import com.j256.ormlite.dao.Dao; import com.j256.ormlite.dao.DaoManager; import con.juancarlos.db.DBConnectionORM; import con.juancarlos.entities.Equipo; import java.sql.SQLException; import java.util.List; public class DAOEquipoORM implements DAOEquipo{ Dao<Equipo, String> dao...
JavaScript
UTF-8
1,052
2.6875
3
[]
no_license
const fs = require('fs') const passagersCsv = fs.readFileSync('NombrePassagersTransportes.csv', 'utf-8') const kmsCsv = fs.readFileSync('NombreKMParcourus.csv', 'utf-8') const removeSemiColons = d => Array.from(d).filter(letter => letter !== ';').join('') const fixLine = line => line.trim().split(',') .map(remov...
Python
UTF-8
797
4.0625
4
[]
no_license
#python 3 #Cleiton Piccini #Algoritmo do metódo de Newton para encontrar raizes de funções. import math # Função def funcao (x): #x = (x / (math.e**(10*x))) - (1 / (math.e ** 5)) x = math.cos(50 * x + 10) - math.sin(50 * x - 10) return x # Derivada da Função def derivada (x): #x = (math.e**(-10*x)) *...
Python
UTF-8
1,105
3.453125
3
[]
no_license
class Solution: def isIsomorphic(self, s: str, t: str) -> bool: """Track replacement with HashMap on both directions. """ p, q = {}, {} for x, y in zip(s, t): if (x in p) and (y in q): if not (p[x] == y and q[y] == x): return False elif (x in p) ^ (y in q): return...
PHP
UTF-8
1,006
2.703125
3
[]
no_license
<?php namespace Pingu\Core\Traits\Models; use Illuminate\Support\Str; trait HasRouteSlug { /** * Boot trait */ public static function bootHasRouteSlug() { static::registered(function ($model) { if ($model->shouldRegisterRouteSlug()) { \RouteSlugs::registerSlu...
PHP
UTF-8
368
2.859375
3
[]
no_license
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; class CircleController extends Controller { public function show(int $radius) { return [ "type" => "circle", "radius" => $radius, "surface" => ($radius * $radius) * 3.14, #12.56, "circumfer...
Java
UTF-8
818
1.984375
2
[]
no_license
package zone.wim.item.tokens; import zone.wim.coding.DecodeAdapter; import zone.wim.coding.EncodeAdapter; import zone.wim.coding.SelfCoding; import zone.wim.coding.temporal.TemporalMark; import zone.wim.item.Item; import java.util.List; import java.util.Stack; enum SupportedCodecs { ISO_8601, TEMPORENC; } pu...
JavaScript
UTF-8
682
2.734375
3
[]
no_license
import React from 'react'; export default class Sum extends React.Component { constructor(props){ super(props); console.log(props); console.log('constructor'); } componentWillReceiveProps(nextProps){ console.log(this.props); console.log(nextProps); } shouldComponentUpdate(nextProps){ ...
Python
UTF-8
2,672
4
4
[ "LicenseRef-scancode-warranty-disclaimer" ]
no_license
# lex.py # Python Lisp LEXer from string import whitespace def lex(characters): "Convert a string of characters into a list of tokens." tokens = [] current_token = "" pos = 0 while pos < len(characters): # returns immediately if there are 0 tokens # By default, just add the current charac...
Java
UTF-8
8,024
2.203125
2
[]
no_license
package com.saiwei.recorder.logic; import java.io.File; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Date; import java.util.HashMap; import java.util.Set; import android.app.Application; import android.media.Camcorde...
SQL
UTF-8
4,553
3.15625
3
[]
no_license
-- MySQL dump 10.13 Distrib 5.1.30, for apple-darwin9.5.0 (i386) -- -- Host: localhost Database: timelis -- ------------------------------------------------------ -- Server version 5.1.30 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESUL...
Rust
UTF-8
9,936
2.71875
3
[ "Apache-2.0", "MIT" ]
permissive
//! The radio capsule provides userspace applications with the ability //! to send and receive 802.15.4 packets // System call interface for sending and receiving 802.15.4 packets. // // Author: Philip Levis // Date: Jan 12 2017 // use core::cell::Cell; use kernel::{AppId, Driver, Callback, AppSlice, Shared}; use ke...
C#
UTF-8
4,101
2.59375
3
[ "MIT" ]
permissive
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Xunit; namespace LimeBean.Tests { public class CustomKeysTests : IDisposable { BeanApi _api; public CustomKeysTests() { _api = SQLitePortability.CreateApi(); } public void Dis...
C
UTF-8
4,594
3.84375
4
[]
no_license
/* Manage orders for a waiter/waitress (including sorting). Lecture: IE-B1-SO1 (Software construction 1) Author: Marc Hensel */ #include <stdio.h> #include <stdlib.h> /* Enumerated types */ typedef enum { WATER, SOFT_DRINK, JUICE, BEER, COFFEE, TEA } drink; /* Structured types */ typedef struct orderItem { in...
Java
UTF-8
898
2.328125
2
[]
no_license
package org.kaleta.lolstats.ex.graph.line.data; import org.kaleta.lolstats.ex.entities.GameRecord; import java.util.List; /** * User: Stanislav Kaleta * Date: 12.6.2015 */ public interface LineDataModel { /** * * @param records */ public void initData(List<GameRecord> records); /** ...