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
Markdown
UTF-8
824
2.828125
3
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
# Hyperapp Temperature Took the hyperapp One boilerplate to test out HyperApp Hyperapp One is a Webpack boilerplate for quickstarting a web application with [Hyperapp](https://github.com/hyperapp/hyperapp), JSX, and Airbnb's JavaScript [Styleguide](https://github.com/airbnb/javascript) via ESLint. <h2>Table of Conte...
JavaScript
UTF-8
1,375
2.78125
3
[]
no_license
var filterSlider = { node: null, init: function(){ this.node = $('#filterSlider'); var progress = $($('.progress', this.node)[0]); this.barMaxWidth = progress.width(); this.barOffset = progress.offset(); progress.mousedown(function(e){ filterSlider.eventHandler(e); progress.bind...
Java
UTF-8
6,672
1.703125
2
[]
no_license
package com.findyou.findyoueverywhere.ui.user; import android.graphics.Color; import android.os.Bundle; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.text.Editable; import android.text.TextUtils; import android.text.TextWatcher; import andr...
C#
UTF-8
620
3.625
4
[]
no_license
using System; using System.Collections.Generic; using System.Linq; namespace Extensions { public static class ListExtension { public static void MoveElementToIndex<T>(this List<T> list, int element, int index) { T item = list[element]; list.RemoveAt(element); list.Inser...
C
GB18030
1,411
2.90625
3
[]
no_license
#include "wy_headfile.h" /***************************************************** *@Func: ʼLED ****** *@para: LED0:PB5 LED1:PE5 ****** *@desc: ******************************************************/ void LED_Init(void) { GPIO_InitTypeDef LED0_InitStructure;// PE5GPIOýṹ GPIO_InitTypeDef LED1_InitStruct...
C#
UTF-8
984
3.453125
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Indexers { class Program { class ParentClass { private string[] range = new string[5]; public string this[int index] { ...
PHP
UTF-8
4,238
2.859375
3
[ "MIT" ]
permissive
<?php namespace Entity; use Conn\Read; use Conn\TableCrud; use Helpers\Check; abstract class EntityDelete { protected static $error; /** * Retorna o erro acumulado na Entidade * * @return mixed */ public static function getError() { return self::$error; } /** ...
Markdown
UTF-8
6,724
3.078125
3
[ "MIT" ]
permissive
# Steering Committee Election 2019 process | Status | Authoritative location | | --- | --- | | Accepted | [https://github.com/rse-aunz/rse-au/blob/master/Elections/2019/process.md] | This document describes the process for nomination and voting for committee positions. This covers the elected positions, the nominatio...
Swift
UTF-8
1,482
2.546875
3
[]
no_license
// // DetailViewController.swift // Tips1 // // Created by katata on 2015/05/11. // Copyright (c) 2015年 Shun Katata. All rights reserved. // import UIKit class DetailViewController: UIViewController { var mUrl:String = ""; var wb:UIWebView = UIWebView() override func loadView() { var screenFra...
Java
UTF-8
1,809
2.28125
2
[]
no_license
package com.robin.PandemyTracker.api; import com.robin.PandemyTracker.model.Region; import com.robin.PandemyTracker.service.RegionDataManager; import com.robin.PandemyTracker.service.RegionService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.lang.NonNull; import org.spring...
Java
UTF-8
44,082
1.648438
2
[]
no_license
package a2l.anatlyzerext.visitor; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EReference; @SuppressWarnings("unchecked") public class AbstractAnatlyzerExtVisitor extends anatlyzer.atlext.processing.AbstractVisitor { protected boolean _debug = false; prote...
C++
UTF-8
1,261
2.578125
3
[]
no_license
#include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using namespace std; const int N=105,INF=1<<30; int n,a[N],sum[N],f[N][N],g[N][N],d[N][N]; #include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using namespace std; const int N=105; int n,a[N],sum[N],f[N][N],g[N][N],d...
Java
UTF-8
1,301
2.375
2
[ "Apache-2.0" ]
permissive
package com.example.fileuploader.lintener; import com.example.fileuploader.common.Constants; import com.example.fileuploader.model.MqTask; import com.example.fileuploader.model.OutputMessage; import com.example.fileuploader.service.ImageProcessingService; import org.springframework.amqp.rabbit.annotation.RabbitListene...
Python
UTF-8
627
3.734375
4
[ "MIT" ]
permissive
def fizzbuzz(n): ''' FizzBuzz The code from: https://blog.amedama.jp/entry/2016/01/25/212244 >>> from fizzbuzz import fizzbuzz >>> fizzbuzz(2) '2' >>> fizzbuzz(3) 'Fizz' >>> fizzbuzz(4) '4' >>> fizzbuzz(5) 'Buzz' >>> fizzbuzz(6) 'Fizz' ...
JavaScript
UTF-8
1,657
2.703125
3
[]
no_license
var express = require('express'); var router = express.Router(); const User = require('../models/user'); const TrueFalse = require('../models/trueFalse'); //Creer une question vrai/faux router.post('/', async (req, res) => { const user = await User.findById(req.body.teacher); if (!user) return res.status(400).j...
JavaScript
UTF-8
2,971
2.734375
3
[]
no_license
'use strict'; var YT_KEY = `AIzaSyANrISFcbmdjmL0lrQBylPpUUJmI_dTLk4` var SEARCH_KEY = 'searchKey'; var gSearch = []; console.log('servics'); function initSearch() { var searches = []; searches = loadFromStorage(SEARCH_KEY); if (!searches || searches.length === 0) { searches = []; } return...
Java
UTF-8
1,353
1.929688
2
[]
no_license
package com.huotongtianxia.huoyuan.ui.WDCD.ddgz; import android.os.Handler; import com.huotongtianxia.huoyuan.bean.SJLIDWBean; import com.huotongtianxia.huoyuan.http.HttpUtils; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; /** * Created by Administrator on 2017/4/26 0026. */ //获取订单...
Markdown
UTF-8
7,272
3.640625
4
[ "Apache-2.0", "BSD-3-Clause", "NCSA", "LicenseRef-scancode-public-domain", "BSD-2-Clause", "MIT", "Unlicense", "LicenseRef-scancode-other-permissive" ]
permissive
## 物件導向語言的特色 對於一個被視為物件導向的語言該有哪些功能,在程式設計語言社群中並沒有達成共識。Rust 受到許多程式設計理念影響,這當然包括 OOP。舉例來說,我們在第十三章探討了源自於函式語言的特性。同樣地,OOP 語言有一些特定常見特色,諸如物件、封裝(encapsulation)與繼承(inheritance)。讓我們看看這些特色分別是什麼意思以及 Rust 有沒有支援。 ### 物件包含資料與行為 由 Erich Gamma、Richard Helm、Ralph Johnson 與 John Vlissides(Addison-Wesley Professional, 1994) 所寫的書 *Design P...
Java
UTF-8
7,012
2.125
2
[]
no_license
package com.vvg.krivanek.warehouserental.dao.service; import java.sql.ResultSet; import java.sql.SQLException; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageImpl; import org.springframework....
Java
UTF-8
511
3.375
3
[]
no_license
package hackerRank; import java.util.Scanner; abstract class Book { static String title; abstract void setTitle(String s); String getTitile() { return title; } class MyBook extends Book { @Override void setTitle(String s) { this.title = s; } } public static class Abstract { public static v...
C
WINDOWS-1252
2,127
3.109375
3
[]
no_license
#include "fileoperation.h" #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <stdio.h> int create_file(const char *filename) { int ret = -1,fd; fd = open(filename,O_CREAT); if(fd > 0){ ret = 0; close(fd); } return ret; } int _read_fd(int fd,const char *buf,int maxs...
Python
UTF-8
214
3.046875
3
[]
no_license
from time import sleep print('Está quase na hora dos fogos de artifício') print('Vai começar a contagem regressiva...') for c in range(10, 0-1, -1): print(c) sleep(1) print('FELIZ ANO NOVO!!!')
Java
UTF-8
3,862
2.0625
2
[]
no_license
package com.sun.power.modules.system.organization.controller; import com.sun.power.core.common.entity.BaseDeleteRequestBodyVO; import com.sun.power.core.common.entity.BaseRequestVo; import com.sun.power.core.common.entity.PageBean; import com.sun.power.modules.system.organization.dto.OrganizationDetails; import com.su...
Markdown
UTF-8
2,483
2.875
3
[]
no_license
KilledByCops ============ A visualization of Americans killed by cops: 2000-2015 * Data from FatalEncounters.org, US Census, Center for Constitutional Policing * Images and map design &copy; 2015 ColorOfChange.org # Overview This project consists of two distinct parts, a Twitter application that sends tweets to the...
Java
UTF-8
1,088
2.4375
2
[]
no_license
package com.topas.microservicebatchasync.component; import java.util.Date; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import com.topas.microservicebatchasync.service.AsyncService; ...
JavaScript
UTF-8
1,433
2.734375
3
[]
no_license
import GifGridItem from "../../components/GifGridItem"; import "@testing-library/jest-dom"; import React from "react"; import { shallow } from "enzyme"; describe("Pruebas en GifGridItems ", () => { const title = "Hola Soy Goku"; const url = "Hola Soy Goku"; const wrapper = shallow(<GifGridItem title={title} url=...
Java
UTF-8
7,031
3.984375
4
[]
no_license
package edu.luc.cs271.linkedstack; import java.util.*; public class LinkedQueue<E> implements MyQueue<E> { private Node<E> first; private Node<E> last; private int size = 0; /** Adds a new object to the queue. Unless object is the first in the queue, object will be prioritized to be placed * in...
Swift
UTF-8
915
3.09375
3
[]
no_license
// // VegetableCell.swift // Vegetables11 // // Created by Nugumanov on 09.06.18. // Copyright © 2018 Nugumanov Dima. All rights reserved. // import UIKit enum CellIdentifiers { static let first = "firstCell" static let second = "secondCell" } class VegetableCell: UITableViewCell { @IBOutle...
Python
UTF-8
5,837
3.75
4
[]
no_license
""" An undirected, connected tree with N nodes labelled 0...N-1 and N-1 edges are given. The ith edge connects nodes edges[i][0] and edges[i][1] together. Return a list ans, where ans[i] is the sum of the distances between node i and all other nodes. Example 1: Input: N = 6, edges = [[0,1],[0,2],[2,3],[2,4],[2,5]] ...
C#
UTF-8
6,217
3.5625
4
[]
no_license
using System; using System.Collections; using System.Collections.Generic; namespace DataStructure { /// <summary> /// Defines generic queue data structure /// </summary> /// <typeparam name="T"> Type of nodes int a queue </typeparam> public class Queue<T> : IEnumerable<T> { #region Fie...
Java
UTF-8
13,407
1.726563
2
[]
no_license
package com.example.adoptapp.views; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatActivity; import androidx.constraintlayout.widget.ConstraintLayout; import androidx.recyclerview.widget.DefaultItemAnimator; imp...
Python
UTF-8
216
3.65625
4
[]
no_license
tabuada = 1 while tabuada <= 10: i = 0 print ('\t') print ('tabuada %d' %tabuada) while i <= 10: print ('%d x %d = %d' %(tabuada, i, tabuada * i)) i = i + 1 tabuada = tabuada + 1
Python
UTF-8
798
3.328125
3
[]
no_license
class Solution(object): def searchRange(self, nums, target): """ :type nums: List[int] :type target: int :rtype: List[int] """ lo, hi = 0, len(nums) - 1 core = -1 while lo <= hi: mid = (lo + hi) // 2 if nums[mid] < target: ...
SQL
UTF-8
7,983
2.828125
3
[]
no_license
-- -- The Events Package -- -- @author Michael Steigman (michael@steigman.net) -- @version $Id$ -- -- This package was orinally written by Bryan Che and Phillip Greenspun -- -- GNU GPL v2 -- -- -- Registration Object Type -- declare begin acs_object_type.create_type( object_type => 'events_registration', ...
Python
UTF-8
602
4.96875
5
[]
no_license
# Listing 1-17. Example codes for a ‘for loop’ statement # First Example print "First Example" for item in [1, 2, 3, 4, 5]: print('item :', item) # Second Example print "Second Example" letters = ['A', 'B', 'C'] for letter in letters: print(' First loop letter :', letter) # Third Example - Iterating by sequenc...
Python
UTF-8
4,274
3.359375
3
[]
no_license
# Question:第五章 模块 5.4 练习 展示目录列表 相当于 dir/ls # Solution:创建组合数据,存储filename、size、modified,利用dict.item()函数将dict转化为set并sorted利用key函数排序 # Answer:参考代码排序方法: # 获取所有文件名和目录名filenames、dirs # for name in filenames: 获取size modified # 构造元组,第一项为排序参照项,第二项为字符串filename、size、modified import locale import optparse import os import datetime ...
Java
UTF-8
4,187
3.515625
4
[]
no_license
package data_structures.sll; public final class SLLOperations { private SLLOperations() { throw new AssertionError(); } private static Node head; public static void insertAtBeginning(final Integer data) { final Node n = createRandomNode(data); n.setNext(head); head =...
C++
UTF-8
8,017
2.984375
3
[]
no_license
#include <iostream> #include <cstdio> #include <memory> #include <string> #include <cstring> #include <cmath> #include <algorithm> using namespace std; //#define N 21252 //1-1完美立方 // a 3 = b 3 + c 3 + d 3 的等式被称为完美立方等式。例如 //编写一个程序,对任给的正整数 N(N≤ 100),寻找所有的四元组 (a, b, c, d),使得 a 3 = b 3 + //c 3 + d 3 ,其中 a,b,c,d 大于 1, 小于等于...
Python
UTF-8
8,968
3.65625
4
[ "MIT" ]
permissive
# coding: utf-8 import numpy as np import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import argparse def euler(function,t0,tf,ts,f0,T,gamma,wallsize=5): '''Description: euler takes inputs and a function, and then performs the euler method to evaluate the solution to the differential...
Markdown
UTF-8
9,554
2.96875
3
[ "CC-BY-4.0", "MIT" ]
permissive
--- title: Create Bicep files - Visual Studio description: Use Visual Studio and the Bicep extension to create Bicep files for deploy Azure resources. ms.date: 09/12/2022 ms.topic: quickstart ms.custom: devx-track-bicep #Customer intent: As a developer new to Azure deployment, I want to learn how to use Visual Studio t...
Python
UTF-8
214
2.515625
3
[]
no_license
from sympy import Limit, Symbol, S p = Symbol('p', positive=True) r = Symbol('r', positive=True) t = Symbol('t', positive=True) n = Symbol('n', positive=True) print(Limit(p*(1+r/n)**(n*t), n, S.Infinity).doit())
C#
UTF-8
2,902
2.765625
3
[]
permissive
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using AutoMapper; using MassTransit; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata; namespace TemplateWebHost.Customization.BasicConsumers { /// <summary> ///...
Markdown
UTF-8
1,070
2.875
3
[]
no_license
# Genome Sharing ## Overview It is possible to share a genome annoted using the PATRIC Genome Annotation Service with specified other registered users. This allows these other users to interact with the genome in the PATRIC system in the same way as the user who originally annotated the genome. ### See also: * [Ge...
C#
UTF-8
870
3.5625
4
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DEV_8 { /// <summary> /// Class CountTypes /// contains interface ICommand /// </summary> class CountTypes : ICommand { /// <summary> /// Method Execut...
TypeScript
UTF-8
1,331
3.515625
4
[]
no_license
// Returns the position adjacent to the sprite in the specified direction const getAdjacentPos = (sprite: Sprite, direction: Direction) : Point => { let dx = 0, dy = 0; switch(direction) { case Direction.UP: dy = -sprite.height; break; case Direction.DOWN: dy...
TypeScript
UTF-8
480
2.734375
3
[]
no_license
import {OcDocument} from './oc-document'; export class Entry{ content: string; timestamp: Date; constructor(content?: string){ this.content = content this.timestamp = new Date() } toJson(doc?:OcDocument) { return {content: this.content, timestamp: this.timestamp.getTime()}; } ...
Markdown
UTF-8
8,435
2.75
3
[ "CC-BY-4.0", "MIT" ]
permissive
--- title: "Walkthrough: Publishing a Visual Studio Extension | Microsoft Docs" ms.date: "11/04/2016" ms.topic: "conceptual" helpviewer_keywords: - "publishing web controls" - "web controls, publishing" ms.assetid: a7816161-0490-4043-86f5-0f7331ed83b3 author: madskristensen ms.author: madsk manager: jillfra ms.work...
Java
UTF-8
1,975
2.9375
3
[]
no_license
package warmup; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; public class User { private String name; private Calendar cal; private SimpleDateFormat simpleDateFormatter; public User(String name) { this.name = name; this.cal = new Ca...
Markdown
UTF-8
1,042
3
3
[]
no_license
# Regions and Countries This project was generated with Angular 8.3.10 to display the details of a selected country in a tabular format. When the application loads, a user is presented with the following dropdowns: - Regions - Countries The Countries dropdown remains disabled until a user selects either Asia or Eu...
Java
UTF-8
264
2.421875
2
[]
no_license
import java.io.*; import java.util.*; public class LLit<E> implements Iterable<E> { private Node<E> l; public LLit() { l = new Node<E>(); } public Iterator<E> iterator() { LLit<E> i = new LLit<E>(l.getNext()); return i; } }
C
UTF-8
1,317
3.28125
3
[]
no_license
//kg m-3 #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> struct planet { char name[8]; double distance, mass, radius, density; }; double density(struct planet *p) { double result; result = (p->mass)/((4.0*M_PI*pow(p->radius,3))/3.0); return result; } double ylength(struct planet *p)...
JavaScript
UTF-8
1,103
2.703125
3
[]
no_license
export const constants = { updateUser: 'UPDATE_USER', loginStart: 'LOGIN_START', loginSuccess: 'LOGIN_SUCCESS', loginFail: 'LOGIN_FAIL', logout: 'LOGOUT', }; const model = { fetching: false, name: '', password: '', error: null, token: null, }; export default function (state = model, action) { ...
Python
UTF-8
558
2.546875
3
[]
no_license
class Solution(object): def longestCommonPrefix(self, strs): """ :type strs: List[str] :rtype: str """ if len(strs)<=0: return "" i=0 res="" while True: if len(strs[0])>i: ch=strs[0][i] for val in...
C#
UTF-8
11,210
2.578125
3
[]
no_license
//using System; //using System.Collections.Generic; //using UnityEngine; //using MyBox; //namespace Survival2D.WorldGen //{ // public enum Orientation // { // None = 0, // Left = -1, // Right = 1, // Up = -2, // Down = 2 // } // public class RoomProbDa...
C++
UTF-8
2,590
3.078125
3
[]
no_license
#include "player.hpp" player :: player() { total_score=0; total_score2=0; total_money=1000; bet_money=0; } player :: player ( int x, int y) { pos_x = x; pos_y = y; total_score=0; total_score2=0; times=0; total_money =1000; bet_money = 0; } void player::win_money(int x) { ...
Shell
UTF-8
1,734
2.828125
3
[ "Apache-2.0", "LicenseRef-scancode-public-domain" ]
permissive
#!/bin/bash set -e sudo apt-get clean -yqq sudo apt-get update -yqq sudo apt-get install -yqq \ ufw sudo ufw --force reset # Allow Incoming connection by default sudo sed -i -r 's/^(DEFAULT_INPUT_POLICY=).*/\1"ACCEPT"/g' /etc/default/ufw # Allow TCP forwarding sudo sed -i -r 's|^#(net/ipv4/ip_forward).*|\1=1|g'...
Java
UTF-8
4,034
2.03125
2
[]
no_license
package com.example.seodongmin.expediturerecord; import android.app.Activity; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import android.os.Handler; import android.support.v7.app.AppCompatActivity; import android.view.Window; import android.view.WindowManager; imp...
Markdown
UTF-8
3,114
3.171875
3
[ "CC0-1.0", "LicenseRef-scancode-public-domain" ]
permissive
# Project: Logs Analysis This project is part of the Full Stack Developer Nanodegree Program at Udacity. It analyses the logs of news database and answers a couple of important questions. More details can be found here: **[Project Overview](./project_overview.md)** **[Project Details](./project_details.md)** **[Pro...
JavaScript
UTF-8
3,888
3.171875
3
[]
no_license
/* globals module */ "use strict"; function solve(){ let costSum = 0, typesToReturn = []; class Product{ constructor(productType,name,price){ this._productType = productType; this._name = name; this._price = price; ...
JavaScript
UTF-8
1,368
2.734375
3
[ "MIT" ]
permissive
const test = require('tape') const { toStamp, getKey, formatElapsed } = require('../lib/util') test('formatElapsed', (t) => { const testCases = [ [5, '00:00:05'], [125, '00:02:05'], [3725, '01:02:05'] ] testCases.forEach(([elapsedSeconds, expectedStringRepresentation]) => { t.test(`${elapsedSecon...
C#
UTF-8
1,115
2.578125
3
[]
no_license
using System; using System.Linq; using ShoppingCartMVC.Models; namespace ShoppingCartMVC.Data { public static class DbInitializer { public static void Initialize(StoreContext context) { context.Database.EnsureCreated(); if (!context.Products.Any()) { ...
Java
UTF-8
479
2.28125
2
[ "Apache-2.0" ]
permissive
package com.greenpepper.server.domain; import javax.persistence.Column; import javax.persistence.MappedSuperclass; import javax.persistence.Version; @MappedSuperclass public abstract class AbstractVersionedEntity extends AbstractEntity { private Integer version; @Version @Column(name="VERSION") p...
JavaScript
UTF-8
7,416
2.546875
3
[]
no_license
$(function(){ value=window.devicePixelRatio; //三级联动实现 threeLinked("#province","#city","#country"); threeLinked("#province-home","#city-home","#country-home"); // 表单验证初始化 $("#form-user").Validform({ tiptype:3, btnSubmit:"#btn-save", btnReset:"#btn-reset", ...
Java
UTF-8
3,516
2.984375
3
[]
no_license
import java.io.*; import java.util.ArrayList; import java.util.regex.Matcher; //The guts of all of the parsing happens here public class ScriptAnalyzer { //Gets called from the driver to parse all of the input from the file and put it into an arraylist of parsed lines public StringBuffer analyze(File input, F...
C++
UTF-8
1,858
3.703125
4
[]
no_license
// // The main routine for a program that tests the solid class and its operators // #include <iostream> #include <iomanip> #include <cstdlib> #include <iomanip> #include "Solid.h" using namespace std; int main() { // Header cout << " -- SolidBeginningsClass Tester --" << endl << endl << endl; // ...
Java
UTF-8
897
2.046875
2
[]
no_license
package tech.techshop.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import springfox.documentation.builders.PathSelectors; import springfox.documentation.builders.RequestHandlerSelectors; import springfox.documentation.spi.DocumentationType; im...
Python
UTF-8
792
3.59375
4
[]
no_license
#!/usr/bin/env python2.7 ''' Given a sorted integer array without duplicates, return the summary of its ranges. For example, given [0,1,2,4,5,7], return ["0->2","4->5","7"]. ''' class Solution(object): def summary_range(self, nums): if nums is None or len(nums) == 0: return [] n = l...
Python
UTF-8
203
3.265625
3
[ "MIT" ]
permissive
def center_window(widget, width: int, height: int): x = (widget.winfo_screenwidth() - width) // 2 y = (widget.winfo_screenheight() - height) // 2 widget.geometry(f'{width}x{height}+{x}+{y}')
C#
UTF-8
1,763
3.03125
3
[]
no_license
using System; using System.Collections.Generic; using StackExchange.Redis; namespace AkkaCluster.SeedNodeRepository { public class RedisClient : ISeedNodeRepository { private Lazy<ConnectionMultiplexer> lazyConnection; public RedisClient(string connectionString) { lazyConn...
PHP
UTF-8
3,414
3.421875
3
[ "MIT" ]
permissive
<?php declare(strict_types=1); /** * Copyright (c) 2017 Andreas Möller * * For the full copyright and license information, please view * the LICENSE file that was distributed with this source code. * * @see https://github.com/localheinz/token */ namespace Localheinz\Token; final class Token { /** * ...
Java
UTF-8
4,382
1.984375
2
[]
no_license
package ir.donyapardaz.niopdc.base.service.dto.custom; import ir.donyapardaz.niopdc.base.domain.enumeration.CostMethod; import java.io.Serializable; import java.time.ZonedDateTime; import java.util.Set; /** * A DTO for the get rate product . */ public class ProductAmountRequestDTO implements Serializable { pr...
PHP
UTF-8
8,520
2.734375
3
[ "MIT" ]
permissive
<?php namespace kiss\components\oauth; use kiss\exception\ExpiredOauthException; use kiss\exception\InvalidStateException; use kiss\helpers\HTML; use kiss\helpers\HTTP; use kiss\helpers\Response; use kiss\helpers\Strings; use kiss\Kiss; use kiss\models\BaseObject; use kiss\session\Session; class Provider extends Base...
Python
UTF-8
607
3.734375
4
[]
no_license
class Ship: def __init__(self, name, location = '', destination = ''): self.name = name self.current_location = location self.destination = destination self.cargo_list = [] def sail(self): print("Sailing from ", self.current_location,"to", self.destination) def ad...
Markdown
UTF-8
2,330
2.984375
3
[]
no_license
# LabEddit ## Stack Esse é um projeto de Frontend Web feito utilizando ReactJS, HTML e CSS; e como gerenciador de pacotes do NodeJS o npm. Os arquivos estão divididos entre `components`(CriarComentario, CriarPost e outros) e as `pages` (Login, Register e outras) que são as páginas em si do projeto. ## Sobre O proj...
Python
UTF-8
2,077
3.90625
4
[]
no_license
# Modular programming # JRDay # 07.02.2020 def positive_float(prompt): ''' Get a positive float from user''' while True: try: number = float(input(prompt)) if number > 0: break else: print ("Non-negative number only!") exce...
Java
UTF-8
402
1.976563
2
[]
no_license
package service.impl.promotion; import data.dao.query.PromotionQueryDao; public class WebsitePromotionContainer extends AbstractPromotionContainer { private PromotionQueryDao dao; public WebsitePromotionContainer(PromotionQueryDao dao) { super(); this.dao = dao; refreshContainer(); } @Override public voi...
Markdown
UTF-8
2,989
2.96875
3
[]
no_license
- ## 组件生命周期componentWillUnmout中常进行的操作 >1.取消监听函数 ``` import React, { Component } from 'react'; export default class SideMenu extends Component { constructor(props) { super(props); this.state = { }; this.openMenu = this.openMenu.bind(this); ...
Java
UTF-8
656
1.90625
2
[]
no_license
package com.kellyqi.ttgl.dao; import java.util.List; import com.kellyqi.ttgl.model.User; public interface UserMapper { int deleteByPrimaryKey(Integer id); int insert(User record); int insertSelective(User record); User selectByPrimaryKey(Integer id); int updateByPrimaryKeySelective(User recor...
C++
UTF-8
1,557
2.984375
3
[]
no_license
#include "Bureaucrat.hpp" #include "ShrubberyCreationForm.hpp" #include "RobotomyRequestForm.hpp" #include "PresidentialPardonForm.hpp" #include "Intern.hpp" #include "OfficeBlock.hpp" int main() { Intern idiotOne; Bureaucrat hermes = Bureaucrat("Hermes Conrad", 37); Bureaucrat bob = Bureaucrat("Bobby Bobson...
Markdown
UTF-8
7,659
3.09375
3
[ "MIT" ]
permissive
# Overview ## Image registration Image resources are at the heart of the DLCS. You tell it about an image, it offers services associated with that image. This registration of images can be a manual process, using the user interface of the portal. It can be semi-automated, involving uploading large numbers of images f...
Python
UTF-8
729
2.875
3
[]
no_license
m,n = map(int,input().split()) a = [] for i in range(m): temp = list(map(int,input().split())) a.append(temp) sti = 0 stj = 0 gift = [a[0][0]] while(sti<(m-1) and sti<(n-1)): if(a[sti+1][stj] > a[sti][stj+1]): gift.append(a[sti+1][stj]) sti+=1 elif(a[sti][stj+1] > a[sti+1][stj]): ...
Markdown
UTF-8
927
2.5625
3
[]
no_license
# 滚动无限加载节流 根据isSending判断是否在发送状态,只有未在发送状态时才能发送状态,避免重复发送 ``` javascript handleInfiniteOnLoad() { const data = this.data; this.loading = true; if (data.length > 200) { this.$message.warning('Infinite List loaded all'); this.busy = true; this.loading = false; return; ...
Python
UTF-8
1,247
3.25
3
[]
no_license
__all__ = ''' classify '''.split() def classify(alphabet_size, iterable, key , *, output = None, return_output=False): ''':: UInt -> [a] -> (a->UInt) -> [[a]] input: alphabet_size :: UInt iterable :: Iter a key :: a -> UInt[0..alphabet_size-1] output :: None | [[a]]{alphabet_size....
Python
UTF-8
785
4
4
[]
no_license
"""A Program to determine whether a given number is valid per the Luhn Formula""" class Luhn: def __init__(self, card_num): self.card_num = card_num.replace(' ', '') self.first_step = self.card_num[-2::-2] self.second_half = self.card_num[-1::-2] def valid(self): """Validate t...
C++
UTF-8
582
2.84375
3
[]
no_license
#include<iostream> #include "Felino.h" using namespace std; class GatoDomestico : public Felino{ private: string nombreDuenio; public: GatoDomestico(int anioNacimiento,string lugarNacimiento,string raza,string nombreDuenio) : Felino(anioNacimiento,lugarNacimiento,raza){ this->nombreDuenio = nombreDuenio; ...
Java
UTF-8
3,719
2.328125
2
[]
no_license
package com.example.ddm.appui.bean; /** * Created by Zhouziwen . * 邮箱:1916973618@qq.com */ public class CommonBean { /** * msg : success * code : 1 * datas : {"sexValue":4,"qq":"228702245","realName":"付春雨", * "userTypeValue":1,"weixin":"","identity":"","sex":"男","name":"13353613565", ...
JavaScript
UTF-8
8,857
2.8125
3
[]
no_license
// Global Variables var brookfood = {}; brookfood.webdb = {}; var webappurl = ''; // http://brookfood.clientsee.co.uk var pictureSource; // picture source var destinationType; // sets the format of returned value // device APIs are available var onDeviceReady = function (){ pictureSource=navigator.camera.Pictur...
Python
UTF-8
399
3.140625
3
[]
no_license
''' 题目:模拟Linux用户登录。 ''' import time global user, name user = { 'woider': '3243', } def login(): global name name = input('Username:') pswd = input('Password:') if name not in user: return False return user[name] == pswd while (not login()): time.sleep(3) # 暂停3秒 print('Aut...
C++
UTF-8
800
3.875
4
[]
no_license
/* "Write a program which accept range from user and return addition of all numbers in between that range. (Range should contains positive numbers only) Input : 23 30 Output : 212 Input : -10 2 Output : Invalid range " */ #include<iostream> using namespace std; typedef int BOOL; #define TRUE 1 #define FALSE 0 BOOL F...
Java
UTF-8
3,666
1.765625
2
[ "Apache-2.0" ]
permissive
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2012.09.22 at 1...
Markdown
UTF-8
2,739
3.0625
3
[]
no_license
<img src="https://bit.ly/2VnXWr2" alt="Ironhack Logo" width="100"/> # Predicting Heart Diseases *[Miguel Estepa Polonio]* *[Data Analytics, Barcelona, 2020]* ## Content - [Project Description](#project-description) - [Hypotheses / Questions](#hypotheses-questions) - [Dataset](#dataset) - [Cleaning](#cleaning) - [Ana...
JavaScript
UTF-8
6,392
2.515625
3
[]
no_license
var mysql = require('mysql'); var http = require('http'); var fs = require('fs'); var url = require("url"); function registerUser(name, password) { var con = mysql.createConnection({ host: "localhost", user: "root", password: "", database: "adventure", }); va...
Java
UTF-8
2,466
2.4375
2
[]
no_license
package ie.cit.tom.entity; import java.math.BigDecimal; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; import javax.validation.constraints.DecimalMax; import javax.validation.constraints.De...
Markdown
UTF-8
1,306
2.9375
3
[ "MIT" ]
permissive
# oasis Welcome to oasis, my first data-saving operating system! ## Installing It's super simple. Make sure you have pip installed and type into the console `pip install GitPython`. Then, type `python` and paste `import requests as r; exec(r.get('http://bit.ly/get-oasis').text)` into the Python interpreter and choose t...
PHP
UTF-8
1,075
2.546875
3
[ "MIT" ]
permissive
<?php declare(strict_types=1); namespace Hyperized\Hostfact\Interfaces; use Psr\Http\Message\RequestInterface; use Psr\Http\Message\ResponseInterface; interface ApiInterface { public static function new(): self; public static function fromHttpClient( HttpClientInterface $httpClient ): self; ...
C
UTF-8
2,004
3.015625
3
[ "LicenseRef-scancode-warranty-disclaimer" ]
no_license
#include <CUnit/CUnit.h> #include <stdlib.h> #include <string.h> #include "rbt.h" void test_rbt(void) { // some data int one = 1; int two = 2; int three = 3; int four = 4; // create tree rbt tree; rbt_init(&tree); rbt_node *p; // tree is empty rbt_each(&tree, p) { CU_FAIL("tree not empty"); } // inse...
Java
UTF-8
4,792
2.140625
2
[]
no_license
package com.taotao.service.impl; import com.alibaba.dubbo.config.annotation.Service; import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; import com.taotao.dao.AdminRoleMapper; import com.taotao.dao.RoleMapper; import com.taotao.dao.RoleResourceMapper; import com.taotao.entity.PageResult; import ...
C++
UTF-8
1,243
2.515625
3
[ "MIT" ]
permissive
#include <iostream> #include <vector> #include <algorithm> #include <map> #define X first #define Y second using namespace std; const int MAXN = 1e4 + 123; map <string, vector <pair <long long, long long> > > score_table; typedef map <string, vector <pair <long long, long long> > >::iterator ITR; int main() { lon...
Java
UTF-8
679
2.109375
2
[]
no_license
package com.xr.treehole.config.selfdef; import lombok.Data; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.PropertySource; @Configuration @PropertySource("classpath:config.propertie...
Java
UTF-8
1,918
2.125
2
[]
no_license
package com.cpms.web.dto; import java.io.Serializable; import java.text.SimpleDateFormat; import java.util.Date; public class EmployeeDto implements Serializable{ private static final long serialVersionUID = 1L; static SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); private int empSeq; privat...